Commit Graph

47 Commits

Author SHA1 Message Date
Florian Schneider f47839ba09 Rename DART_PRECOMPILED -> DART_PRECOMPILED_RUNTIME
To avoid future confusion with precompiler compiler-related macros/build targets

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1581393008 .
2016-01-19 13:59:49 -08:00
Florian Schneider 3e3ca58375 Drop precompiler-related code from dart_precompiled binary.
Also drop stub-code generation code, which pulled in large parts of the assembler as well.

This reduces the size of dart_precompiled/libdart_precompiled by around 100K on x64.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1560663002 .
2016-01-06 11:40:43 +01:00
Srdjan Mitrovic 1b17e78f38 Create code and instruction object, and install them in the background compilation thread while bringing mutator thread to a saferpoint.
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1454553004 .
2015-11-18 11:32:17 -08:00
John McCutchan ceb12c4f69 Switch profiler from isolates to threads
- API breakage: Dart_IsolateBlocked, Dart_IsolateUnblocked -> Dart_ThreadDisableProfiling, Dart_ThreadEnableProfiling.
- Remove IsolateProfilerData.
- Move thread at blocking call count from isolate to thread.
- Always interrupt threads unless they are blocked.
- We can no longer count "idle" ticks.
- Only record sample if thread is the current mutator of an isolate.
- Refactor ThreadInterrupterCallback to ensure that Thread* is valid.

Threads are only ever sent signals if ThreadInterruptsEnabled is true. Which is controlled by two functions:

void DisableThreadInterrupts();
void EnableThreadInterrupts();

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

Review URL: https://codereview.chromium.org/1423473004 .
2015-11-04 07:59:16 -08:00
William Hesse cc4a5d2e7c Revert "Switch profiler from isolates to threads"
Reverts commit 6365c27f81 and
commit 8b9ed6cfb3.

They are causing flaky timeouts (hangs) on all vm cc tests on all Windows vm bots.

R=mit@google.com

Review URL: https://codereview.chromium.org/1425093006 .
2015-11-03 10:42:55 +01:00
John McCutchan 6365c27f81 Switch profiler from isolates to threads
- API breakage: Dart_IsolateBlocked, Dart_IsolateUnblocked -> Dart_ThreadDisableProfiling, Dart_ThreadEnableProfiling.
- Remove IsolateProfilerData.
- Move thread at blocking call count from isolate to thread.
- Always interrupt threads unless they are blocked.
- We can no longer count "idle" ticks.
- Only record sample if thread is the current mutator of an isolate.
- Refactor ThreadInterrupterCallback to ensure that Thread* is valid.

Threads are only ever sent signals if ThreadInterruptsEnabled is true. Which is controlled by two functions:

void DisableThreadInterrupts();
void EnableThreadInterrupts();

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

Review URL: https://codereview.chromium.org/1412733008 .
2015-11-02 12:47:52 -08:00
Srdjan Mitrovic 8d618766a8 Remove isolate argument from handle allocation: Part II
BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org/1389353004 .
2015-10-12 14:06:50 -07:00
Srdjan Mitrovic 8c7a94e9f4 Preparation for moving reusable handles to thread and more cleanups: isolate -> thread based handle allocation.
BUG=
R=koda@google.com

Review URL: https://codereview.chromium.org/1384403002 .
2015-10-06 10:17:12 -07:00
Florian Schneider bac82e2592 VM: New calling convention for generated code.
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: https://github.com/dart-lang/sdk/commit/1d343e5a7b75168fb6c9f86b64c55173cdbdc9b2

Review URL: https://codereview.chromium.org//1192103004 .
2015-09-19 13:21:09 +02:00
Florian Schneider 7af7a2db87 Revert "VM: New calling convention for generated code."
This reverts commit 1d343e5a7b.

Because of Windows test failures.

BUG=
TBR=whesse@google.com

Review URL: https://codereview.chromium.org//1343373003 .
2015-09-16 13:46:05 +02:00
Florian Schneider 1d343e5a7b VM: New calling convention for generated code.
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 .
2015-09-16 13:05:58 +02:00
Ryan Macnak 998f19dfbb More precompiled snapshotting.
- Load precompiled stub code from the snapshot.
- Mark isolates reading from precompiled snapshots as not allowed to compile.
- Reset static field values during precompilation.
- Don't run the program after generating a precompiled snapshot.

Fails sooner in loading precompiled snapshots due to null Instructions.

R=asiva@google.com

Review URL: https://codereview.chromium.org//1311403009 .
2015-09-15 16:53:44 -07:00
Daniel Andersson a1bc527306 Migrate logging infrastructure Isolate->Thread
This enables thread-safe logging (e.g., ISL_Print, which will soon be renamed to THR_Print), which is needed for concurrent
marking (DetachCode) and compilation.

Make finalization of GC marking tasks concurrent, now that it's thread-safe.

BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org//1314673008 .
2015-09-09 15:30:38 -07:00
Florian Schneider 63a8e5227d VM: More abstract interface for generating stub calls.
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 .
2015-08-05 10:18:35 +02:00
Florian Schneider 8d38a58c18 Make array allocation stub shared between isolates.
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 .
2015-07-23 12:56:16 +02:00
Florian Schneider 81deeaeedc VM: Share some stub code between isolates.
This CL also lifts the restriction that the object pool can't be used
in VM isolate code on x64 and arm64.

Stubs that perform allocation can't be shared yet, because the inline allocation
code is not yet isolate-independent. This will be added in a separate CL.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1229283002 .
2015-07-13 10:00:51 +02:00
Florian Schneider 265a54411a Object pool with support for untagged entries.
This adds meta-information to object pool entries to allow storing
untagged immediates or code addresses (ExternalLabel) directly.

This eliminates the need to generate extra code to preserve the LSB
when storing immediates as smis (x64, arm64).

BUG=

Review URL: https://codereview.chromium.org//1175523002.
2015-06-10 11:41:22 +02:00
fschneider@google.com 399e2a160a VM: Don't emit usage counter code when optimizations are disabled.
Review URL: https://codereview.chromium.org//1127453003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45530 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-05 17:06:18 +00:00
fschneider@google.com 99f775103e VM: Fix dissassembly output of stub code.
Make --disassemble-stubs works with multiple isolates.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45333 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-22 10:45:17 +00:00
fschneider@google.com 1dc4e979d9 Remove isolate pointer from context objects.
By moving all stubs that do runtime calls into the isolate
we don't need to cache the current isolate in each context
object.

This saves space on each context at the cost of duplicating stubs
in each isolate. Most stubs are already isolate-specific and the total number
 of stubs is small enough for this to be a good trade-off.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41279 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-24 12:19:20 +00:00
koda@google.com a3b31e3364 Make AllocateArray stub patchable, like instance allocation stubs.
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40699 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-25 23:31:08 +00:00
srdjan@google.com 30e77079e9 Fix x64 patching of asllocation stub: the pool pointer must be set-up before patching jump is executed.
R=koda@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40358 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-16 23:14:54 +00:00
srdjan@google.com dd9c0ef25e Allow invalidation and recompilation of instance allocation stubs. Requested in order to implement better pretenuring strategy.
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40168 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-11 17:56:42 +00:00
fschneider@google.com 937726a0aa Improve polymorphic inlining of int/int double/double operations.
I added inlining of the native Double methods _add, _sub, _mul and _div and fromInteger
and unified the method recognition of the MethodRecognizer and the Intrinsifier classes.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39446 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-21 11:13:44 +00:00
johnmccutchan@google.com e7ddd5d047 Move some isolate state setup from C++ code to JumpToExceptionHandler stub (take 3).
- CL is the same as take 2, but, I now prohibit the profiler from walking the call stack when the isolate is executing the jump to exception handler.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38300 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-16 18:03:17 +00:00
asiva@google.com f85f986bda Make isolate specific stub code accessors instance methods instead
of static. This allows use of isolate without having to call
Isolate::Current() when using these accessors.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38040 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-07 21:25:00 +00:00
johnmccutchan@google.com 9812f8a581 - Enable top exit frame profiler mode by default
- Final Windows fixes for using StackFrameIterator from different thread.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37918 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-01 22:21:43 +00:00
johnmccutchan@google.com ef2adfc5c6 Allow StackFrameIterator to be used on a different thread than the isolate whose stack frames are being iterated over.
This is necessary to be able to use this in the profiler.

BUG=
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37886 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-01 17:38:13 +00:00
iposva@google.com d36cd610cb - Use isolate where it is appropriate.
- Do not emit an name for ExternalLabel.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36662 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-27 10:15:50 +00:00
iposva@google.com 0d236b7402 - Rationalize the way we use comments.
R=koda@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35349 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-24 01:57:47 +00:00
zra@google.com 25d93a82e2 Adds simulator debugger and Stop to arm64.
Also replaces UNIMPLEMENTED in stubs with Stop so
we can enable generation.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35127 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-16 19:57:52 +00:00
zra@google.com 2fe51715e5 Begins work on ARM64, first assembler test.
Most new code is in constants_arm64.h and
{assembler,disassembler,simulator}_arm64.{h,cc}

The rest of the CL just #def's out tests, modifies status files,
and adds UNIMPLEMENTED functions, etc.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34654 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-02 17:39:32 +00:00
johnmccutchan@google.com e9e54f6af6 Cleanup native, collected, and stub code handling in profiler
R=iposva@google.com, turnidge@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33177 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-28 22:55:53 +00:00
regis@google.com 8d5dae7798 Allocate instance closures similarly to regular closures, i.e. without a
specific stub and runtime call.

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33074 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-26 18:38:47 +00:00
asiva@google.com e33c2d4254 Delay Class parsing until the class is actually used.
Prior to this change the initial heap sizes were as follows:
ia32:
Size of isolate snapshot = 1230921
New space (0k of 32768k) Old space (1446k of 1604k)

X64:
Size of isolate snapshot = 1223943
New space (0k of 32768k) Old space (2630k of 2692k)


After this change the initial heap sizes are as follows:
ia32:
Size of isolate snapshot = 686443
New space (0k of 32768k) Old space (677k of 836k)

X64:
Size of isolate snapshot = 684731
New space (0k of 32768k) Old space (1220k of 1412k)

R=hausner@google.com, iposva@google.com, regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23115 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-24 00:13:10 +00:00
zra@google.com 463b651f78 Adds Stop to MIPS. Starts on MIPS call patcher.
Review URL: https://codereview.chromium.org//12703028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20527 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-26 17:50:43 +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 d56766f251 More ^= to |=
Review URL: https://codereview.chromium.org//11941021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17308 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 19:43:19 +00:00
asiva@google.com c483079e45 Remove the special stub code region as we don't need it anymore. With the new frame layout convention we can find the first dart frame quickly.
Review URL: https://chromiumcodereview.appspot.com//10409038

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7778 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-18 23:28:34 +00:00
asiva@google.com 09adb99a85 Add a stub_code_space in the heap alongside code_space so that stub code generation happens here and it is easy to determine if a PC is a stub code or not.
This gets rid of the temporary change made in code_generator.cc for fast access to the top dart frame. In addition it will not pollute the pc ==> code cache that I plan to add next as we don't have to store stub pcs in that table.
Review URL: https://chromiumcodereview.appspot.com//10223015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7033 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-26 18:00:53 +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
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
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
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
regis@google.com 19208574f0 Inline allocation of implicit closures.
Consolidate generation of closure allocation stubs into one function.
Fix type name printing when printing ast.
Review URL: http://codereview.chromium.org//8234016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@357 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-11 23:42:20 +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