Commit Graph

74 Commits

Author SHA1 Message Date
asiva@google.com a576fec3c0 Allow the native resolver to setup whether it needs the Dart API scope to
be setup automatically or not when a native function is invoked.
This would allow the embedder to treat some native functions as leaf
functions whose invocation can be very light.

R=hausner@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31286 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-19 17:47:56 +00:00
zra@google.com 136597ec7d Pushes 0 for PC marker in runtime call stubs on ARM and MIPS.
R=iposva@google.com, regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30555 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-21 23:18:53 +00:00
asiva@google.com c0ddb83c3b ARM and MIPS changes which correspond to the initial change submitted in
https://codereview.chromium.org/63093003/

R=regis@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30124 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-08 19:40:07 +00:00
fschneider@google.com b324e06153 VM: Fix identical comparisons with bigints.
The optimizing compiler did not properly preserve registers across
the runtime call that occurs when using identical with bigints.

BUG=http://dartbug.com/14903
TEST=tests/language/vm/regress_14903_test.dart
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30058 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-07 17:27:16 +00:00
asiva@google.com 48e5bebfe3 Compute next field offset correctly.
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29818 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-04 16:51:48 +00:00
zra@google.com 039a4c4078 Disconnects code objects from infrequently used unoptimized functions.
Every 30 seconds (configurable by --code-collection-interval),
before a MarkSweep collection, this change halves a function's
usage count if it is unoptimized. If the function's usage count
reaches 0 as a result of this halving, it sets the function's
code pointers to null. Then, if the code object isn't marked
during the MarkSweep, it will be collected.

This change also checks for null code pointers in various
places, and recompiles/reconnects code if needed.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29209 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-24 21:26:15 +00:00
zra@google.com 9aa3dd488e Fixes a bug in runtime call stub on arm and mips.
GC was failing to visit the last argument to
runtime calls because the stack frame iterator
expects the same layout in the runtime call
stub as with other frames. Using the stub entry
macro ensures that the last argument is in the
expected place.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28803 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-17 15:08:59 +00:00
regis@google.com 2f900dab13 Cache number of type arguments in class object instead of recalculating it.
Reduce size of num_native_fields field in class object.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28670 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-15 18:31:31 +00:00
fschneider@google.com a329b0e6bc Dart VM: Simplify code generation for equality operators.
By inserting the necessary checks for null inside the callee
at the AST level, the code generation of == operations can be
greatly simplified.

This is a performance-neutral change and a step for allowing
generic inlining of arbitrary == methods. So far we could only
inline them for a common set of types in the flow graph
optimizer.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28084 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-01 10:10:50 +00:00
zra@google.com 1a9d6cfb1f Adds the BreakpointRuntime stub to ARM and MIPS.
Also:
- Makes some stub calls patachable.
- Updates pkg.status for an unrelated failing test.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28066 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-30 20:17:48 +00:00
zra@google.com a783459837 Preserves callee-saved FPU registers on ARM
Preserves callee-saved FPU registers on ARM when
going from C++ to Dart code. Adds assertions to
the simulator to make sure this is being done
correctly.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27072 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-03 18:23:43 +00:00
regis@google.com 8171570100 Fix the previously ineffective assert checking the number of arguments passed to
a runtime entry in the VM.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26826 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-28 23:07:14 +00:00
asiva@google.com b4d9e0d620 Auto create ApiLocalScope before calling native functions, this ensures that
native functions do not have to call Dart_EnterScope/Dart_ExitScope
when they callback into the VM.

Remove Dart_EnterScope/Dart_ExitScope calls around native functions in 'bin'
directory.

R=regis@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25827 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-06 19:27:48 +00:00
fschneider@google.com 3933db4a7b Simplify allocation stub for closures.
The compiler never generates code for allocating implicit static closures
using the allocation stub.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25573 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-29 16:56:39 +00:00
zra@google.com af23dfc5b2 Increases the number of ARM floating-point registers.
This is to be consistent with VFPv3_D32. Later, we'll detect
VFPv3_D16 at runtime.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25352 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-23 18:25:44 +00:00
srdjan@google.com 5781d7cc84 Collect both arguments for math's min/max static functions. Later that information will be used to inline the operation if possible.
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25225 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-19 16:49:29 +00:00
srdjan@google.com 624fb4cf59 Cleanup: remove argument descriptor parameter when calling inline cache miss handler.
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25162 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-18 18:15:29 +00:00
zra@google.com 3cebda38e6 Merges ARM load/store type enums into one enum.
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25064 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-16 18:32:40 +00:00
zra@google.com f219f81b14 Begins implementation of ARM neon instructions.
Just adds the vadd instruction, but also changes the
arm assembler to expose the Q registers rather than the
D registers. Q0 = D1:D0 = S3:S2:S1:S0. This is similar
to how ia32 and x64 use only the xmm registers for
floating point.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24982 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-12 23:22:50 +00:00
zra@google.com 20dcf8afaa Implements OSR for arm and mips.
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24896 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-10 23:45:18 +00:00
hausner@google.com 1e955965df Better single stepping in VM debugger
Single stepping now steps into the next dart code that the
user is interested in, including from one asynchronous task
to the next.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24632 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-01 17:29:18 +00:00
srdjan@google.com 0656d300ef Split IdenticalWithNumberCheck in two versions: once called from unoptimized code the other called from optimzied code. Only the one for unoptimized code will be able to stop for single stepping. The optimized version is a leaf stub and cannot cause GC.
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24557 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-27 21:52:49 +00:00
regis@google.com 5ffa56b798 Fix and simplify invocation of noSuchMethod on all platforms after the wrong
number (or bad name) of arguments is passed.
The frame of the wrong method (the one invoked with the wrong number or name of
arguments) is not left on the stack and therefore not visible in the stack trace
anymore, which is much cleaner, especially since the leftover frame was not
fully initialized.
This change was already done on ARM.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24485 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-26 19:58:49 +00:00
srdjan@google.com fa7817bf79 Change static calls in unoptimized code to always call via a stub. Using ICData, the call count of static calls is collected as well.
TODO: Use call frequency to guide inlining.

R=asiva@google.com, hausner@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24307 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-21 23:35:10 +00:00
srdjan@google.com 47de186e76 Store arguments descriptor in ICData. Remove loading of arguments descriptor at unoptimized call site (the ones using ICData).
R=asiva@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24239 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-20 16:29:39 +00:00
regis@google.com 8f62a87598 Switch code generation on ARM from softfp ABI to hardfp ABI.
Support leaf float runtime calls in ARM simulator.
Enable previously failing tests.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23868 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-11 16:47:01 +00:00
regis@google.com 392e71ed37 Fix MegamorphicMiss stub on ARM.
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23188 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-24 22:50:05 +00:00
hausner@google.com 4b497b0c17 Consolidate debug stubs
The new debug stub BreakpointRuntime gets the original stub address
from the debugger. With this scheme, we don't need a new debug stub
for every runtime stub that the debugger patches.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23094 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-23 18:42:03 +00:00
regis@google.com 89b673467c Enable code optimization on ARM.
Disable failing tests.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23037 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-22 18:53:51 +00:00
hausner@google.com 7349a6d611 Make breakpoints on == fire reliably
Add breakpoints in the path taken if one of the operands
in a == b is null.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22857 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-17 17:08:09 +00:00
regis@google.com 9e867eb4a1 Make deoptimization architecture dependent (it depends on the frame layout).
R=srdjan@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22719 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-14 23:23:54 +00:00
hausner@google.com 80c7ad1070 Implement breakpoint for closure calls
Introduce a new PcDescriptor kind to distinguish closure calls from other runtime calls. The debugger can patch these calls to set a breakpoint. When stepping into a closure call, the debugger must fish out the closure object from the stack, find the function and set breakpoints in it.

Arm and Mips breakpoint stubs are not implemented yet. ia32 and x64 stubs tested by hand. Automated test to follow.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22596 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-10 21:06:04 +00:00
vegorov@google.com 2565ca222f Implement a variation of scalar replacement for non-escaping allocations.
AllocationSinking pass discovers non-escaping allocations that have no input uses other than uses in the stores into its own fields.

Every environment use of such allocation is replaced by a state snapshot (MaterializeObject instruction) that describes the state of each initialized field in the object. State snapshots are computed through an additional round of load-forwarding.

Once snapshots are computed allocations are removed from the graph.

MaterializeObject instructions are not compiled into native code but produce deoptimization instructions instead that describe how object should be materialized at deoptimization.

Deoptimization instructions now follow the following format:

[mat obj #1]...[mat obj #N][ret addr][... mat arguments ...][... real frames ...]

- the prefix describes each object to materialize on deopt via kMaterializeObject instruction;
- actual values that are needed for materialization are emited as a part of bottom-most stack frame. This is done to simplify implementation: they need to be discoverable by a GC during materialization phase. At the end of deoptimization they will be removed from the stack;
- normal stack slots can refer to materialized objects via kMaterializedObjectRef instruction.

Additionally this change contains fixes in load-forwarding that are needed to guarantee that all artificial LoadField instructions inserted during AllocationSinking are correctly replaced with actual values.

Limitations of the current implementation:

- can't eliminate allocations that flow into phis but otherwise don't actually escape;
- can't sink allocations out of loops;
- allocation with type arguments are not handled.

R=regis@google.com, srdjan@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22485 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-07 23:40:42 +00:00
regis@google.com 53347a3337 Remove stack_frame_<arch>.cc files.
The architecture specific information is in stack_frame_<arch>.h files.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22470 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-07 18:06:21 +00:00
iposva@google.com 083c9e5e95 - Remember the fact that an object has been added to the
store buffer by a bit in the header.
- This bit can be used to filter out redundant additions
  into the store buffer making the dedup sets not needed.
- Remove the need for a HashSet when remembering old to
  new references.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22393 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-03 20:59:42 +00:00
regis@google.com deeb192b03 Cleanup deoptimization code to make it architecture independent (in progress).
Implement some optimizing code on ARM in order to debug the above cleanup using
inline_stack_frame_test (still skipped in the vm status file).

This is not quite working yet, because CompilerDeoptInfo::CreateDeoptInfo
makes assumptions about the stack layout that are not valid for ARM or MIPS.
This will be cleaned up in a following cl.

R=srdjan@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22386 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-03 18:39:40 +00:00
zra@google.com 87ae3bb45f Allows "Hello, world!" to run on ARM hardware.
Also, enables more vm tests on SIMMIPS.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22344 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-02 22:58:52 +00:00
zra@google.com 3c10f6b796 On MIPS, keeps Object::null() in a register.
On MIPS, we have a lot of registers, and we don't use very many of them.
This change removes the second temporary register TMP2, and instead
dedicates a register to holding Object::null(), which is used frequently
for comparisons, etc..

Also, uses branch delay slot when leaving a dart frame and returning.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22331 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-02 17:53:34 +00:00
zra@google.com aa2dd0acf7 On MIPS, uses more branch delay slots.
Also, tries to reorganize loops to look like what gcc produces.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22262 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-01 16:56:31 +00:00
iposva@google.com f2cfdc25d0 - Disassociate old page size from new allocatable size.
- Have a different cutoff for large page allocations
  and default old page size.
- Do not align old pages to old page size.
- Do not track used space during marking.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22064 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-26 06:57:29 +00:00
zra@google.com a49ab3a890 Adds support for debugger API on MIPS.
Enable debugger api tests on MIPS.
Enable isolate tests on MIPS.
Enable code descriptors tests on MIPS.
Enable snapshot tests on MIPS.
Enable heap tests on MIPS.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22042 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-25 18:03:15 +00:00
regis@google.com 52a0f3c983 Enable api tests on ARM.
Disable generation of optimized code on ARM and MIPS.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21972 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-24 18:55:52 +00:00
zra@google.com 697364354b Implements catch on MIPS.
Enables UnhandledException test for MIPS.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21898 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-23 18:15:52 +00:00
regis@google.com ad6005e5c4 Support debugger API on ARM.
Support smull ARM instruction in order to detect 32-bit multiplication overflow.
Enable debugger api tests on ARM.
Enable isolate tests on ARM.
Enable code descriptors tests on ARM.
Enable snapshot tests on ARM.
Enable heap tests on ARM.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21890 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-23 16:10:22 +00:00
regis@google.com 301c572eea Implement missing features to run Hello world! in checked mode on simulated ARM.
Review URL: https://codereview.chromium.org//14192032

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21780 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-19 23:21:07 +00:00
regis@google.com 7f1bc0d351 Enable stack frame vm tests on ARM.
Review URL: https://codereview.chromium.org//14328026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21748 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-19 16:06:40 +00:00
regis@google.com b59deaa17a Merge JumpToErrorHandler and JumpToExceptionHandler stubs on all architectures.
Review URL: https://codereview.chromium.org//13874010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21689 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-18 18:32:06 +00:00
regis@google.com d79c7c1969 Implement long jump in ARM and MIPS simulators.
Implement error and exception handler stubs on ARM.
Hook up simulator for object tests.
Enable codegen and object tests on ARM.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21680 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-18 16:23:25 +00:00
regis@google.com a22fc972c7 Minor cleanup of ARM stubs.
Review URL: https://codereview.chromium.org//14268006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21647 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-17 18:48:40 +00:00
regis@google.com ea04c34362 Uncomment more vm tests on ARM (and some on MIPS too).
Implement context allocation stub.
Some cleanup.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21626 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-17 16:02:02 +00:00