Commit Graph

31 Commits

Author SHA1 Message Date
Ryan Macnak 8da46d35f5 [vm] Move heap-related code to its own subdirectory (cf. compiler).
Remove some dead includes.

Change-Id: I31f3e739e5ee46dcbba5d6a2f091491b46402943
Reviewed-on: https://dart-review.googlesource.com/60146
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-06-20 00:39:49 +00:00
Ryan Macnak 558a931409 [vm] Move some string utils from runtime/vm to runtime/platform.
Change-Id: I552086445a7e07792f9da85afa5edf23b6c450d5
Reviewed-on: https://dart-review.googlesource.com/44402
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-03-01 02:07:46 +00:00
Ryan Macnak b247090c9e [vm] Align old-space pages.
Allows quick access to the page header for any old-space object, which is a convenient place to keep forwarding information.

Also combine the reserve and commit operations of VirtualMemory.

Bug: https://github.com/dart-lang/sdk/issues/30978
Change-Id: Id3fe06932f7bef882bb1cc29d72441b0a3602eb6
Reviewed-on: https://dart-review.googlesource.com/17046
Reviewed-by: Erik Corry <erikcorry@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2017-10-30 22:02:20 +00:00
Vyacheslav Egorov 8a179fb953 [VM, Compiler] Move compiler to a separate folder.
New folder structure (nested under vm/):

- compiler/
-   jit/         - JIT specific code
-   aot/         - AOT specific code
-   backend/     - all middle-end and back-end code (IL, flow graph)
-   assembler/   - assemblers and disassemblers
-   frontend/    - front ends (AST -> IL, Kernel -> IL)

compiler/README.md would be the documentation root for the compiler
pipeline

Bug: https://github.com/dart-lang/sdk/issues/30575
Change-Id: I2dfd9688793bff737f7632ddc77fca766875ce36
Reviewed-on: https://dart-review.googlesource.com/2940
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2017-09-04 15:15:18 +00:00
Ben Konyi f2fd150ea0 Added new type of unit test, RAW_UNIT_TEST_CASE, which is used for tests that can be flaky if run while the VM is alive. Tests created using the RAW_UNIT_TEST_CASE macro will run after the VM has shutdown to avoid having any worker threads contaminating the test results.
BUG=
R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2666133002 .
2017-01-31 15:16:38 -08:00
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
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
Zachary Anderson 081718c198 Fuchsia Fix FindCodeObject test.
It can't handle having the large array on the stack.

R=asiva@google.com

Review URL: https://codereview.chromium.org/2202023007 .
2016-08-02 13:10:45 -07:00
Zachary Anderson db86be4901 Fixes and enables FindCodeObject test for dbc
DBC always encodes branches similarly to arm64's far branches. In
particular, the unconditional jump takes a signed 26-bit offset.
This CL just modifies the test to generate enough code to test that
dbc can handle branches the same distance as the other platforms.

R=iposva@google.com

Review URL: https://codereview.chromium.org/1919283003 .
2016-04-26 10:40:28 -07:00
Ivan Posva 5be5d54529 - Refactor Symbol allocation to expect a thread parameter.
- Preallocate all tokens as symbols to avoid repeated lookups.
- Pass thread/zone where useful while doing this change.
- Avoid allocating symbols for error messages.

BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1870343002 .
2016-04-11 16:28:29 -07:00
Siva Annamalai e72c1fb47d Implement safepointing of threads :
- uses thread execution status transition to track when a thread is in a safepoint or needs to block for a safepoint
 - introduces a monitor per Thread object
 - uses a per thread safepoint handshake between the thread requesting a safepoint and the requested thread.

The ThreadRegistry class now contains only the thread list for an isolate and the functionality of scheduling a thread onto an Isolate and unscheduling it from teh isolate. We could fold this functionality into the Isolate class in a different CL.

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

Review URL: https://codereview.chromium.org/1541073002 .
2016-02-01 10:57:34 -08:00
Ivan Posva 0a0b101fbd - Remove deprecated StackZone constructor with Isolate parameter.
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1312813006 .
2015-09-02 16:07:48 -07:00
zra@google.com eb11b8a7a0 Adds far-branches to arm64.
Also fixes bugs and enables tests.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36051 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-12 18:43:08 +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
srdjan@google.com 3274f92827 Rename FinalizeTypeHierarchy to ProcessPendingClasses.
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30688 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-27 00:11:32 +00:00
zra@google.com 7c28e8d96d Fixes FindCodeObject test.
After enabling GC of unoptimized code, functions cannot be
used as proxies for unoptimized code. This change, creates
ZoneHanldes for compiled code in the FindCodeObject test,
so that later when functions are used to refer to code,
we can be sure that the code will be there.

TBR: iposva

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30604 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-23 19:09:23 +00:00
zra@google.com dd2c1e1cb8 Removes obsolete MIPS ifdef from FindCodeObject test.
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30587 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-22 21:53:14 +00:00
srdjan@google.com 3485989ae7 Do not eagerly finalize classes in CHA, instead regard unfinalized classes as ’non-existent’ and only invalidate optimized code at finalization of the class.
Rename FinalizePendingClasses to FinalizePendingClassInterfaces as the class finalization occurs lazily.
TODO: add dependency information to deoptimize/remove only relevant optimized code.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30582 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-22 17:59:23 +00:00
iposva@google.com 5f1e3063dc - Update use of kPageSize in ifdef'd MIPS code.
Review URL: https://codereview.chromium.org//82293002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30558 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-22 00:41:11 +00:00
iposva@google.com 32bf931118 - Convert HeapPages to use word sizes.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30557 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-21 23:48:41 +00:00
hausner@google.com fd57843900 Update handling of ambiguous name references
Update VM to latest spec. Referencing a name that is imported
from more than one library is no longer a compile-time error.
If one of the sources of an ambiguous reference is a dart library,
the dart library declaration is automatically hidden.

Also fixes a bug where looking up a getter name in a library
found the getter even though the name is filtered out in the
'hide' combinator.

Long-term we should fix the need for repeatedly convert between
the mangled getter and setter names and the untangled name.

Fixes 12915, 12913, 12724.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27312 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-09 21:52:40 +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
regis@google.com 9581071936 Refactor resolution code in the vm to properly handle ambiguity errors.
Add test.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25324 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-23 00:19:39 +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 8e29370a1b BREAKING CHANGE: enforce part of directive
For historical reasons, the VM is currently too lenient when parsing library parts. Files that get loaded through a 'part' directive must start with a 'part of libraryname;' clause. The VM so far has not reported an error if the clause is missing.

This change enforces the grammar as the Spec mandates it. Library parts that do not start with 'part of' will no longer compile.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22278 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-01 20:46:48 +00:00
zra@google.com fd72ee418a Implements optional parameter handling in MIPS vm.
- Deocdes ic data and argument descriptor.
- Removes SUB instruction from assembler and disassembler.
Review URL: https://codereview.chromium.org//13474009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20895 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-03 21:43:52 +00:00
regis@google.com 0c27ffc6a4 Implement optional parameter handling in ARM vm.
Enable FindCodeObject test on ARM (production mode only for now).
Make sure the object pool is allocated in the old space.
Some more code cleanup on IA32 and X64 (use named constants).
Review URL: https://codereview.chromium.org//12663024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20399 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-22 18:30:35 +00:00
asiva@google.com ec7f44f025 Create frequently used symbols in the vm isolate
- Avoids the need for doing a NewSymbol on these everytime
- saves space as they get shared by isolates
Review URL: https://chromiumcodereview.appspot.com//10783035

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9834 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-24 00:01:50 +00:00
asiva@google.com ef67b96777 Rename some of the enum definitions inside classes to avoid conflict with the ObjectKind enum.
Review URL: https://chromiumcodereview.appspot.com//10808064

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9792 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-20 22:24:49 +00:00
asiva@google.com c71a8cc1ee Change dart frame and stub frame layout to include the PC of the code executing on the frame. The stack frame layout is as follows:
ret PC
  saved EBP                          <== EBP
  PC (used to locate RawInstruction) <== ESP
Review URL: https://chromiumcodereview.appspot.com//10375059

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7675 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-16 00:47:05 +00:00
asiva@google.com f9655463c7 Remove code index table.
Review URL: https://chromiumcodereview.appspot.com//10082017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6557 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-14 02:03:58 +00:00