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

Unified Diff: runtime/vm/object.cc

Issue 1424703004: Getting rid of Isolate::current_zone() usage. Pass thread instead of isolate where it makes sense. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fix build Created 5 years, 2 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/object.h ('k') | runtime/vm/profiler_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 37937607faffbee22881acfc5961af2afb298b2d..3ca99f6cf7a58a24098660503db5a93ad48c9e72 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -5378,7 +5378,8 @@ void PatchClass::set_source_class(const Class& value) const {
bool Function::HasBreakpoint() const {
- return Isolate::Current()->debugger()->HasBreakpoint(*this);
+ Thread* thread = Thread::Current();
+ return thread->isolate()->debugger()->HasBreakpoint(*this, thread->zone());
}
@@ -5909,9 +5910,10 @@ void Function::SetIsNativeAutoSetupScope(bool value) const {
bool Function::CanBeInlined() const {
+ Thread* thread = Thread::Current();
return is_inlinable() &&
!is_generated_body() &&
- !Isolate::Current()->debugger()->HasBreakpoint(*this);
+ !thread->isolate()->debugger()->HasBreakpoint(*this, thread->zone());
}
@@ -21637,7 +21639,7 @@ RawUserTag* UserTag::New(const String& label, Heap::Space space) {
// Tag already exists, return existing instance.
return result.raw();
}
- if (TagTableIsFull(isolate)) {
+ if (TagTableIsFull(thread)) {
const String& error = String::Handle(
String::NewFormatted("UserTag instance limit (%" Pd ") reached.",
UserTags::kMaxUserTags));
@@ -21704,10 +21706,10 @@ void UserTag::AddTagToIsolate(Thread* thread, const UserTag& tag) {
ASSERT(isolate->tag_table() != GrowableObjectArray::null());
const GrowableObjectArray& tag_table = GrowableObjectArray::Handle(
zone, isolate->tag_table());
- ASSERT(!TagTableIsFull(isolate));
+ ASSERT(!TagTableIsFull(thread));
#if defined(DEBUG)
// Verify that no existing tag has the same tag id.
- UserTag& other = UserTag::Handle(isolate->current_zone());
+ UserTag& other = UserTag::Handle(thread->zone());
for (intptr_t i = 0; i < tag_table.Length(); i++) {
other ^= tag_table.At(i);
ASSERT(!other.IsNull());
@@ -21724,10 +21726,11 @@ void UserTag::AddTagToIsolate(Thread* thread, const UserTag& tag) {
}
-bool UserTag::TagTableIsFull(Isolate* isolate) {
+bool UserTag::TagTableIsFull(Thread* thread) {
+ Isolate* isolate = thread->isolate();
ASSERT(isolate->tag_table() != GrowableObjectArray::null());
const GrowableObjectArray& tag_table = GrowableObjectArray::Handle(
- isolate->current_zone(), isolate->tag_table());
+ thread->zone(), isolate->tag_table());
ASSERT(tag_table.Length() <= UserTags::kMaxUserTags);
return tag_table.Length() == UserTags::kMaxUserTags;
}
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/profiler_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698