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

Unified Diff: src/runtime.cc

Issue 28027: Speed up access to global variables from eval scopes. Traverse the... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 10 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
« src/objects.cc ('K') | « src/objects.cc ('k') | src/scopeinfo.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
===================================================================
--- src/runtime.cc (revision 1344)
+++ src/runtime.cc (working copy)
@@ -4007,11 +4007,11 @@
CONVERT_ARG_CHECKED(String, source, 0);
CONVERT_ARG_CHECKED(Smi, line_offset, 1);
- // Compile source string.
+ // Compile source string in the global context.
+ Handle<Context> context(Top::context()->global_context());
Handle<JSFunction> boilerplate =
- Compiler::CompileEval(source, line_offset->value(), true);
+ Compiler::CompileEval(source, context, line_offset->value(), true);
if (boilerplate.is_null()) return Failure::Exception();
- Handle<Context> context(Top::context()->global_context());
Handle<JSFunction> fun =
Factory::NewFunctionFromBoilerplate(boilerplate, context);
return *fun;
@@ -4033,8 +4033,9 @@
Handle<Context> context(Context::cast(frame->context()));
bool is_global = context->IsGlobalContext();
- // Compile source string.
- Handle<JSFunction> boilerplate = Compiler::CompileEval(source, 0, is_global);
+ // Compile source string in the current context.
+ Handle<JSFunction> boilerplate =
+ Compiler::CompileEval(source, context, 0, is_global);
if (boilerplate.is_null()) return Failure::Exception();
Handle<JSFunction> fun =
Factory::NewFunctionFromBoilerplate(boilerplate, context);
@@ -5594,7 +5595,10 @@
Factory::NewStringFromAscii(Vector<const char>(source_str,
source_str_length));
Handle<JSFunction> boilerplate =
- Compiler::CompileEval(function_source, 0, context->IsGlobalContext());
+ Compiler::CompileEval(function_source,
+ context,
+ 0,
+ context->IsGlobalContext());
if (boilerplate.is_null()) return Failure::Exception();
Handle<JSFunction> compiled_function =
Factory::NewFunctionFromBoilerplate(boilerplate, context);
@@ -5651,7 +5655,8 @@
Handle<Context> context = Top::global_context();
// Compile the source to be evaluated.
- Handle<JSFunction> boilerplate(Compiler::CompileEval(source, 0, true));
+ Handle<JSFunction> boilerplate =
+ Handle<JSFunction>(Compiler::CompileEval(source, context, 0, true));
if (boilerplate.is_null()) return Failure::Exception();
Handle<JSFunction> compiled_function =
Handle<JSFunction>(Factory::NewFunctionFromBoilerplate(boilerplate,
« src/objects.cc ('K') | « src/objects.cc ('k') | src/scopeinfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698