Commit Graph

111 Commits

Author SHA1 Message Date
Zachary Anderson a1bcf051d8 clang-format runtime/vm
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2481873005 .
2016-11-08 13:54:47 -08:00
Regis Crelier cf52536d09 Remove default monomorphic check code from functions and stubs that do not need it.
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2463083002 .
2016-11-03 01:41:14 -07:00
Ryan Macnak 26245de7a5 Support unaligned integer loads on ARM and MIPS.
Fixes SDK build with SIMARM/SIMARM64/SIMMIPS.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2452453002 .
2016-10-31 17:41:53 -07:00
Ryan Macnak 12b18466bb Reduce size of monomorphic checked entry.
Flutter gallery
VMIsolate(CodeSize): 112293
Isolate(CodeSize): 2065968
ReadOnlyData(CodeSize): 1721336
Instructions(CodeSize): 5625616
Total(CodeSize): 9525213
->
VMIsolate(CodeSize): 112292
Isolate(CodeSize): 2065966
ReadOnlyData(CodeSize): 1721336
Instructions(CodeSize): 5592336 -0.35%
Total(CodeSize): 9491930 -0.59%

R=fschneider@google.com

Review URL: https://codereview.chromium.org/2403613002 .
2016-10-11 13:58:49 -07:00
Ryan Macnak 7ff2dd4117 Optimize AOT's switchable calls for the monomorphic case.
The call sequence is very similar to a classic IC call, except the guarded class and the target are loaded indirectly from the constant pool instead of as immediates. In the monomorphic case, we call directly to the expected target with a class check in the callee. In the unlinked, polymorphic and megamorphic cases, we call a stub; these case are now call-through instead of call-and-return.

Every code, except stubs involved in switchable calls, includes the class check sequence at the beginning. So we now distinguish between a checked and an unchecked entry point. Generated code except the switchable call continues to use the unchecked entry point.

PC offsets are calculated relative to the beginning of the instruction stream, rather than either entry point.

BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org/2226893002 .
2016-08-12 11:18:35 -07:00
Ryan Macnak a6f954b0f3 Don't track allocations in product mode.
R=fschneider@google.com

Review URL: https://codereview.chromium.org/2143153002 .
2016-07-12 14:15:02 -07:00
Florian Schneider ab4490e5bf VM: Remove collection of unused range feedback.
We can always put it back if the optimizer makes use of it.
It's a lot of extra code that is unused. Therefore, remove it for now.

BUG=
R=vegorov@google.com

Review URL: https://codereview.chromium.org/2132933003 .
2016-07-11 06:46:50 -07:00
Siva Annamalai de5a1c8dac Remove support for pretenuring as it is not fully implemented and is currently turned on for a very specific case (double to string for one byte strings).
R=fschneider@google.com

Review URL: https://codereview.chromium.org/2119633002 .
2016-07-01 12:59:19 -07:00
Florian Schneider 46f8b02dbb VM: Don't generate allocation stats code in product mode.
They are not needed since there is no observatory/profiling support
in product mode.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2105383003 .
2016-06-30 13:35:40 -07:00
Ryan Macnak 05d8185470 Never include_isolate or allow_embedded_addresses.
Makes the JIT PIC on non-IA32 like precompilation, a prerequisite for caching code across processes.

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

Review URL: https://codereview.chromium.org/1911253002 .
2016-04-22 20:47:23 -07:00
Siva Annamalai 4b38c3dfc2 - Fix the hash code for raw objects that are added into the object pool
index table
- Do not try to figure out if the passed in handle is a temporary scoped
  handle, instead have all the callers create a ZoneHandle

Compilation of the ESS initialization code in GreenTea reduces from 2.56secs to .497 secs

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1846063002 .
2016-03-31 21:41:16 -07:00
Ryan Macnak e386db978e Invoke CallToRuntime via Thread instead of ObjectPools.
Most functions use CallToRuntime for the stack overflow check.

precompiled dart2js arm 20388895 -> 20308640 (-0.39%)

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1778103003 .
2016-03-11 10:03:12 -08:00
Srdjan Mitrovic 5a69e3661b In background compilation make a copy of Field in order to freeze its state. Add flag --force_clone_compiler_objects for debugging purpose.
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1722733002 .
2016-02-26 09:07:49 -08:00
Florian Schneider d8677964a3 Move precompilation-related flags to flags list.
They become compile-time constants in the precompiled runtime, and in product mode.

In precompiled product mode, the precompiled value has precedence.

BUG=
R=rmacnak@google.com

Committed: https://github.com/dart-lang/sdk/commit/5c9f18c6c87284395564051a052cc4acc9b6f59a

Review URL: https://codereview.chromium.org/1731743003 .
2016-02-25 07:53:39 -08:00
Ryan Macnak bd85deaf4e Revert "Move precompilation-related flags to flags list."
The default value of print_stop_message was architecture specific.

TBR=fschneider@google.com

Review URL: https://codereview.chromium.org/1739593002 .
2016-02-24 18:08:01 -08:00
Florian Schneider 5c9f18c6c8 Move precompilation-related flags to flags list.
They become compile-time constants in the precompiled runtime, and in product mode.

In precompiled product mode, the precompiled value has precedence.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1731743003 .
2016-02-24 17:31:08 -08:00
Ryan Macnak 04e8382cec VM: Share object pool entries for optimized static calls.
Independently patchable entries are not required for debugging because breakpoints are only added to unoptimized code, nor for deopt because deopt patches the instruction stream and not the object pool.

Future work: Reduce the static call table from (pc offset, function, code) triples to (pc offset, function or allocation stub) pairs.

precompiled dart2js arm 20747140 -> 20674954 (-0.34%)

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1713853003 .
2016-02-24 13:57:19 -08:00
John McCutchan 768e4ddee7 Add --check-code-pointer flag for debug builds
- Introduce --check-code-pointer which is false by default.
- Sort DECLARE / DEFINE flag macros in assembler*.cc

Fixes #25361

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1574993003 .
2016-01-11 13:20:13 -08:00
Srdjan Mitrovic ab7525a820 For background compilation we copy ICData so that it is immutable during comnpilation. However, we must emit the original, shared ICData in the code. Provide a link from cloned ICData object to the original one.
BUG=
R=zra@google.com

Review URL: https://codereview.chromium.org/1544583002 .
2015-12-21 14:49:30 -08:00
Srdjan Mitrovic 4600d37dc1 Background compilation work:
- Defer deoptimization from optimizing compiler to code installation in mutator thread.
- Defer registration of field and leaf class dependency until code is installed in mutator thread.
- Cleanup.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1433243003 .
2015-11-12 11:25:58 -08:00
Ryan Macnak f1a0056430 Load the native call wrapper via Thread.
R=fschneider@google.com

Review URL: https://codereview.chromium.org//1358773002 .
2015-09-20 13:48:17 -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
Ryan Macnak 13c5520a34 Remove some more embedded pointers.
R=fschneider@google.com

Review URL: https://codereview.chromium.org//1352733002 .
2015-09-17 15:46:03 -07:00
Ryan Macnak 13e0a49d47 ARM & MIPS: Try to use the object pool before trying to embed a pointer, like ARM64 and X64.
(In particular, don't embed pointers to arguments descriptors.)

R=fschneider@google.com

Review URL: https://codereview.chromium.org//1344153002 .
2015-09-16 10:18:38 -07: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 85c1ed749b ARM & MIPS: Don't embed an address in the general class id fetch.
R=fschneider@google.com

Review URL: https://codereview.chromium.org//1338923002 .
2015-09-14 10:14:12 -07:00
Ryan Macnak 690cccf03c Remove remaining uses of null's absolute address from non-IA32.
Note not every file is touched for every architecture because some already load null via Thread in most places.

Don't use absolute stack overflow address when precompiling.

R=fschneider@google.com

Review URL: https://codereview.chromium.org//1332923005 .
2015-09-11 11:34:21 -07:00
Ryan Macnak 8ebb9f9b39 Track which entries in the ObjectPool are native entries, and reset them when loading a precompiled snapshot.
R=fschneider@google.com

Review URL: https://codereview.chromium.org//1316673005 .
2015-09-10 15:41:37 -07:00
Florian Schneider 7e082c1082 VM: Use constant pool also for leaf runtime calls on x64, arm, arm64 and mips.
Remove unused branch/call macro instructions from the assembler.

Setup a frame and pool pointer when invoking leaf runtime functions (in the
deoptimzation stub and store-buffer update stub).

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1314883002 .
2015-08-28 10:46:02 +02:00
Daniel Andersson 0fe9feefa2 Fix simulators.
BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1289883004 .
2015-08-17 13:46:24 -07:00
Florian Schneider e8eb6c7031 VM: Move calling convention-dependent code out of cc tests.
Use DartEntry::Invoke instead.

Unify LeaveDartFrame and LeaveStubFrame. They are the same.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1277883002 .
2015-08-07 10:54:43 +02: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 ef7a55281f VM: Load allocation-top and -end via Thread.
Cache a pointer to the isolate's Heap in the Thread object
and use it in generated code for allocation.

Change generated allocation code to load allocation-top and
end via THR (THR->heap.top). This is slightly slower than
embedding the address, but faster than loading it
via the Isolate (THR->isolate->heap.top)

BUG=
R=koda@google.com

Review URL: https://codereview.chromium.org//1263513002 .
2015-08-03 16:26:23 +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
Regis Crelier 3b2a4cb33c Rename assembler field/getter/setter allow_constant_pool to constant_pool_allowed
R=zra@google.com

Review URL: https://codereview.chromium.org//1249933003 .
2015-07-22 14:51:49 -07:00
Florian Schneider 0cf617ef13 VM: Refactor allocation stats code and remove duplicate code.
Make context allocation stub shared between isolates.

The fast-path used in optimized code still has isolate-specific
addresses inlined for performance reasons.

Common functions are moved into class_table.h/.cc.

This is a preparation for adding an isolate-independent version of the
allocation code and allocation tracking code.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1241863002 .
2015-07-17 15:15:33 +02:00
Florian Schneider 141d6bdcd2 Make subtype test cache stub shared between isolates.
Also remove an the unused pp paramters from LoadIsolate on ARM64.

BUG=
R=koda@google.com

Review URL: https://codereview.chromium.org//1235843003 .
2015-07-13 15:42:16 +02:00
John McCutchan e89b2eeaac Trace allocation of arrays
BUG=
R=fschneider@google.com, srdjan@google.com

Review URL: https://codereview.chromium.org//1226143011 .
2015-07-10 13:06:17 -07:00
John McCutchan 598c67001b Update Assembler::TryAllocate to support inline allocation tracing
- Track whether class allocation should be traced in existing ClassHeapStats structure.
- Emit compare and branch at top of ::TryAllocate

These changes appear to be performance neutral.

An alternative approach is to deoptimize all code that inlined allocations for a specific class. I do not think this is a good approach because we will spoil the water- allocations that aren't occurring in the (optimized steady state) running program  will appear in the allocation profile. This will make the data much less actionable bordering on misleading. The approach used in this CL will guarantee the allocation profile aligns with the actual running program.

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

Review URL: https://codereview.chromium.org//1213013002 .
2015-07-10 12:19:01 -07:00
Florian Schneider 9bdab8ee2b VM: Load common VM constants from Thread on ARM and MIPS.
This saves code size and also makes intrinsic code relocatable since
the UpdateStoreBuffer-stub is now called indirectly (loaded from THR)
instead of embedded as an immediate.

Also addressed feedback from previous CL.

BUG=
R=koda@google.com

Review URL: https://codereview.chromium.org//1227733002 .
2015-07-09 11:12:52 +02:00
Ryan Macnak 77c206f231 Don't bother trying to reuse object pool entries for ICs, type test caches, or edge counters as they will have unique entries anyway.
Avoids lookups of object pool entries, which dominates in very large functions such as regex.

First program from http://dartbug.com/23249 goes from 66.439s to 10.918s on X64 (6.1x).

R=srdjan@google.com

Review URL: https://codereview.chromium.org//1231463002 .
2015-07-07 16:40:27 -07:00
Srdjan Mitrovic c0b359db6c Intrinsic version of Object.runtimeType
BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org//1217323002.
2015-07-01 10:13:14 -07:00
Florian Schneider 957af25419 Use object pool for runtime calls.
Also, set up a stub frame with object pool loaded in all stubs on those
platforms.  This is a preparation step to making code relocatable.

ia32 is not affected because there is no object pool.

BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1189573004.
2015-06-17 10:37:52 +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
Daniel Andersson fd890f4097 Cache current thread in a reserved register and use it in LoadIsolate
Add THR register that caches the current thread in generated code.
Shuffle some registers around as needed to free one up.

Note: Assembler::LoadIsolate now always loads the *current* isolate whenever the code is executed, rather than the isolate in which the code was compiled (no existing code was affected by this slight change in semantics).

Rewrite some ia32 stubs to use one less register, and for some ia32 bigint intrinsics, explicitly save THR (like CTX in the past, see r44699).

Next steps:
- pass current thread rather than isolate in NativeArguments
- ditto for exception handler jump
- migrate fields vm_tag, top_exit_frame_info, etc. to thread

R=srdjan@google.com

Review URL: https://codereview.chromium.org//1156593002
2015-05-26 13:46:12 -07:00
koda@google.com db58faa53e Fix array allocation overflow check on arm/arm64/mips.
When adding an object size in bytes to the allocation top address,
we must check for *unsigned* overflow, not signed overflow. 32-bit example:
if top is 0xfffff000 and size is 0x1008, then top + size is an unsigned,
but not a signed, overflow.

Add similar unit test for typed data (same issue).

BUG=23254
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45354 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-22 18:32:37 +00:00
regis@google.com 6404ee602e Replace MIPS TraceSimMsg calls with Comment calls.
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44981 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-08 19:59:50 +00:00
fschneider@google.com df94b27666 VM: Align implementations of assembler constant pools.
Add Support for adding patchable/non-patchable entries on ARM/MIPS like
already done for x64/ARM64.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43589 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-09 11:47:36 +00:00
fschneider@google.com 1e7310d48f Improve constant pool implementation in the assembler.
Instead of using RawObject* as keys, use Object*. Using handles eliminates any assumption
about the underlying GC implementation (e.g. requiring that old objects don't move).

Remove special handling of null_object by making HashMap more generic and
allowing the trait to specify the value used to indicate an empty element.

The goal is to use one unified, efficient implementation of the constant
pool on all architectures that require one (x64, arm64, mips).

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42901 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-15 10:43:36 +00:00