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

Unified Diff: runtime/vm/compiler.cc

Issue 1284713003: Refactor VMTagScope to Thread* rather than Isolate*. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 | « no previous file | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/compiler.cc
diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
index 1eb55f3ab31abfe529aa90cbd2e5a5a5b02e523f..1e27005a355661c88d06655c32e2cdd85878c1e6 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -288,11 +288,12 @@ RawError* Compiler::CompileClass(const Class& cls) {
}
}
- Isolate* const isolate = Isolate::Current();
+ Thread* const thread = Thread::Current();
+ Isolate* const isolate = thread->isolate();
// We remember all the classes that are being compiled in these lists. This
// also allows us to reset the marked_for_parsing state in case we see an
// error.
- VMTagScope tagScope(isolate, VMTag::kCompileClassTagId);
+ VMTagScope tagScope(thread, VMTag::kCompileClassTagId);
Class& parse_class = Class::Handle(isolate);
const GrowableObjectArray& parse_list =
GrowableObjectArray::Handle(isolate, GrowableObjectArray::New(4));
@@ -302,7 +303,7 @@ RawError* Compiler::CompileClass(const Class& cls) {
// Parse the class and all the interfaces it implements and super classes.
LongJumpScope jump;
if (setjmp(*jump.Set()) == 0) {
- StackZone zone(isolate);
+ StackZone zone(thread);
if (FLAG_trace_compiler) {
ISL_Print("Compiling Class %s '%s'\n", "", cls.ToCString());
}
@@ -367,8 +368,9 @@ RawError* Compiler::CompileClass(const Class& cls) {
parse_class.reset_is_marked_for_parsing();
}
}
+ Thread* const thread = Thread::Current();
Isolate* const isolate = Isolate::Current();
- StackZone zone(isolate);
+ StackZone zone(thread);
Error& error = Error::Handle(isolate);
error = isolate->object_store()->sticky_error();
isolate->object_store()->clear_sticky_error();
@@ -1108,7 +1110,7 @@ static RawError* CompileFunctionHelper(CompilationPipeline* pipeline,
RawError* Compiler::CompileFunction(Thread* thread,
const Function& function) {
Isolate* isolate = thread->isolate();
- VMTagScope tagScope(isolate, VMTag::kCompileUnoptimizedTagId);
+ VMTagScope tagScope(thread, VMTag::kCompileUnoptimizedTagId);
TIMELINE_FUNCTION_COMPILATION_DURATION(isolate, "Function", function);
if (!isolate->compilation_allowed()) {
@@ -1163,7 +1165,7 @@ RawError* Compiler::CompileOptimizedFunction(Thread* thread,
const Function& function,
intptr_t osr_id) {
Isolate* isolate = thread->isolate();
- VMTagScope tagScope(isolate, VMTag::kCompileOptimizedTagId);
+ VMTagScope tagScope(thread, VMTag::kCompileOptimizedTagId);
TIMELINE_FUNCTION_COMPILATION_DURATION(isolate,
"OptimizedFunction", function);
« no previous file with comments | « no previous file | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698