Commit Graph

43 Commits

Author SHA1 Message Date
fschneider@google.com e2a0c8f7ca Optimize stores to ExternalUint8Array and ExternalUint8ClampedArray in the optimizer.
This CL adds support for these two array types to the StoreIndexed instruction.
Review URL: https://codereview.chromium.org//12263010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18517 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-14 12:59:51 +00:00
johnmccutchan@google.com 9fb0984c9d SSE Assembler + Linux build fixes
Review URL: https://codereview.chromium.org//12223115

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18493 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-13 23:05:17 +00:00
johnmccutchan@google.com dd140c2958 Revert SSE assembler changes
Review URL: https://codereview.chromium.org//12212151

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18410 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-12 23:14:12 +00:00
johnmccutchan@google.com 06eb49d537 SSE Assembler and Disassembler support
Review URL: https://codereview.chromium.org//12207117

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18406 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-12 22:43:48 +00:00
regis@google.com 912194a756 Fix vm code base so that it can be built for --arch=simarm (no snapshot yet).
Review URL: https://codereview.chromium.org//11956004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17246 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 00:34:20 +00:00
srdjan@google.com 40a7130741 Inline Doubles truncate and round.
Review URL: https://codereview.chromium.org//11573044

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16983 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-11 20:42:47 +00:00
fschneider@google.com 87a3a4b479 Support immediate and memory operands for PushArgumentInstr in optimized code.
If a value is a constant or stored on the stack this change avoids loading it into a
new register before pushing it.
Review URL: https://codereview.chromium.org//11791051

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16806 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-08 16:51:57 +00:00
cshapiro@google.com 49f6f9f36d Merge the Merlin heap tracing to top-of-trunk.
Review URL: https://codereview.chromium.org//11428067

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16199 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-15 19:58:45 +00:00
vegorov@google.com 132bdc6bfb Support VTune's JIT interface.
R=iposva@google.com
BUG=

Review URL: https://codereview.chromium.org//11412106

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15517 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-29 13:54:06 +00:00
fschneider@google.com 5399496ac4 Only require SSE2 at minimum hardware requirement.
BUG=dart:6010
Review URL: https://codereview.chromium.org//11416136

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15253 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-22 12:46:57 +00:00
fschneider@google.com b38daebd36 Faster 64-bit left-shift for ia32.
This CL adds a fast left-shift that operates on unboxed mints.
(64-bit integers) to the ia32 optimizing compiler.
Review URL: https://codereview.chromium.org//11085004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13408 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-09 11:59:44 +00:00
fschneider@google.com 3efefbd582 Faster 64-bit right-shift for the ia32 compiler.
Review URL: https://codereview.chromium.org//11027060

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13295 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-05 14:42:00 +00:00
fschneider@google.com f60ebcc5fb Add fast 64-bit bitwise negation to the IA32 optimizing compiler.
Review URL: https://codereview.chromium.org//11043020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13221 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-04 12:01:12 +00:00
fschneider@google.com cb719805d8 Add fast 64-bit integer ADD and SUB to the optimizing compiler.
They operate on unboxed 64-bit integers stored in xmm registers.

I also fixed an issue with some SSE 4 specific assembler
tests where we hit an assert with an empty assembler buffer
when running with --no-use-sse41.
Review URL: https://codereview.chromium.org//11016028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13211 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-04 08:50:28 +00:00
fschneider@google.com 6632f191c4 Support for unboxed 64-bit integer bitwise operations and equality on ia32.
This CL adds AND, OR, XOR and == operations on unboxed 64-bit integers
(aka. mints).

Unboxed mints are stored in xmm registers. Each xmm register location
has an additional bit to keep track of its value representation.

Unboxed mints are materialized on the heap on deoptmization in the same way as
unboxed doubles.

The SSE instructions used are available on all CPUs that support SSE 4.1.
Review URL: https://codereview.chromium.org//10968059

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13112 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-02 11:25:53 +00:00
fschneider@google.com 71767f5218 Add code for CPU feature detection and use it to detect SSE3 and SSE 4.1.
The Dart VM now requires at least SSE3 to build and run.

There is a new flag --use-sse41 (default:true) to disable the use of 
SSE 4.1 features manually. 
Review URL: https://codereview.chromium.org//10990028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12897 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-26 09:08:21 +00:00
cshapiro@google.com da14bf70a7 Add attributions so printf like functions can have their arguments checked.
This change also corrects some misuses of format strings and format
arguments that discovered by the compiler checks.

Review URL: https://chromiumcodereview.appspot.com//10869063

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11912 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-06 00:58:25 +00:00
vegorov@google.com 1911b2bc81 Make register allocator to disregard constant computation with no uses.
Inline constant values into environments, instead of creating a use of the constant definition.

Change BinarySmiOpComp code template to allow inline constant uses for the right hand side.

R=fschneider@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10916082

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11798 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-04 09:58:57 +00:00
vegorov@google.com 264c4f6d1a Add support for XMM registers in SSA code generation pipeline.
Split BinaryDoubleOp into several instructions that manipulate unboxed doubles.

R=fschneider@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10875030

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11313 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-24 14:45:42 +00:00
vegorov@google.com 61dc368874 Fix kStoreBufferBlockProcessRuntimeEntry calling sequence.
Poping of volatile registers was performed without taking into account the fact that stack pointer could have been  modified to ensure correct alignment _after_ volatile registers were pushed.

Enable --use-ssa on x64 again.

BUG=4221

Review URL: https://chromiumcodereview.appspot.com//10820053

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10007 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-30 10:38:48 +00:00
vegorov@google.com 1bd5a9b414 Skeleton of a linear scan register allocator.
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10696151

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9563 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 18:52:17 +00:00
iposva@google.com dd800b6870 - On store buffer block overflow call a VM leaf function to
add the entries into the store buffer.
- Add a way to preserve and restore caller saved registers.
- Clean up the implementation of the stub for Assembler::Stop.
Review URL: https://chromiumcodereview.appspot.com//10758008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9490 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 22:58:27 +00:00
asiva@google.com f05e3736d8 Fix issue 1968, replace usage of inline 'asm' constructs in 'stack alignment', 'jump to exception handler' and 'jump to error handler' code with calls to appropriate stubs.
Review URL: https://chromiumcodereview.appspot.com//10664004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9071 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-25 17:35:20 +00:00
iposva@google.com 5e52657f33 - Implement the filtering store barrier on x64.
Review URL: https://chromiumcodereview.appspot.com//10581049

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8953 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-20 23:48:26 +00:00
asiva@google.com 88243dfce2 Rework leaf calls as just simple C calls with a signature and not the NativeArgumentDescriptor.
Review URL: https://chromiumcodereview.appspot.com//10592006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8881 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-19 23:57:40 +00:00
vegorov@google.com 959cf98b00 Implement a simple register allocator that tries to keep instruction results in registers.
Add --optimization-filter flag that allows to disbable optimizations for all function which do not match prefix. This allows to quickly localize problems with code generation.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10559035

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8811 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-18 18:04:22 +00:00
cshapiro@google.com e78250ca37 Generate code for store buffer updates in open-coded object field stores.
Review URL: https://chromiumcodereview.appspot.com//10536067

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8755 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-15 23:45:15 +00:00
srdjan@google.com c9801e0819 Implement is32 LoadIndexed.
Review URL: https://chromiumcodereview.appspot.com//10534105

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8555 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-12 16:27:18 +00:00
srdjan@google.com 0912e4ded7 More code for ia32, more shared code.
CreateArrayComp, EqualityCompareComp, StoreStaticField, LoadStaticField, StoreIndexedComp, StoreInstanceFieldComp, Throw, Rethrow, AssertBooleanComp.
Made more code shared, which has the disadvantage od splitting MakeLocationSummary from EmitNativeCode. Discuss.
Review URL: https://chromiumcodereview.appspot.com//10543013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8343 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-06 15:42:07 +00:00
srdjan@google.com 0f9c3f91cc Move inlined type checking code to new compiler ia32. Sharing more and more code between ia32/x64 (ongoing process), refactored x64 code slightly.
Review URL: https://chromiumcodereview.appspot.com//10477020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8292 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-05 16:37:38 +00:00
srdjan@google.com b4b68ef347 Move ReturnInstr to new scheme (x64 and ia32) and implement more code in new ia32 compiler.
Review URL: https://chromiumcodereview.appspot.com//10458050

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8166 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-31 17:24:23 +00:00
vegorov@google.com 9125248ea2 In generated code for x64 don't load object's class directly from class_ field.
Instead look it up in class table by class index taken from object's tags.

R=iposva@google.com

Review URL: https://chromiumcodereview.appspot.com//10458031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8159 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-31 15:35:14 +00:00
srdjan@google.com d0686c5a52 Started new compiler for ia32. Getters and setters can be intrinsified within the new compiler.
Review URL: https://chromiumcodereview.appspot.com//10458027

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8116 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-30 16:57:19 +00:00
vegorov@google.com 858b6d53e1 In generated code for ia32 don't load object's class directly from class_ field.
Instead look it up in class table by class index taken from object's tags.

Review URL: https://chromiumcodereview.appspot.com//10447064

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8101 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-30 12:25:49 +00:00
vegorov@google.com f999f30052 Extend assembler with ability to produce comments for the generated code.
Extend x64 disassembler with ability to decode and output recorded comments.

Example output (currently comments are emitted only by flow graph compiler at block/instruction boundaries, once instruction printing is refactored and supports printing into buffer simple "instruction" comment will be replaced with the actual IL construct):

        ;; B0
        ;; B1
        ;; instruction
0x007f0fff812525 00000055 49 bb 21 00 b4 04 10  mov    $0x7f1004b40021,%r11
0x007f0fff81252c 0000005c 7f 00 00
0x007f0fff81252f 0000005f 41 53                 push   %r11

R=srdjan@google.com

Review URL: https://chromiumcodereview.appspot.com//10407019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7723 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-17 21:56:16 +00:00
asiva@google.com 3107319e40 Simplify representation of stack frames. Remove the special types DartFrame/StubFrame and instead use StackFrame with methods IsDartFrame and IsStubFrame for frames representing Dart or Stub Code. This eliminates all the complexity that was added to ensure that we always see only one stub frame before hitting a dart frame during iteration.
Fixes bug 6380625 which was another case when we had two stub frames before hitting the dart frame.
Review URL: https://chromiumcodereview.appspot.com//10173008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6920 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-25 01:15:28 +00:00
srdjan@google.com 5023823e5b Fix trigonometric intrinsics: if allocation fails remember to release the loaded value on FPU stack.
Review URL: https://chromiumcodereview.appspot.com//9909024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6003 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-29 21:01:48 +00:00
srdjan@google.com 5d53270821 Intrinisifed more core library methods: isNaN, isNegative, cos, sin.
TODO: inline those methods in otpimized code.
Review URL: https://chromiumcodereview.appspot.com//9320023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3869 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-02 19:44:55 +00:00
sgjesse@google.com 65896148c9 Move utils.h and utils.cc from runtime/vm to runtime/platform
Moved additional parts of globals.h from vm/ to platform/ to support
types and constants used by utils.*.

R=ager@google.com, iposva@google.com

BUG=
TEST=

Review URL: http://codereview.chromium.org//9209001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3337 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-16 13:23:40 +00:00
sgjesse@google.com bf67f24098 Move assert.h/assert.cc from runtime/vm to runtime/platform
The purpose of this change is twofold:

1. Source in the bin directory can now use the same assertions as
   source in the vm directory. The ASSERT macro used by the code
   in runtime/bin was just defined to use assert from the standard
   C library.
2. Moving other implementation parts from runtime/vm to
   runtime/platform (e.g. classes Monitor and Mutex) for sharing
   between runtime/bin and runtime/vm will be easier as these
   implementations rely on these assertion macros.

Created two gypi files for the platform directory. One for the
headers and one for the source. The source one is only included
when building the VM library and will be present in libdart.a
when the dart executable is linked.

All the code for asserts is still in the dart namespace.

Also re-arranged the order of includes to be alphabetically in
the files touched.

R=ager@google.com, iposva@google.com

BUG=
TEST=

Review URL: http://codereview.chromium.org//9189003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3335 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-16 12:28:10 +00:00
turnidge@google.com c6aadb497d Teach the assembler how to generate multi-byte nops. Teach the
disassembler to understand them.  Use multi-byte nops in Align().  Add
tests.
Review URL: http://codereview.chromium.org//8888020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2290 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-08 23:35:34 +00:00
regis@google.com ec7f6331d1 Add 64-bit stubs to call into the runtime and to call native functions.
Fix 64-bit assembler bugs.
Review URL: http://codereview.chromium.org//8818001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2206 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-08 00:03:08 +00:00
dgrove@google.com 4c0f559d23 Initial checkin.
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-05 05:20:07 +00:00