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

Unified Diff: src/deoptimizer.cc

Issue 1998143002: [deoptimizer] Support materialization of closures. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comment. Created 4 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/deoptimizer.cc
diff --git a/src/deoptimizer.cc b/src/deoptimizer.cc
index adf4cf1296676a73f5e1319b0d14a23e8554d44a..c698459fd0396c4f4a50ec008f0430b053bb7fd5 100644
--- a/src/deoptimizer.cc
+++ b/src/deoptimizer.cc
@@ -3711,6 +3711,35 @@ Handle<Object> TranslatedState::MaterializeAt(int frame_index,
object->set_length(*length);
return object;
}
+ case JS_FUNCTION_TYPE: {
+ Handle<JSFunction> object =
+ isolate_->factory()->NewFunctionFromSharedFunctionInfo(
+ handle(isolate_->object_function()->shared()),
+ handle(isolate_->context()));
+ slot->value_ = object;
+ // We temporarily allocated a JSFunction for the {Object} function
+ // within the current context, to break cycles in the object graph.
+ // The correct function and context will be set below once available.
+ Handle<Object> properties = MaterializeAt(frame_index, value_index);
+ Handle<Object> elements = MaterializeAt(frame_index, value_index);
+ Handle<Object> prototype = MaterializeAt(frame_index, value_index);
+ Handle<Object> shared = MaterializeAt(frame_index, value_index);
+ Handle<Object> context = MaterializeAt(frame_index, value_index);
+ Handle<Object> literals = MaterializeAt(frame_index, value_index);
+ Handle<Object> entry = MaterializeAt(frame_index, value_index);
+ Handle<Object> next_link = MaterializeAt(frame_index, value_index);
+ object->ReplaceCode(*isolate_->builtins()->CompileLazy());
+ object->set_map(*map);
+ object->set_properties(FixedArray::cast(*properties));
+ object->set_elements(FixedArrayBase::cast(*elements));
+ object->set_prototype_or_initial_map(*prototype);
+ object->set_shared(SharedFunctionInfo::cast(*shared));
+ object->set_context(Context::cast(*context));
+ object->set_literals(LiteralsArray::cast(*literals));
+ CHECK(entry->IsNumber()); // Entry to compile lazy stub.
+ CHECK(next_link->IsUndefined());
+ return object;
+ }
case FIXED_ARRAY_TYPE: {
Handle<Object> lengthObject = MaterializeAt(frame_index, value_index);
int32_t length = 0;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698