Instead of calling code object directly, call indirectly and
pass the code object in a register. The object pool is then loaded from
the code object. This is another preparation step for making generated code
relocatable.
All non-ia32 platforms:
No entry patching.
ARM:
PC marker (now code object) moves to the same place as on x64 (below saved PP, above saved FP).
R9 is now used as PP, R10 as CODE_REG.
BUG=
R=koda@google.com, rmacnak@google.com
Committed: 1d343e5a7b
Review URL: https://codereview.chromium.org//1192103004 .
Instead of calling code object directly, call indirectly and
pass the code object in a register. The object pool is then loaded from
the code object. This is another preparation step for making generated code
relocatable.
All non-ia32 platforms:
No entry patching.
ARM:
PC marker (now code object) moves to the same place as on x64 (below saved PP, above saved FP).
R9 is now used as PP, R10 as CODE_REG.
BUG=
R=rmacnak@google.com
Review URL: https://codereview.chromium.org//1192103004 .
This makes the code in the code generator independent from how stubs
are actually called (i.e. directly embedding the target address, or
indirectly by loading the target address from the code object).
BUG=
R=rmacnak@google.com
Review URL: https://codereview.chromium.org//1270803003 .
This allows to make the last explicitly named stubs shared between isolates.
When sharing code stubs, we can't do patching at their entry anymore.
Therefore, I had to remove patching support of the array allocation stub.
Is this a functionality we want to keep?
The change is mostly performance-neutral because optimized code has an inlined fast
path for array allocation and only uses the stub for the slow-case.
The only isolate-specific stubs left are object allocation stubs which are
associated with their Class are per-isolate.
Since this CL removes any isolate-specific stubs from StubCode, it becomes AllStatic.
BUG=
R=koda@google.com
Review URL: https://codereview.chromium.org//1247783002 .
kClosureCall and kOptStaticCall are not needed anymore.
Closure calls are implemented as instance calls - the ClosureCall instruction
only occurs in the synthetic FunctionImpl.call dispatcher - and does not correspond
to a source location where breakpoints can be set.
kOptStaticCall is not needed because breakpoints can only be set in unoptimized
code. kOther is used instead.
This also removes an unused PC descriptor at closure calls from unoptimized
code.
BUG=
R=vegorov@google.com
Review URL: https://codereview.chromium.org//1160063002
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
Change executable pages to be read/execute but not writable by default.
All pages are made temporarily writable just before a full GC, because both
the mark and sweep phases write to the pages. When allocating in a page and
when patching code, the pages are made temporarily writable.
The order of allocation of Code and Instructions objects is changed so that
a GC will not occur after Instructions is allocated. (A full GC would
render the Instructions unwritable.) A scoped object is used to make memory
protection simpler.
Original CL: https://codereview.chromium.org/106593002/
I added a cc test that is expected to crash.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//136563002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32493 260f80e4-7a28-3924-810f-c04153c831b5
This change replaces https://codereview.chromium.org/135213002/
The specialized debugger stub call for static method calls is
no longer needed. It was introduced because once upon a time, the
static method call stub used to patch the call site when the target
was compiled. The VM stopped patching unoptimized static calls a
long time ago. Thus we can treat a static call like a regular runtime
call when patching it to set a breakpoint.
Bonus fix: single step runtime callback on mips was broken. The
enter/leave stub frame were missing.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//140793010
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31928 260f80e4-7a28-3924-810f-c04153c831b5
inlined frames.
------------
Most remaining deoptimization code from the code generator moves to
DeoptContext. This allows the code to be reused by the debugger.
There is some rework of the code along the way. The remaining code in
the code generator is simpler.
Implement the ability to deopt a frame to an Array. Each inlined
frame accesses its locals from this array at some fixed offset.
Refactor the Debugger::CollectStackTrace code. New code is int
Debugger::CollectStackTraceNew. There is a flag --use_new_stacktrace
which can be used to revert back to the old version. I intend to
remove this flag shortly, after any dust clears.
Added a unit test which makes sure that we can inspect locals from
optimized and inlined frames. Tested this code in the dart editor
debugger as well.
R=iposva@google.com, srdjan@google.com
Review URL: https://codereview.chromium.org//26255004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28468 260f80e4-7a28-3924-810f-c04153c831b5
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
Splitting breakpoints into SourceBreakpoint that represent
a user-defined source location of a breakpoint, and
CodeBreakpoint, which represents a code location. There can
be more than one CodeBreakpoint per SourceBreakpoint, e.g.
for functions that are also called as closures (and are thus
compiled twice.)
Functions are no longer compiled as a side effect of setting
a breakpoint. When they eventually get compiled, the previously
recorded SourceBreakpoint is found and a CodeBreakpoint is set.
Review URL: https://chromiumcodereview.appspot.com//9581013
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4891 260f80e4-7a28-3924-810f-c04153c831b5