Commit Graph

32 Commits

Author SHA1 Message Date
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
Zachary Anderson 16393ee9c6 Uses SNPRINT macro where possible. Otherwise uses #define for format.
I was able to convert 49 SNPrint(NULL, 0, ...) patterns to use the
macro. I had to use a #define for the format string 5 times due to
uses that didn't fit the macro.

2 occurences of SNPrint(NULL, 0, ...) had >=2 possibilities for the
format string based on runtime values, and I didn't try to convert
them.

Fixed ~10 format strings.

BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org//1331623002 .
2015-09-11 00:18:14 -07:00
Daniel Andersson c089a152ac Migrate most uses of Isolate::current_zone to Thread::zone.
After https://codereview.chromium.org/1204303003/ is submitted, the last remaining uses can go.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org//1220193009 .
2015-07-08 09:59:32 -07:00
Ryan Macnak 66194d4fc1 Port "Add flag to disable lazy compilation of invocation dispatchers."
Fix InvokeNoSuchMethodDispatcher to propagate with a rethrow instead of a throw.

Fix unit test checking raw stack frames.

R=fschneider@google.com

Review URL: https://codereview.chromium.org//1191813002.
2015-06-18 10:23:39 -07:00
koda@google.com da7bf22b7f * Rename misleading Instance::Equals to CanonicalizeEquals and document it.
* Keep 'Equals' alias for String and Integer.
* Add Instance::OperatorEquals that calls or mimics Object.operator==.

This is partly in preparation for internalizing HashMap/Set.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36066 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-12 20:53:23 +00:00
zra@google.com 7d0b680f95 Adds Simulator Longjmp and enables many tests for arm64.
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35603 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-30 23:07:47 +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
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
asiva@google.com a576fec3c0 Allow the native resolver to setup whether it needs the Dart API scope to
be setup automatically or not when a native function is invoked.
This would allow the embedder to treat some native functions as leaf
functions whose invocation can be very light.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31286 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-19 17:47:56 +00:00
asiva@google.com b4d9e0d620 Auto create ApiLocalScope before calling native functions, this ensures that
native functions do not have to call Dart_EnterScope/Dart_ExitScope
when they callback into the VM.

Remove Dart_EnterScope/Dart_ExitScope calls around native functions in 'bin'
directory.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25827 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-06 19:27:48 +00:00
fschneider@google.com f260416fb8 Support fast noSuchMethod dispatch for any number of arguments.
Until now, the fast dispatch was only available with getters and
zero argument methods.

This CL generalizes the approach to any number of arguments. The
dispatcher functions that are auto-generated by the compiler
are not attached to the class anymore. Instead the dispatcher
is only stored in the IC data of each call site. Each class
contains a cache of dispatcher function that map
(name, arguments descriptor) => dispatcher.

This also fixes a bug where the VM report a wrong error message
when throwing a NoSuchMethodError.

BUG=https://code.google.com/p/dart/issues/detail?id=11528
BUG=https://code.google.com/p/dart/issues/detail?id=11223
TEST=tests/language/no_such_method_dispatcher_test.dart
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24876 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-10 10:09:14 +00:00
zra@google.com 4190de5bfc Enables stack frame vm tests on MIPS.
Review URL: https://codereview.chromium.org//14446005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21906 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-23 21:42:19 +00:00
regis@google.com 7f1bc0d351 Enable stack frame vm tests on ARM.
Review URL: https://codereview.chromium.org//14328026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21748 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-19 16:06:40 +00:00
ahe@google.com 5b6c0ba820 Rename InvocationMirror to Invocation.
Review URL: https://codereview.chromium.org//14049009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21465 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 15:42:44 +00:00
hausner@google.com 7eb3efc2ba Fix native argument handling
Native functions need to fetch arguments differently if they are
called through a closure.

fixes issue 6696.
Review URL: https://codereview.chromium.org//11293290

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14937 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-15 01:14:01 +00:00
asiva@google.com ebbb7c4134 - Represent strings internally in UTF-16 format, this makes it
compatible with webkit and will allow for easy externalization of
  strings. One byte strings are retained for pure ASCII strings.
  (The language specification was changed recently to reflect this as
   follows "A string is a sequence of UTF-16 code units").
- Remove four byte string class and all references to it.
- Rename some of the string functions in Dart API to make them
  consistent and better describe the underlying functionality
  Dart_NewString => Dart_NewStringFromCString
  Dart_NewString8 => Dart_NewStringFromUTF8
  Dart_NewString16 => Dart_NewStringFromUTF16
  Dart_NewString32 => Dart_NewStringFromUTF32
  Dart_NewExternalString8 => Dart_NewExternalUTF8String
  Dart_NewExternalString16 => Dart_NewExternalUTF16String
  Dart_NewExternalString32 => Dart_NewExternalUTF32String
  Dart_StringGet8 => Dart_StringToUTF8
  Dart_StringGet16 => Dart_StringToUTF16
  Dart_StringToCString => Dart_StringToCString
  Dart_IsString8 => Removed
  Dart_IsString16 -> Removed
  Dart_StringToBytes -> Removed
  Dart_StringGet32 -> Removed
Review URL: https://codereview.chromium.org//11318018

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14357 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-31 17:56:46 +00:00
lrn@google.com a8720a6d9c Change signature of noSuchMethod to take an InvocationMirror.
Requires VM and dart2js/dart2dart changes to work.

Committed: https://code.google.com/p/dart/source/detail?r=14198

Committed: https://code.google.com/p/dart/source/detail?r=14254

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14324 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-31 10:32:54 +00:00
lrn@google.com 895d155ab1 Revert "Change signature of noSuchMethod to take an InvocationMirror."
TBR=ager@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14260 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 10:47:42 +00:00
lrn@google.com 4a24ddc1d4 Change signature of noSuchMethod to take an InvocationMirror.
Requires VM and dart2js/dart2dart changes to work.

Committed: https://code.google.com/p/dart/source/detail?r=14198

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14254 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 10:04:12 +00:00
lrn@google.com 778b0dc5e5 Revert "Change signature of noSuchMethod to take an InvocationMirror."
TBR=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14199 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-29 14:07:10 +00:00
lrn@google.com 0bcd2f4f7b Change signature of noSuchMethod to take an InvocationMirror.
Requires VM and dart2js/dart2dart changes to work.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14198 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-29 13:34:58 +00:00
srdjan@google.com 1821bce654 Removed incorrect EXPECT that gets triggered with low optimization_counter_threshold.
Review URL: https://chromiumcodereview.appspot.com//10823416

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10993 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-20 17:59:09 +00:00
turnidge@google.com 2803d78dfd Change the zone allocation api.
Instead of passing a size in bytes to the allocation function, we now
have a templatized Alloc function:

  zone->Alloc<Type>(len)

This is better for security, as we can check for integer overflow in
the size computation before performing the allocation.  Before, we
often failed to check this.
Review URL: https://chromiumcodereview.appspot.com//10836061

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10254 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-03 21:51:44 +00:00
regis@google.com 1e055acce8 Stop passing location argument to run time calls, since it is stored in the pc
descriptor.
Various cleanups.
Review URL: https://chromiumcodereview.appspot.com//10701131

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9538 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 23:59:09 +00:00
asiva@google.com 3107319e40 Simplify representation of stack frames. Remove the special types DartFrame/StubFrame and instead use StackFrame with methods IsDartFrame and IsStubFrame for frames representing Dart or Stub Code. This eliminates all the complexity that was added to ensure that we always see only one stub frame before hitting a dart frame during iteration.
Fixes bug 6380625 which was another case when we had two stub frames before hitting the dart frame.
Review URL: https://chromiumcodereview.appspot.com//10173008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6920 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-25 01:15:28 +00:00
turnidge@google.com 9e2c641658 Remove the deprecated method invocation and field access apis from the
dart embbedding api.  Use the new apis instead.

Fixed a bug where field/function lookup was failing for imported libs.
Added tests.  Had to add a couple of lookup functions to Library.

Fixed a bug in Dart_Invoke -- it wasn't handling a null receiver
correctly.
Review URL: https://chromiumcodereview.appspot.com//10021072

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6769 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-19 21:04:15 +00:00
asiva@google.com 2d3775a1b1 Resubmit change 6302 after fixing the compiler warning on older GCC compiler versions:
Change 6302 description:
- Wire the stack frame iterator to use stack maps for traversing objects if
there are stack maps in the code object. If there are no stack maps it still
does the old style stack frame traversal between fp and sp looking for tagged
pointers.
- Added a mechanism to be able to iterate over the code space and look for a
particular object.
Review URL: https://chromiumcodereview.appspot.com//10030001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6331 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-09 18:20:23 +00:00
asiva@google.com c79da818cc Revert change 6302 until the compiler warning is addressed.
Review URL: https://chromiumcodereview.appspot.com//10025003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6304 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-07 02:04:28 +00:00
asiva@google.com c27cec5b6e - Wire the stack frame iterator to use stack maps for traversing objects if there are stack maps in the code object. If there are no stack maps it still does the old style stack frame traversal between fp and sp looking for tagged pointers.
- Added a mechanism to be able to iterate over the code space and look for a particular object.

- Remove registration of code objects into the code index table.
Review URL: https://chromiumcodereview.appspot.com//9791048

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6302 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-07 01:44:48 +00:00
sgjesse@google.com bf67f24098 Move assert.h/assert.cc from runtime/vm to runtime/platform
The purpose of this change is twofold:

1. Source in the bin directory can now use the same assertions as
   source in the vm directory. The ASSERT macro used by the code
   in runtime/bin was just defined to use assert from the standard
   C library.
2. Moving other implementation parts from runtime/vm to
   runtime/platform (e.g. classes Monitor and Mutex) for sharing
   between runtime/bin and runtime/vm will be easier as these
   implementations rely on these assertion macros.

Created two gypi files for the platform directory. One for the
headers and one for the source. The source one is only included
when building the VM library and will be present in libdart.a
when the dart executable is linked.

All the code for asserts is still in the dart namespace.

Also re-arranged the order of includes to be alphabetically in
the files touched.

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

BUG=
TEST=

Review URL: http://codereview.chromium.org//9189003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3335 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-16 12:28:10 +00:00
regis@google.com a577991ad5 Port code generator to x64.
Review URL: http://codereview.chromium.org//8984003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2557 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-17 00:56:02 +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