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

Unified Diff: src/factory.cc

Issue 2435023002: Use a different map to distinguish eval contexts (Closed)
Patch Set: Crankshaft backends and scope deserialization Created 4 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
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index cdbc6fe04dbf8f4fcbe5cee231017e8c56245046..8706750f55ffa2b29e35fa062d15df665136962d 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -838,6 +838,21 @@ Handle<Context> Factory::NewModuleContext(Handle<Module> module,
return context;
}
+Handle<Context> Factory::NewEvalContext(Handle<Module> module,
+ Handle<JSFunction> function,
+ Handle<ScopeInfo> scope_info) {
+ DCHECK_EQ(scope_info->scope_type(), EVAL_SCOPE);
+ Handle<FixedArray> array =
+ NewFixedArray(scope_info->ContextLength(), TENURED);
+ array->set_map_no_write_barrier(*module_context_map());
+ Handle<Context> context = Handle<Context>::cast(array);
+ context->set_closure(*function);
+ context->set_previous(function->context());
+ context->set_extension(*module);
+ context->set_native_context(function->native_context());
+ DCHECK(context->IsModuleContext());
+ return context;
+}
Handle<Context> Factory::NewFunctionContext(int length,
Handle<JSFunction> function) {
« src/contexts.cc ('K') | « src/factory.h ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698