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

Unified Diff: src/accessors.cc

Issue 1136223004: Unify reading of deoptimization information. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix too restrictive check Created 5 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 | src/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/accessors.cc
diff --git a/src/accessors.cc b/src/accessors.cc
index 4527001fc11c3d254f820fe1799f505f582d4ccb..ec6c3ab2cc847fb636e5a9fbaf5c573d81530f74 100644
--- a/src/accessors.cc
+++ b/src/accessors.cc
@@ -1116,22 +1116,38 @@ static Handle<Object> ArgumentsForInlinedFunction(
int inlined_frame_index) {
Isolate* isolate = inlined_function->GetIsolate();
Factory* factory = isolate->factory();
- SlotRefValueBuilder slot_refs(
- frame, inlined_frame_index,
- inlined_function->shared()->internal_formal_parameter_count());
- int args_count = slot_refs.args_length();
+ TranslatedState translated_values(frame);
+ translated_values.Prepare(false, frame->fp());
+
+ int argument_count = 0;
+ TranslatedFrame* translated_frame =
+ translated_values.GetArgumentsInfoFromJSFrameIndex(inlined_frame_index,
+ &argument_count);
+ TranslatedFrame::iterator iter = translated_frame->begin();
+
+ // Skip the receiver.
+ iter++;
+ argument_count--;
+
Handle<JSObject> arguments =
- factory->NewArgumentsObject(inlined_function, args_count);
- Handle<FixedArray> array = factory->NewFixedArray(args_count);
- slot_refs.Prepare(isolate);
- for (int i = 0; i < args_count; ++i) {
- Handle<Object> value = slot_refs.GetNext(isolate, 0);
+ factory->NewArgumentsObject(inlined_function, argument_count);
+ Handle<FixedArray> array = factory->NewFixedArray(argument_count);
+ bool should_deoptimize = false;
+ for (int i = 0; i < argument_count; ++i) {
+ // If we materialize any object, we should deopt because we might alias
+ // an object that was eliminated by escape analysis.
+ should_deoptimize = should_deoptimize || iter->IsMaterializedObject();
+ Handle<Object> value = iter->GetValue();
array->set(i, *value);
+ iter++;
}
- slot_refs.Finish(isolate);
arguments->set_elements(*array);
+ if (should_deoptimize) {
+ translated_values.StoreMaterializedValuesAndDeopt();
+ }
+
// Return the freshly allocated arguments object.
return arguments;
}
« no previous file with comments | « no previous file | src/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698