Commit Graph

87 Commits

Author SHA1 Message Date
Florian Schneider 9191b76fd2 VM: Set breakpoints on x64 and arm64 without patching code.
Instead of changing the generated code, change the target of calls
by changing the corresponding entry in the constant pool. Patchable
call sites can't share constant pool entries for now.
x64 and arm64 already had support for patching call targets in the
constant pool, but the debugger used to change the code instead.

This eliminates the fixed debugger stub entries in every constant pool.

R=hausner@google.com

Review URL: https://codereview.chromium.org//1137313002
2015-05-18 15:03:02 +02:00
fschneider@google.com 4201900778 VM: Small generated code size improvements on x64.
Addtional cleanup in code_patcher on all platforms.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42700 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-08 16:42:05 +00:00
koda@google.com c6bf5f2381 Support verified heap pointer writes on x64.
Port of r41607, r41700, and upcoming change:
https://codereview.chromium.org/721233002/

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41787 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-17 18:09:42 +00:00
regis@google.com e0ab99b0b2 Remember all deopt reasons in ic_data, not just the last one.
Remember if a JS warning was issued in ic_data.
Save a word in ic_data on 64-bit platforms.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35457 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-25 23:45:14 +00:00
hausner@google.com b4f0bf5998 Fix debugger stub patching on x64 architecture
Instead of patching the entry in the object pool, patch the offset
into the pool at the call site.

SIMARM and SIMMIPS will have to be fixed the same way in a later change.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31812 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-14 23:27:13 +00:00
srdjan@google.com d78737298c Last cleanup int -> intptr_t. Also removed a hack (boolean is not an integer).
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28372 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-08 18:54:00 +00:00
kmillikin@google.com b9715d23d0 x64: Use a short encoding of addq and subq for 32-bit immediates.
BUG=https://code.google.com/p/dart/issues/detail?id=13681
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28087 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-01 11:17:44 +00:00
kmillikin@google.com e375053d2f Pattern match on generated code to find edge counters.
In unoptimized code, use platform-specific pattern matching on generated
code to find edge counter arrays.  Previously we searched pointer offsets,
but that does not work on platforms that encode the edge counters as indexes
into an object pool (i.e., x64, ARM, MIPS).

BUG=
R=fschneider@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28085 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-01 10:22:47 +00:00
zra@google.com df2054dae7 Sets a register aside on x64 for use as a pool-pointer. It is loaded and restored from the code object on Frame entry and exit. All LoadObject calls that can, and many calls and jumps through ExternalLabels now use the pool-pointer. The --compiler-stats flag when running dart2js indicates that code size is reduced ~13%, and more is probably possible.
R=fschneider@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27295 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-09 15:39:26 +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 7d945c593a Remove skip_static_calls_ as it uses an obsolete way to check for uncalled static calls. Will be replaced by ICData tracking.
Add two different PCDescriptors to differentiate between optimized and unoptimized static calls (the former loads args. descr, the later loads ICData before calling).
Populate static call's ic_data field when optimizing.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24433 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-25 21:31:37 +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
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
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
srdjan@google.com ed84c54ce0 Improve code (less code, slightly faster) for polymorphic calls, by loading the argument descriptor only once instead of once for each call.
Review URL: https://codereview.chromium.org//12646012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20254 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-19 22:43:03 +00:00
regis@google.com 8c44be4313 Add support for object pool that will be used on ARM and MIPS architectures.
Modify code patching infrastructure to accept code object, which is necessary to
get to the object pool containing patchable target addresses.
Modify assembler test infrastructure to provide associated code object.
Review URL: https://codereview.chromium.org//12260026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18604 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-15 23:55:31 +00:00
asiva@google.com f4fe42c280 Added macros OBJECT_IMPLEMENTATION and FINAL_OBJECT_IMPLEMENTATION
which have different implementations of 'operator=' and 'operator^='.
In the case of FINAL_OBJECT_IMPLEMENTATION we do not do the vtable setting
in these methods (Note the |= operator functionality is now subsumed into
the new implementation of "operator^=")
Review URL: https://codereview.chromium.org//12052033

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17491 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-23 20:01:31 +00:00
srdjan@google.com d1c4735609 Transition ^= to |=
Review URL: https://codereview.chromium.org//11867022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17309 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 19:53:17 +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
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
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
srdjan@google.com 7c6a68f2a4 Simplify CodePatcher::GetStaticCallAt.
Review URL: https://codereview.chromium.org//11411072

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15101 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-19 19:17:02 +00:00
srdjan@google.com 101e9eed1d Flush instruction cache when patching for lazy deopt.
Review URL: https://chromiumcodereview.appspot.com//10914223

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12249 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-12 09:31:19 +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
srdjan@google.com 1125846660 When checking against non-parametrized types use a cache to hold result tuples (class, result). That cache is stored in the instruction stream. Currently implemented for instanceof, ia32 only. Should migrate to other type tests and architectures.
70x improvement on a benchmark (similar to what is seen in html _unwrap).
Review URL: https://chromiumcodereview.appspot.com//10010029

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6281 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-06 16:05:55 +00:00
srdjan@google.com 17537cf230 Fix crash in inline cache: forgot to GC properly RawICData. Various cleanups.
Review URL: https://chromiumcodereview.appspot.com//9567023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4832 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-01 22:02:41 +00:00
hausner@google.com e74d822b1d Fix merge error, Debug_StepInto test
Review URL: https://chromiumcodereview.appspot.com//9481018

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4641 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-27 22:18:00 +00:00
hausner@google.com 6d9abc5e3b StepOver, StepInto, StepOut
Implement single stepping in the debugger.
- Add PC descriptors for function return
- functions to set temporary breakpoints on all
  locations in a function.
- patching/restoring of function return code pattern
- determine call target of instance calls
Review URL: https://chromiumcodereview.appspot.com//9484002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4639 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-27 22:00:28 +00:00
kmillikin@google.com 552825c221 Required rename on x64 platform.
Due to a name clash, rename class Instruction => InstructionPattern.

BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4466 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-22 16:38:56 +00:00
srdjan@google.com a54f33bf92 ICData is now a wrapper object that refers to the calling function, target name, ic data array, etc. The old ICData C++ class that wrapped around an Array is removed. The advantage is that the ICData object remains the same, only its ic_data array object is being modified as classes are added..
TODO: store ICData-s into function so that the type feedback can be easily extracted (currently must traverse the unoptimized code).
Review URL: https://chromiumcodereview.appspot.com//9395016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4417 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-22 00:40:03 +00:00
regis@google.com a577991ad5 Port code generator to x64.
Review URL: http://codereview.chromium.org//8984003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2557 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-17 00:56:02 +00:00
hausner@google.com b7cf1328a1 Very first steps for a debugger
- Introduce Debugger class.
- Each isolate has a debugger object.
- Introduce stubs that can be put in place of static or dynamic
  Dart function calls.
- Very rudimentary command line option to place a breakpoint
  at the beginning of a function.
Review URL: http://codereview.chromium.org//8687037

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1928 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-30 17:04:45 +00:00
hausner@google.com 98ca000f01 Will be used by the debugger to find static calls in Dart code.
Review URL: http://codereview.chromium.org//8588014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1621 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-17 18:53:16 +00:00
srdjan@google.com 5f43c05de7 Implement new inline cache. Delete a lot of unused code (most of change).
Review URL: http://codereview.chromium.org//8379013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@706 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-25 18:35:49 +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