Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(850)

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 1250463004: Migrate NoSafepointScope; add constrained concurrent allocation to unit test (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Assert current thread is mutator; add shared assertion macro. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/base_isolate.h ('k') | runtime/vm/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index b701c0e28a4deab358e5b16cedf0e4fb55997ca3..f9049c39b2faebe7e0a1fbecad637bc66dd27ffc 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -3587,7 +3587,8 @@ DART_EXPORT Dart_Handle Dart_TypedDataAcquireData(Dart_Handle object,
Dart_TypedData_Type* type,
void** data,
intptr_t* len) {
- Isolate* isolate = Isolate::Current();
+ Thread* thread = Thread::Current();
+ Isolate* isolate = thread->isolate();
DARTSCOPE(isolate);
intptr_t class_id = Api::ClassId(object);
if (!RawObject::IsExternalTypedDataClassId(class_id) &&
@@ -3625,7 +3626,7 @@ DART_EXPORT Dart_Handle Dart_TypedDataAcquireData(Dart_Handle object,
ASSERT(!obj.IsNull());
length = obj.Length();
size_in_bytes = length * TypedData::ElementSizeInBytes(class_id);
- isolate->IncrementNoSafepointScopeDepth();
+ thread->IncrementNoSafepointScopeDepth();
START_NO_CALLBACK_SCOPE(isolate);
data_tmp = obj.DataAddr(0);
} else {
@@ -3639,7 +3640,7 @@ DART_EXPORT Dart_Handle Dart_TypedDataAcquireData(Dart_Handle object,
val ^= TypedDataView::OffsetInBytes(view_obj);
intptr_t offset_in_bytes = val.Value();
const Instance& obj = Instance::Handle(TypedDataView::Data(view_obj));
- isolate->IncrementNoSafepointScopeDepth();
+ thread->IncrementNoSafepointScopeDepth();
START_NO_CALLBACK_SCOPE(isolate);
if (TypedData::IsTypedData(obj)) {
const TypedData& data_obj = TypedData::Cast(obj);
@@ -3677,7 +3678,8 @@ DART_EXPORT Dart_Handle Dart_TypedDataAcquireData(Dart_Handle object,
DART_EXPORT Dart_Handle Dart_TypedDataReleaseData(Dart_Handle object) {
- Isolate* isolate = Isolate::Current();
+ Thread* thread = Thread::Current();
+ Isolate* isolate = thread->isolate();
DARTSCOPE(isolate);
intptr_t class_id = Api::ClassId(object);
if (!RawObject::IsExternalTypedDataClassId(class_id) &&
@@ -3686,7 +3688,7 @@ DART_EXPORT Dart_Handle Dart_TypedDataReleaseData(Dart_Handle object) {
RETURN_TYPE_ERROR(isolate, object, 'TypedData');
}
if (!RawObject::IsExternalTypedDataClassId(class_id)) {
- isolate->DecrementNoSafepointScopeDepth();
+ thread->DecrementNoSafepointScopeDepth();
END_NO_CALLBACK_SCOPE(isolate);
}
if (FLAG_verify_acquired_data) {
« no previous file with comments | « runtime/vm/base_isolate.h ('k') | runtime/vm/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698