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

Unified Diff: src/factory.cc

Issue 2302013002: Store the scope info in catch contexts (Closed)
Patch Set: updates Created 4 years, 3 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 0a02a877495b35d543b67b5621ff99f80962913f..c0a3e6f890569e5ed395a2e58cded6130dedc254 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -104,7 +104,6 @@ Handle<PrototypeInfo> Factory::NewPrototypeInfo() {
Handle<ContextExtension> Factory::NewContextExtension(
Handle<ScopeInfo> scope_info, Handle<Object> extension) {
- DCHECK(scope_info->is_declaration_scope());
Handle<ContextExtension> result =
Handle<ContextExtension>::cast(NewStruct(CONTEXT_EXTENSION_TYPE));
result->set_scope_info(*scope_info);
@@ -816,18 +815,19 @@ Handle<Context> Factory::NewFunctionContext(int length,
return context;
}
-
Handle<Context> Factory::NewCatchContext(Handle<JSFunction> function,
Handle<Context> previous,
+ Handle<ScopeInfo> scope_info,
Handle<String> name,
Handle<Object> thrown_object) {
STATIC_ASSERT(Context::MIN_CONTEXT_SLOTS == Context::THROWN_OBJECT_INDEX);
Handle<FixedArray> array = NewFixedArray(Context::MIN_CONTEXT_SLOTS + 1);
array->set_map_no_write_barrier(*catch_context_map());
Handle<Context> context = Handle<Context>::cast(array);
+ Handle<ContextExtension> extension = NewContextExtension(scope_info, name);
Michael Starzinger 2016/09/05 11:35:29 Allocating before fully initializing the context (
jochen (gone - plz use gerrit) 2016/09/05 11:42:44 done
context->set_closure(*function);
context->set_previous(*previous);
- context->set_extension(*name);
+ context->set_extension(*extension);
context->set_native_context(previous->native_context());
context->set(Context::THROWN_OBJECT_INDEX, *thrown_object);
return context;

Powered by Google App Engine
This is Rietveld 408576698