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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 1220193009: Migrate most uses of Isolate::current_zone to Thread::zone. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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/coverage.cc ('k') | runtime/vm/debugger.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 9868346f1e297e8ec82300cc4caa3d9858616155..c25b2fc589b0f0dd05b653eadafaa2af91c89ef8 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -439,7 +439,9 @@ Dart_Isolate Api::CastIsolate(Isolate* isolate) {
Dart_Handle Api::NewError(const char* format, ...) {
- Isolate* isolate = Isolate::Current();
+ Thread* thread = Thread::Current();
+ Isolate* isolate = thread->isolate();
+ Zone* zone = thread->zone();
DARTSCOPE(isolate);
CHECK_CALLBACK_STATE(isolate);
@@ -448,13 +450,13 @@ Dart_Handle Api::NewError(const char* format, ...) {
intptr_t len = OS::VSNPrint(NULL, 0, format, args);
va_end(args);
- char* buffer = isolate->current_zone()->Alloc<char>(len + 1);
+ char* buffer = zone->Alloc<char>(len + 1);
va_list args2;
va_start(args2, format);
OS::VSNPrint(buffer, (len + 1), format, args2);
va_end(args2);
- const String& message = String::Handle(isolate, String::New(buffer));
+ const String& message = String::Handle(zone, String::New(buffer));
return Api::NewHandle(isolate, ApiError::New(message));
}
« no previous file with comments | « runtime/vm/coverage.cc ('k') | runtime/vm/debugger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698