Commit Graph

112 Commits

Author SHA1 Message Date
asiva@google.com 80e281a078 Fix for issues 6080 -
- Read the saved context from the entry frame when straddling across C++ frames while iterating over a stack trace in the debugger. This ensures that the correct context is setup in the ActivationFrame structure in these scenarios (instead of the empty context).

- Read the saved context from the caller's frame when iterating over a stack trace in the debugger. The compiler saves the context in the caller frame before invoking closures, we read this saved context when iterating the stack trace.
Review URL: https://codereview.chromium.org//12179020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18235 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-07 22:43:16 +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 04fc29c7e1 Optimize function at its entry instead of at exit.
The code can be patched if it should not be executed any longer.
The code can be now patched at other location than at entry, the requirement is still that patching code does not overwrite an inlined object.
Intrinsic methods that do not have a fall through cannot be patched.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16897 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-10 00:28:57 +00:00
asiva@google.com 4c069867e4 - Make Boolean 'true' and 'false' singleton VM isolate objects.
- Change all uses of it
Review URL: https://codereview.chromium.org//11745022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16623 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-04 01:52:05 +00:00
asiva@google.com 7022b39e35 Convert all symbol accessors to return read only handles so that it is not necessary to create a new handle in the code that uses it.
Added a few more strings to the symbols list.
Review URL: https://codereview.chromium.org//11667012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16584 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-02 19:31:59 +00:00
asiva@google.com 2c6de68680 Changed the API in DartEntry for invoking dart code from C++ to make it more compatible with the requirements of the runtime.
Deleted all the code duplication that was added to circumvent the old DartEntry API requirements.
Review URL: https://codereview.chromium.org//11613009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16288 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-18 21:36:01 +00:00
kmillikin@google.com 1610d7d2ac Refactor the InstanceFunctionLookupStub.
The stub is used in the case that an IC miss handler cannot find a
cacheable target.  It handles implicit closures, calls to instance
fields, and no such method.

Refactor the stub to make a single call into the runtime.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16057 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-12 19:52:47 +00:00
regis@google.com 697550b2a2 Support call operator in the vm.
Review URL: https://codereview.chromium.org//11316343

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16009 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-12 00:48:58 +00:00
asiva@google.com 6749a3be79 Add read only handles for the following predefined symbols
"=="
 "[]"
 "[]="
 "this"
and use them in the code.
Review URL: https://codereview.chromium.org//11519006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15942 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-11 01:20:02 +00:00
regis@google.com 3b1dfe51d1 Pass the proper invocation mirror argument to noSuchMethod.
Review URL: https://codereview.chromium.org//11523002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15939 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-11 00:31:53 +00:00
kmillikin@google.com a119414b2f Cache lookups at megamorphic call sites in optimized code.
The function name and argument descriptor are mapped to a lookup cache
at compile time.  The cache maps class id to target function.  It is
resizable.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15889 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-10 09:48:52 +00:00
kmillikin@google.com 3dabe31e91 Reapply "Do not call ResolveCompileInstanceFunction from the lookup stub."
With a fix for a crash bug on x64.  The near jump encoding could fail on
some platforms due to platform-specific code.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15845 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-07 13:00:38 +00:00
kmillikin@google.com 1ddeb10349 Revert "Do not call ResolveCompileInstanceFunction from the lookup stub."
This reverts svn revision 15842 due to a snapshot build failure on Mac.

TBR=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15843 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-07 11:21:13 +00:00
kmillikin@google.com c9bab9efaa Do not call ResolveCompileInstanceFunction from the lookup stub.
The InstanceFunctionLookup stub is only called after the inline cache miss
handler.  The miss handler ensures that ResolveCompileInstanceCallTarget is
called.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15842 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-07 11:13:51 +00:00
kmillikin@google.com 8c4e214722 Pass IC data and arguments descriptor to IC miss runtime functions.
Before, we obtained them by pattern matching backwards on the machine
instructions at the call site.  This previous approach becomes unwieldy when
we need to use to use multiple instance call patterns.

R=vegorov@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15737 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-05 15:35:18 +00:00
kmillikin@google.com 275c8d928f Introduce a class encapsulating arguments descriptor arrays.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15727 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-05 12:05:57 +00:00
asiva@google.com b7673910ab Fix for issue 6359 - Make snapshots platform independent.
The issue previously was that an instance size was stored a
size in bytes, similarly field offsets were stored as an offset
in bytes. This caused issues when generating the snapshot on
one platform and reading it on another platform.
The VM has been changed to store the instance size as a size in
words and the field offset as an offset in words.
Review URL: https://codereview.chromium.org//11421117

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15538 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-29 19:28:22 +00:00
asiva@google.com 3b5f530a44 Rename the field type_arguments_instance_field_offset_ to
type_arguments_field_offset_ in preparation for calling it
type_arguments_field_offset_in_words_
Review URL: https://codereview.chromium.org//11316203

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15431 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-28 01:36:04 +00:00
srdjan@google.com 85cf9af6ab Fix for issue 6678: Result of identical(a, b) with a and b doubles not consistent.
Implement proposed new identity spec (flag --new_identity_spec). It will be enabled/committed once the new spec been confirmed.

The new spec says that identity of numbers is computed on their values instead of on the object reference. This provides deterministic behavior without having to disable optimizations in the VM. In some cases 'identical' is now slower than 'equality' as more checks need to be done. The VM compiler can optimize 'identical' in the future.

My benchmarks do not show any slow down.
Review URL: https://codereview.chromium.org//11414136

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15332 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-26 18:35:45 +00:00
srdjan@google.com 637c7a8b1f Remove loading of function object in static calls.
Review URL: https://codereview.chromium.org//11419073

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15126 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-20 00:04:08 +00:00
vegorov@google.com b38ad8f4fb Count per check hits in ICData.
R=srdjan@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14870 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-13 23:21:02 +00:00
srdjan@google.com 7375693321 In optimized code use IC calls for instance calls that have no IC data instead of deoptimizing. The optimized IC call increments usage counter and reoptimizes optimized function if the threshold is met.
Recognize closure calls and mark them in ICData. Closure calls do not populate ICData, i.e., number of checks is always 0 (unless mixed closure calls with regular instance calls). Therefore closure IC calls do not count for reoptimization.
Review URL: https://codereview.chromium.org//11361225

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14860 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-13 18:34:05 +00:00
iposva@google.com 0c6ff657ed - Do not mix scalar values and object fields in RawInstance to
simplify the traversal for GC. Classes with native fields
  have a hidden reference to a typed array containing the
  native fields.
Review URL: https://codereview.chromium.org//11312183

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14821 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-12 23:21:04 +00:00
srdjan@google.com dc8115e19a Remove unused/not working function tracing flag and functionality.
Other small fixes, use stub to call optimization of a function (in preparation for reoptimization).
Review URL: https://codereview.chromium.org//11364184

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14756 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-09 20:55:31 +00:00
regis@google.com d372a816bb Pass closure object as first implicit argument to closure functions.
Remove code passing captured receiver to native instance closures; instead,
access captured receiver in context, as non-native functions do.
Review URL: https://codereview.chromium.org//11360116

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14698 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-08 18:28:07 +00:00
srdjan@google.com 32c54b3d60 Remove special meaning when usage counter reaches the threshold.
Review URL: https://codereview.chromium.org//11366076

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14540 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-05 17:07:06 +00:00
srdjan@google.com a397650682 For megamorphic calls (IC calls in optimized code), use a stub without attempting to count usage of function.
Review URL: https://codereview.chromium.org//11359046

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14499 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-02 20:21:33 +00:00
kmillikin@google.com 8c806ce0df Simplify the implementation and generated code for the IC stubs.
The implementation now uses the same code for 1 and >1 argument cases.  For
the 1 argument case the generated code is essentially the same code as
before.  For the >1 argument case the generated code is slightly improved.

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14249 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 09:37:35 +00:00
hausner@google.com 08bc0fb331 Add == method name to symbol table
Review URL: https://codereview.chromium.org//11236050

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13915 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-22 23:23:57 +00:00
asiva@google.com 1bf642129d - Get rid of RawClosure class and use RawInstance for closures.
- Simplify SetRaw to not require an access to the Current Isolate.
Review URL: https://codereview.chromium.org//11087070

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13581 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-11 20:34:08 +00:00
asiva@google.com 6b07453dd6 - Remove deprecated Dart API calls Dart_ClosureSmrck and DartClosureSetSmrck
- Remove the smrck field from RawClosure object.
Review URL: https://codereview.chromium.org//11017069

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13559 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-11 17:08:30 +00:00
srdjan@google.com 717e3c0396 Support for mixed null/smi equality: do not deoptimize, emit same optimized code as if that was smi-equality only.
Moved assert for duplicate class checks into ICData.
Allow CheckClassInstr to check for Smi as well.
Review URL: https://codereview.chromium.org//11048032

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13254 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-04 19:35:23 +00:00
srdjan@google.com 9dd3e6229c Split flag --trace-deopt into --trace-deoptimization and --trace-deoptimization-verbose. Print source line and function where deoptimization occured.
Review URL: https://codereview.chromium.org//11054002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13138 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-02 20:40:26 +00:00
zerny@google.com aa5281c88a Reapply "Deoptimization support in inlined code."
This reapplies r12488 with a fix.

R=kmillikin@google.com,fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12499 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-18 13:41:20 +00:00
zerny@google.com e174be3f27 Revert "Deoptimization support in inlined code."
This reverts commit a78e33f178aae74a97f4231ca98183adf97fda71.

TBR=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12492 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-18 12:18:04 +00:00
zerny@google.com 64a9ca2b81 Deoptimization support in inlined code.
Review URL: https://codereview.chromium.org//10928232

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12488 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-18 11:53:59 +00:00
srdjan@google.com 62a76d0783 Using type feedback, eliminate store barriers for indexed stores.
Review URL: https://chromiumcodereview.appspot.com//10910224

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12268 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-12 15:52:58 +00:00
lrn@google.com f52c24b62f Rename NoSuchMethodException to NoSuchMethodError.
Moved NoSuchMethodError to errors.dart.
No changes in co19 tests, but test status updated.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12172 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-11 09:52:25 +00:00
srdjan@google.com 67871d3098 Finish implementing lazy deoptimization (ia32, x64). Ran tests with --deoptimize-alot.
Review URL: https://chromiumcodereview.appspot.com//10912146

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12093 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-09 15:00:51 +00:00
vegorov@google.com a573d2dec8 Unbox phis that were proven to be of type Double.
Eliminate Boxing/Unboxing pairs.

Allow boxing, unboxing and double binary operations to participate in CSE.

Allow double comparisons to operate on unboxed inputs.

Support XMM registers and double spill slots in deoptimization.

Save XMM registers when calling to runtime from WriteBarrier stub.

R=srdjan@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11652 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 20:39:48 +00:00
asiva@google.com 00dd8aa761 Remove functions_cache_ and it's references as it is not being used anymore.
Review URL: https://chromiumcodereview.appspot.com//10824266

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10542 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-10 23:33:37 +00:00
asiva@google.com 5fd180cdfc 1. Register canonical names for internal VM classes and get rid of the method GetSingletonClassName
2. Create the empty_array object as a singleton in the VM isolate and remove it from the object store
3. Remove eager population of the functions_cache entry in the class. This results in a pretty impressive reduction of the initial isolate heap size:
    - on IA32 it goes from 1331k to 1071k
    - on X64 it goes from 2431k to 1911k
    - snapshot size also is reduced from 859219 bytes to 789147 bytes.
    (as a follow up change I will consider completely removing functions cache)
Review URL: https://chromiumcodereview.appspot.com//10827249

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10535 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-10 21:43:00 +00:00
srdjan@google.com b7f043bc6b Replace deopt stubs location/register shuffling with using deopt-info. Added deopt instruction commands. Also fixes a crash in IA32 with use_ssa where the stack is incorrect after deoptimization. Tested IA32 with and without use-ssa.
Review URL: https://chromiumcodereview.appspot.com//10825236

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10469 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-09 23:46:38 +00:00
srdjan@google.com 32d5673c05 Move deopt reason into PcDescriptor so the EAX/RAX register is not destroyed. Some cleanups in PC descriptor.
Review URL: https://chromiumcodereview.appspot.com//10832214

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10424 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-08 22:15:38 +00:00
asiva@google.com d4d781d636 - Unify class ids and snapshot object ids list so that we don't have disparate
and sometimes confusing values.
- Remove instance_kind_ field from RawClass.
- Rename all class id names to have a Cid suffix.
- Remove code from object.h and object_store.h which dealt with object ids
  of predefined classes for snapshots.
Review URL: https://chromiumcodereview.appspot.com//10827209

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10418 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-08 19:46:23 +00:00
srdjan@google.com ac8041f15d First step toward deoptimization using deoptimization info: splits deoptimization into two steps: copy frame to buffer, fill unoptimized frame from buffer. The only changes in the frame are the return address and the PC marker.
Second step will add deoptimization info 'instructions' that will fill the unoptimized frames using the saved registers and frame data.
Review URL: https://chromiumcodereview.appspot.com//10836020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10071 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-31 17:27:15 +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
srdjan@google.com 3402769c7a Use kIllegalObjectKind instead of NULL object to terminate ICData array
Review URL: https://chromiumcodereview.appspot.com//10796103

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9835 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-24 00:31:32 +00:00
srdjan@google.com c90763f160 Fix triggering of method optimization: increment counter at all IC calls and return as before but allow triggering of optimization only at exit of the method.
Review URL: https://chromiumcodereview.appspot.com//10779026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9710 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-17 16:35:45 +00:00
srdjan@google.com 00c3067049 Fix problem of excessive attempts to optimize, fix excessive deoptimizations for load/store indexed, performance issue with non-inlineable instance setter (direct call instead of IC call). Add tracing of issues encountered when attepting to optimize a method (--trace_failed_optimization_attempts), rename flag --print_stacktrace_at_throw.
Review URL: https://chromiumcodereview.appspot.com//10704210

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9680 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-16 20:55:09 +00:00