Commit graph

20 commits

Author SHA1 Message Date
Liam Appelbe d49bf6f25a [vm] Remove misleading usings.
Patchset 1 contains just the usings I deleted (<100 lines). All the
other diffs in the rest of the CL are just fixing all the places that
were broken by this.

Bug: https://github.com/dart-lang/sdk/issues/36839
Change-Id: I3bb4fa62ab4363ded81fd7c2815b857f91886dd6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108502
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-07-10 22:20:10 +00:00
Ryan Macnak e1ffe76a36 [vm] Replace StubEntry with Code handles.
StubEntry was holding raw pointers across safepoints in several places in the compiler.

Bug: https://github.com/dart-lang/sdk/issues/34934
Change-Id: Id17cb7651f4d3508915c8cb90f5cb2353df6dac0
Reviewed-on: https://dart-review.googlesource.com/c/85040
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-11-21 17:45:11 +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
Zachary Anderson 6cd8a79078 VM: Re-format to use at most one newline between functions
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2974233002 .
2017-07-13 08:08:37 -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: 1d343e5a7b

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
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
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
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
fschneider@google.com 9ed4cf1cb6 Simplify and improve handling of IC and megamorphic cache miss handling.
Instead of going back and forth from stub code to C++, perform
only the lookup in C++ and call target functions only from
stub code.

noSuchMethod and implicit closure invocations are now also work with
the megamorphic cache. Before they would go slow-case in the megamorphic case.

This CL eliminates the InstanceFunctionLookup stub that was previously
used to handle noSuchMethod and implicit closure invocations.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34774 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-07 09:27:43 +00:00
fschneider@google.com d6178535b2 Landing: Write protect executable pages in the VM.
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
2014-02-10 12:18:06 +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 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 00dd8aa761 Remove functions_cache_ and it's references as it is not being used anymore.
Review URL: https://chromiumcodereview.appspot.com//10824266

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10542 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-10 23:33:37 +00:00
srdjan@google.com a343a49338 Do not count invocations but usage of a function, i.e., increment a function's counter at IC calls and at return operations in unoptimized code. (TODO: increment count at static calls as well). There is no checking at method entry any more. The function counter reporting is not measuring the invocation count but much more how much time we spend in a method. Removed counter at backward branches.
Renamed flags to:
--optimization_counter_threshold (default 2000)
--report_usage_count
Review URL: https://chromiumcodereview.appspot.com//9460015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4583 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-25 00:33:25 +00:00
kmillikin@google.com 41e77a0a9e Initial implementation of a flow-graph builder for Dart's AST.
Visit the AST and generate an instruction (ie, not basic-block) flow
graph.

The flow graph for the simple function:

main() {
  var f = 1;
  var n = 5;
  while (n > 0) {
    f = f * n;
    n = n - 1;
  }
  print(f);
}

is:

       1: StoreLocal(f, #1)
       2: StoreLocal(n, #5)
       3: [join]
       4: t0 <-LoadLocal(n)
       5: t0 <-InstanceCall(>, t0, #0)
       6: if t0 goto(7, 15)
       7: [target]
       8: t0 <-LoadLocal(f)
       9: t1 <-LoadLocal(n)
      10: t0 <-InstanceCall(*, t0, t1)
      11: StoreLocal(f, t0)
      12: t0 <-LoadLocal(n)
      13: t0 <-InstanceCall(-, t0, #1)
      14: StoreLocal(n, t0) goto 3
      15: [target]
      16: t0 <-LoadLocal(f)
      17: StaticCall(print, t0)
      18: return #null

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9414003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4460 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-22 15:20:13 +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
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