Commit Graph

102 Commits

Author SHA1 Message Date
Todd Turnidge 2d22e85cf0 Revert "Revert "JumpToFrame refactor"" + Fix
This reverts commit 1cdb3d2155.

I have also added in a fix for the lazy-deopt in exception handler case.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2506503002 .
2016-11-21 08:49:18 -08:00
Todd Turnidge 1cdb3d2155 Revert "JumpToFrame refactor"
This reverts commit 5ed13d3298.

BUG=

Review URL: https://codereview.chromium.org/2503623003 .
2016-11-14 15:57:01 -08:00
Todd Turnidge 5ed13d3298 JumpToFrame refactor
- Refactor the JumpToExceptionHandle code so that it is now built from
  two pieces: JumpToFrame and RunExceptionHandler.

- Refactor the Simulator::Longjmp() code so that it is no longer
  exception-specific.  Instead it uses the RunExceptionHandler stub.

This makes it so that the JumpToFrame stub and Simulator::JumpToFrame
have the same semantics.  This will make it easier to land the Rewind
changes I am working on.

There are some oddities for dbc.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2503653002 .
2016-11-14 14:38:21 -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 e3420eab29 Revert "Pass new pool pointer to the JumpToException stub instead of reloading in through the frame's Code object."
This reverts commit 3413e052b3.

Review URL: https://codereview.chromium.org/2374173002 .
2016-09-28 13:00:00 -07:00
Ryan Macnak 3413e052b3 Pass new pool pointer to the JumpToException stub instead of reloading in through the frame's Code object.
This is prep work for lazy deopt without code patching.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/2376843002 .
2016-09-28 10:15:09 -07:00
Florian Schneider 7ca3da1a3a Fix lazy deoptimization in the presence of exceptions
Catch block entries need to be considered when doing lazy deoptimization.

In addition to the return, also patch all catch entry blocks in a function scheduled for lazy deoptimization.

Also, move restoring the pool pointer to the jump-to-handler stub to simplify patching the catch entry.

BUG=#27419
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2357343003 .
2016-09-26 16:24:23 -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 a0df7275d6 Use log prints for simulation tracing and fix --disassemble-stubs.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2229553005 .
2016-08-09 14:03:29 -07:00
Ryan Macnak 227927a8bb Make Android gyp flags more like Linux gyp flags. Fix cases of -Wconversion-null.
R=zra@google.com

Review URL: https://codereview.chromium.org/2018723002 .
2016-05-26 14:56:24 -07:00
Vyacheslav Egorov ee0f608ce4 Dart Byte Code interpreter.
This version is Clang/GCC only and does not support Windows because it uses computed goto's.

Only unoptimized mode is supported.

Architecture is described in constants_dbc.h and stack_frame_dbc.h.

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

Review URL: https://codereview.chromium.org/1858283002 .
2016-04-18 23:02:01 +02:00
Siva Annamalai 56e888d4cd - Move
stack_limit_,
   stack_overflow_flags_,
   saved_stack_limit_,
   stack_overflow_count_ and
   other interrupts mask fields from Isolate structure to Thread structure

- Change the stack overflow check in the prolog to load the stack limit
  from the THR register, this removes the back to back dependent loads to
  load the stack limit from the Isolate structure

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

Review URL: https://codereview.chromium.org/1812753002 .
2016-03-17 12:57:36 -07:00
Regis Crelier 6219753e18 Use TRUNC.W instead of CVT.W on mips to convert from double to int as to not
depend on the current rounding mode (fixes issue 25900).
Add support for TRUNC.W in assembler, disassembler, and simulator.
Fix disassembler to understand CVT.S.
Remove unused instructions.
Update co19 status file.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1765623002 .
2016-03-03 17:05:09 -08:00
Ryan Macnak cb210e3997 Enable concurrent sweep on MIPS and ARM64.
Compare ARM from commit f78517a5ba.

Closes #25651.

R=zra@google.com

Review URL: https://codereview.chromium.org/1722013002 .
2016-02-29 09:23:25 -08:00
Regis Crelier 3ffe9922b7 Simplify various name flavors in VM.
R=asiva@google.com, johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1723733002 .
2016-02-25 11:21:27 -08:00
Ryan Macnak c5f1818940 Fix product build for 32-bit architectures, simulators and ARM64.
(That's everything but X64.)

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1682113002 .
2016-02-09 11:25:44 -08:00
John McCutchan d77d376124 Replace intptr_t with TokenDescriptor
- Use TokenDescriptor instead of intptr_t for all token positions.
- Use TokenDescriptor in raw_object instead of int32_t.
- TokenDescriptor is a POD with an int32_t (this shrinks the size of AST and IR nodes by 32-bits on 64-bit architectures).

There are some cleanups I plan on doing as a follow up CL:

- Replace TokenDescriptor::value() with TokenDescriptor::TokenPos()

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

Review URL: https://codereview.chromium.org/1644793002 .
2016-02-02 10:15:44 -08:00
Ryan Macnak 87eae28239 Fix simarm and simmips builds on Mac.
Broken by a7ebeb00fb.

R=asiva@google.com

Review URL: https://codereview.chromium.org/1574393002 .
2016-01-12 12:47:26 -08:00
Siva Annamalai a7ebeb00fb Add a CompareAndSwapUint32 variant to AtomicOperations so that it is possible to a CAS of a 32 bit value.
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1562253002 .
2016-01-06 17:08:31 -08:00
Siva Annamalai 9e19d236ca - Add an OSThread structure which is the generic TLS structure for all C++
fields in a thread (i.e fields that are not Dart VM related)
- Split the Thread structure to be a pure Dart per thread structure and add
  a pointer to os_thread which points to the OSThread structure
- Change Schedule/UnSchedule to set the Dart Thread structure as the TLS of
  the thread when it is inside the Dart world and reset the TLS back to the
  OSThread strcuture when is exits the Dart World.
- Moved the stack_base and few stack size related functions to OSThread from Isolate

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

Review URL: https://codereview.chromium.org/1439483003 .
2015-11-19 13:45:10 -08:00
Florian Schneider 64261cbb9d VM: Improve and fix double negation on MIPS.
Add neg-instruction to the MIPS backend and use it instead of mul with -1.

Fixes the test that requires that identical(nan, -nan) == false.

TEST=language/nan_identical_test
R=zra@google.com

Review URL: https://codereview.chromium.org/1425143003 .
2015-10-29 22:34:46 +01:00
Srdjan Mitrovic 8e14e2b459 Fix builds
BUG=

Review URL: https://codereview.chromium.org/1414343002 .
2015-10-20 11:20:22 -07:00
Srdjan Mitrovic dc2d81b636 Move vm_tags from isolate to thread, since we may have multiple threads in same isolate (GC, background compilation)
BUG=
R=johnmccutchan@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org/1387643002 .
2015-10-05 12:50:17 -07:00
Ryan Macnak 0ab5bc2942 Add missing arity check for native entry in arm64 and mips simulators.
R=fschneider@google.com

Review URL: https://codereview.chromium.org//1341623002 .
2015-09-14 12:09:39 -07:00
Daniel Andersson 32046b2eb8 Migrate stack resource unwinding to Thread.
Also remove some uses of deprecated StackResource constructor.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org//1261873005 .
2015-07-31 12:57:19 -07:00
Ivan Posva 8f1506e817 - Determine whether the simulator is being used in globals.h
- Make sure to switch on HOST_ARCH_ and on USING_SIMULATOR
  where appropriate.
- Avoid allocating in new generation when running in the VM isolate.

BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1156053006
2015-05-29 14:35:29 -07:00
Daniel Andersson 6542a451c3 Refactor Isolate -> Thread in NativeArguments and exception handler jump.
Further reduces the one-to-one assumption about isolates and threads: native entries now ask the thread for its isolate, rather than the other way around.

R=srdjan@google.com

Review URL: https://codereview.chromium.org//1156143003
2015-05-26 16:49:51 -07:00
regis@google.com d5bace63ad Support profiling of simulated Dart code on mips, arm, and arm64.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45430 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-27 19:55:53 +00:00
regis@google.com 9a2468736a Add support for debug break in Dart source.
The new flag --enable-debug-break turns the otherwise illegal Dart statement
  break "message";
into a break instruction preceded with a debug message, the equivalent of
emitting an Assembler::Stop("message").
Add a language test expecting a syntax error without the flag.
Change expected break instruction in arm64 simulator.
Remove constants related to now deleted simulator tracing on mips and arm64.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45218 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-16 19:32:48 +00:00
regis@google.com 8a0194b846 Fix mint shifting by zero on MIPS (issue 23117).
Add regression test.
Restore formatting space dropped by mistake in simulator tracing output.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45042 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-09 22:50:25 +00:00
koda@google.com b1634f7c30 Isolate -> Thread for tracking owner of mutex and simulator's exclusive access.
Prepares for multiple threads referencing the same isolate (in particular, the mutator and sweeper).

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44762 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-27 20:33:36 +00:00
koda@google.com c1008f15c0 Save top StackResource in entry frame.
This avoids relying on stack address order, which enables us to benefit from AddressSanitizer's detect_stack_use_after_return feature.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43927 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-20 20:46:31 +00:00
koda@google.com 4c74036e9b To satisfy ASAN, use stub instead of & operator to get C++ stack pointer.
Because of initialization order, this requires slightly different paths for VM isolate and others.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43865 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-19 04:58:08 +00:00
koda@google.com 554f25b53c Verify/document assumption about stack resource addresses.
We assume that addresses of stack resources refer to the actual stack and are ordered accordingly.
Using the AddressSanitizer with detect_stack_use_after_return will break this assumption.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43858 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-18 23:21:32 +00:00
asiva@google.com 58c14696fb Fix a windows build issue
../../dart/runtime/vm/flags.cc:58:26: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
        OS::Print("%s: %"Pu64" (%s)\n", name_, *this->uint64_ptr_, comment_);

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43669 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-10 21:30:28 +00:00
regis@google.com d50fe1db24 Make instruction counter in simulators 64-bit (issue 22302).
This requires supporting uint64_t flag values.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43660 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-10 17:41:01 +00:00
koda@google.com 253de5e60a Fix race condition in Redirection global list using CAS.
Note that a simple Mutex cannot be used, since the profiler may interrupt the thread at any point, and also walks this list.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43557 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-06 15:50:08 +00:00
fschneider@google.com dd824bd017 Store pc offset instead of absolute pc in the pc descriptors.
This saves space on 64-bit platforms as the offset is stored
as a uint32_t compared to a pointer-size absolute address.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43100 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-23 12:30:11 +00:00
koda@google.com c7e9e048ed Rename Thread -> OSThread.
It's a collection of static utility methods for primitive operations on OS threads.

Make room in the namespace for upcoming class that will represent all the complex state of a VM thread.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42895 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-15 02:30:07 +00:00
srdjan@google.com e86aeecc72 Fix builds on Mac: icount_ is intptr_t.
Review URL: https://codereview.chromium.org//827453003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42565 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-24 01:07:17 +00:00
regis@google.com fc919001c5 Improve generated MIPS code for conditional expressions and branches by delaying
emission of comparison code.
Improve instruction tracing in all simulators.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42555 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-22 20:50:15 +00:00
regis@google.com d353b001a5 Fix SLTIU instruction in MIPS assembler, disassembler, and simulator.
Add regression assembler test.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42362 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-15 16:46:04 +00:00
regis@google.com 0fb9f43f32 Complete and clean up breakpoint support in all 3 debuggers embedded in MIPS,
ARM, and ARM64 simulators.
Implement the same debugging commands in all 3 simulators: stop_sim_at flag, bt,
p icount, break, del, unstop, etc...

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42216 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-09 19:26:26 +00:00
regis@google.com f8711f2149 Improve debugger in MIPS simulator.
Validate integer flag values and allow hex flag values.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42139 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-05 18:37:11 +00:00
johnmccutchan@google.com 456bdc4ea3 Enable the profiler on the simulator
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41752 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-14 23:15:00 +00:00
regis@google.com eea98ee4df Fix unsigned multiplication in MIPS simulator (add assembler regression test).
Fix breakpoint handling in MIPS simulator.
Fix potential overflow in Bigint_sqrAdd intrinsic on ARM.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41674 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-11 22:28:58 +00:00
iposva@google.com d309354728 Fix SIMARM64 and SIMMIPS builds:
- Use DEBUG_ASSERT as needed for Mutex::Owner() access.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41334 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-27 19:51:46 +00:00
iposva@google.com 55357d2993 - Use the simulator to do atomic operations that could also
be executed in generated code.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41332 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-27 19:21:33 +00:00
johnmccutchan@google.com 6f0b2bb2a9 Profiler tweaks
* Rename Script tag to Dart tag.
* Respect ignore bit on samples.
* Mark samples collected with an exit frame.
* Don't give exclusive CPU ticks to top frame on samples collected from an exit frame (because CPU usage is in the native code we've called out to not the function waiting to return).

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38522 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-23 21:09:25 +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