Threads in the native or blocked states don't prevent safepoints, so they may run concurrently with a safepoint operation like GC. It is not safe for handles to be allocated while the GC is visiting them, so these threads must not allocate handles. Assert only threads in the VM or generated states, which prevent safepoints until they check in, may allocate handles. (Generated code does not allocate handles, but leaf runtime entries remain in the generated state.)
Bug: https://github.com/dart-lang/sdk/issues/34883
Change-Id: I1a211778f7ef96b53a2405f0ee9dde7871b122b6
Reviewed-on: https://dart-review.googlesource.com/c/81540
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Revert "Revert "Fixed issue in MallocHooks where a MallocHookScope was accidentally removed during a merge, causing a deadlock in the hooks. Also turned off stack trace collection in a test that was timing out as a result of the stack trace collection.""
This reverts commit 1a5b555aa9.
BUG=
R=zra@google.com
Review-Url: https://codereview.chromium.org/2711353003 .
- Don't mark core_isolate_snapshot_buffer as a const pointer.
- Update app snapshots without code to not rewrite the VM isolate snapshot, as already done by app snapshots with code.
Fixes#28368R=asiva@google.com
Review-Url: https://codereview.chromium.org/2637193002 .
i.e. #ifndef VM_WHATEVER -> #ifndef RUNTIME_VM_WHATEVER
This lets us remove a hack from the PRESUBMIT.py script that existed
for reasons that are no longer valid, and sets us up to add some
presubmit checks for the GN build.
R=asiva@google.com, rmacnak@google.com
Review URL: https://codereview.chromium.org/2450713004 .
- cache builtin_lib in IsolateData so that the cached value can be used withouit having to call Builtin::LoadAndCheckLibrary which creates new string objects everytime it is called.
Review URL: https://codereview.chromium.org/1663963002 .
deprecated isolate based API.)
- Update all code impacted by this change. E.g. DARTSCOPE
- TEST_CASE now passes the current thread as a parameter to the unit test.
BUG=
R=asiva@google.com
Review URL: https://codereview.chromium.org//1310463005 .
- Complete revamp of isolate-specific flags.
- Associate flags with the isolate on creation.
- Dart_CreateIsolate and associate callback do take an
extra flags argument.
- Make sure to clear IC data array when clearing code.
BUG=23578
Review URL: https://codereview.chromium.org//1162033005
The Benchmark objects were marked as 'const', but Benchmark::CreateIsolate
writes to 'Benchmark::isolate_'. This was not discovered so far, since GCC
places the global Benchmark objects into a read-write section.
It turns out that clang is able to create the const Benchmark objects at
compile time and puts them into a read-only section of the ELF file (it probably
inlines the constructor).
Thus, at runtime Benchmark::CreateIsolate tries to write to a read-only address
and crashes with a SEGV.
R=iposva@google.com
Review URL: https://codereview.chromium.org//14988005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22415 260f80e4-7a28-3924-810f-c04153c831b5
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
launch an isolate running a different script. Finally.
Reviewers: This isn't as hard to review as it looks. Dive right in!
Siggi: Take a look at my test status file changes and make sure I'm
excluding the right stuff.
Much of the churn in the CL comes from moving ownership of the
import_map. It used to be set per-library and is now set per-isolate.
This caused a lot of superficial diffs.
DART EMBEDDING API CHANGES:
- Dart_IsolateCreateCallback now takes a script_uri and main argument
instead of a name_prefix argument. The script_uri argument allows
the callback to launch different scripts. The main argument is used
in creating the isolate debug name.
- Dart_CreateIsolate now takes script_uri and main arguments. These
are used to build the isolate's debug name.
- Dart_LibraryTagHandler, Dart_LoadScript, and Dart_LoadLibrary no
longer take an import_map.
- Added Dart_SetImportMap.
- Added Dart_RootLibrary to provide access to the root library for the
current isolate.
OTHER STUFF
Add a couple of tests for spawnUri -- the existing tests assume that
scripts end in a .js suffix which isn't going to work out for us.
Changed how the debug name for isolates get built a bit.
Refactored bin/main.cc a bit. Fixed some problems with error handling
while creating isolates.
Minor refactoring in builtin.dart to always pass is_windows rather
than relying on it being squirreled away.
Review URL: https://chromiumcodereview.appspot.com//10386107
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7756 260f80e4-7a28-3924-810f-c04153c831b5