Commit Graph

179 Commits

Author SHA1 Message Date
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
Martin Kustermann 4a88439e34 Reduce generated ARM code size for ReturnInstr by one instruction
Savings on flutter seem to be ~0.9%

R=vegorov@google.com

Review URL: https://codereview.chromium.org/2238233002 .
2016-08-12 12:58:39 +02: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
Siva Annamalai 006bab2c47 Land Ivan's change of 'Remove support for verified memory handling'
R=fschneider@google.com

Review URL: https://codereview.chromium.org/2112043002 .
2016-07-01 09:21:01 -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
Vyacheslav Egorov 31057dcec7 VM: [AOT] Make sure that we inline all resolved accessor invocations.
Previously we would just replace it with a static call and hope that inliner
handles it. However sometimes it happens too late in the pipeline and inliner
misses the opportunity.

Additionally drop some dead code from the aot_optimizer that was not doing
anything useful because FlowGraphInliner::TryInlineRecognizedMethod always
returns false in the AOT mode.

R=fschneider@google.com
BUG=

Review URL: https://codereview.chromium.org/2098643003 .
2016-06-27 17:15:28 +02: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
Ryan Macnak c315da5a06 ARM: Don't generate memory instructions with writeback where the data and address registers are the same.
BUG=http://dartbug.com/24855
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1434323003 .
2015-11-13 12:13:55 -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 7e2e9cb949 ARM: Fix double use of IP when storing object fields with large offsets.
TEST=language/large_class_declaration --noopt
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1409733009 .
2015-11-05 09:54:50 -08:00
Ryan Macnak d422888b46 Use the iOS ABI when running SIMARM on Mac or targeting iOS.
Linux / iOS
R7   preserved / FP
R9   preserved / volatile
R11  FP / preserved

BUG=http://dartbug.com/24683
R=zra@google.com

Review URL: https://codereview.chromium.org/1421253004 .
2015-10-27 14:36:38 -07:00
Chinmay Garde 52d8128b4e Avoid compilation errors when the dart_target_arch is TARGET_ARCH_ARM
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1424783002 .
2015-10-26 15:39:14 -07:00
Ryan Macnak dd7250323d Re-assign registers on ARM so PP and CODE_REG are below R7 (FP on iOS).
Also update descriptions of register availability in instrinsics.

1) Mechanical replacement in *arm.* files except the simulator and constants_arm.h (with sed).

R5 -> R9
R6 -> R8
R8 -> R10
R9 -> R5
R10 -> R6

2) Change register aliases.

CTX = R10 -> CTX = R6
PP = R9 -> PP = R5
ICREG = R5 -> ICREG = R9
CODE_REG = R10 -> CODE_REG = R6
THR = R8 -> THR = R10

3) Fixup users of ldrd/strd to have valid register pairs.

bigint_lsh
bigint_absadd
bigint_abssub
bigint_sqradd
TYPED_ARRAY_ALLOCATION
InlineArrayAllocation
AllocateArrayStub
AllocateContextStub

4) Fix PushList in MegamorphicMissStub to keep runtime call arguments in the right order.

BUG=http://dartbug.com/24683
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1419223003 .
2015-10-26 11:05:32 -07:00
Ryan Macnak 1a34875064 Make arm assembler explicitly take both registers for load/store-pair.
R=zra@google.com

Review URL: https://codereview.chromium.org/1407393006 .
2015-10-23 10:16:32 -07:00
Florian Schneider 9fa3d7c9e4 VM: Initialize Instruction objects with break instructions instead of null.
On ia32 this is int3().  This also makes precompiled instruction snapshots
deterministic (to be precise the empty space due to alignment), and not depending
 on the address of the null object at snapshot creation time.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1367973002 .
2015-09-25 14:10:32 +02: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 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
Florian Schneider 1907b5a3e1 VM: Fix bug in ARM v5/v6 loading of immediates.
The condition was not correctly passed on as argument in LoadDecodableImmediate.

BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org//1318003003 .
2015-09-11 10:00:22 +02: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
Regis Crelier 23982c63e9 Load immediates via the constant pool on armv5te and armv6.
Fixes #23306

R=zra@google.com

Review URL: https://codereview.chromium.org//1250323002 .
2015-07-24 08:27:50 -07: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