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

Unified Diff: src/compiler.cc

Issue 4888002: [Isolates] Pass isolate to VMState constructor. (Closed)
Patch Set: Created 10 years, 1 month 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 | « src/builtins.cc ('k') | src/cpu-profiler.h » ('j') | src/top.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index a8ce0f3ec359a4b8782da89b7b89a1c862ed83d7..1466abea01a9706ec7397512299d9aa03f67cf20 100755
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -265,7 +265,7 @@ Handle<SharedFunctionInfo> Compiler::Compile(Handle<String> source,
COUNTERS->total_compile_size()->Increment(source_length);
// The VM is in the COMPILER state until exiting this function.
- VMState state(COMPILER);
+ VMState state(isolate, COMPILER);
CompilationCache* compilation_cache = isolate->compilation_cache();
@@ -331,31 +331,30 @@ Handle<SharedFunctionInfo> Compiler::Compile(Handle<String> source,
Handle<SharedFunctionInfo> Compiler::CompileEval(Handle<String> source,
Handle<Context> context,
bool is_global) {
+ Isolate* isolate = source->GetIsolate();
int source_length = source->length();
- COUNTERS->total_eval_size()->Increment(source_length);
- COUNTERS->total_compile_size()->Increment(source_length);
+ isolate->counters()->total_eval_size()->Increment(source_length);
+ isolate->counters()->total_compile_size()->Increment(source_length);
// The VM is in the COMPILER state until exiting this function.
- VMState state(COMPILER);
+ VMState state(isolate, COMPILER);
// Do a lookup in the compilation cache; if the entry is not there, invoke
// the compiler and add the result to the cache.
Handle<SharedFunctionInfo> result;
- CompilationCache* compilation_cache =
- context->GetIsolate()->compilation_cache();
+ CompilationCache* compilation_cache = isolate->compilation_cache();
result = compilation_cache->LookupEval(source, context, is_global);
if (result.is_null()) {
// Create a script object describing the script to be compiled.
- Handle<Script> script = FACTORY->NewScript(source);
+ Handle<Script> script = isolate->factory()->NewScript(source);
CompilationInfo info(script);
info.MarkAsEval();
if (is_global) info.MarkAsGlobal();
info.SetCallingContext(context);
result = MakeFunctionInfo(&info);
if (!result.is_null()) {
- CompilationCache* compilation_cache =
- context->GetIsolate()->compilation_cache();
+ CompilationCache* compilation_cache = isolate->compilation_cache();
compilation_cache->PutEval(source, context, is_global, result);
}
}
@@ -368,7 +367,7 @@ bool Compiler::CompileLazy(CompilationInfo* info) {
CompilationZoneScope zone_scope(DELETE_ON_EXIT);
// The VM is in the COMPILER state until exiting this function.
- VMState state(COMPILER);
+ VMState state(info->isolate(), COMPILER);
PostponeInterruptsScope postpone;
« no previous file with comments | « src/builtins.cc ('k') | src/cpu-profiler.h » ('j') | src/top.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698