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

Unified Diff: src/runtime/runtime-function.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 | « src/ppc/lithium-codegen-ppc.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-function.cc
diff --git a/src/runtime/runtime-function.cc b/src/runtime/runtime-function.cc
index 4213efb94dd917758495e357c4bd87b2b9219111..c849bbfd1e54aba5d85c0a9390fa67572f611a6d 100644
--- a/src/runtime/runtime-function.cc
+++ b/src/runtime/runtime-function.cc
@@ -337,22 +337,33 @@ static SmartArrayPointer<Handle<Object> > GetCallerArguments(Isolate* isolate,
frame->GetFunctions(&functions);
if (functions.length() > 1) {
int inlined_jsframe_index = functions.length() - 1;
- JSFunction* inlined_function = functions[inlined_jsframe_index];
- SlotRefValueBuilder slot_refs(
- frame, inlined_jsframe_index,
- inlined_function->shared()->internal_formal_parameter_count());
+ TranslatedState translated_values(frame);
+ translated_values.Prepare(false, frame->fp());
- int args_count = slot_refs.args_length();
+ int argument_count = 0;
+ TranslatedFrame* translated_frame =
+ translated_values.GetArgumentsInfoFromJSFrameIndex(
+ inlined_jsframe_index, &argument_count);
+ TranslatedFrame::iterator iter = translated_frame->begin();
- *total_argc = prefix_argc + args_count;
+ // Skip the receiver.
+ iter++;
+ argument_count--;
+
+ *total_argc = prefix_argc + argument_count;
SmartArrayPointer<Handle<Object> > param_data(
NewArray<Handle<Object> >(*total_argc));
- slot_refs.Prepare(isolate);
- for (int i = 0; i < args_count; i++) {
- Handle<Object> val = slot_refs.GetNext(isolate, 0);
- param_data[prefix_argc + i] = val;
+ bool should_deoptimize = false;
+ for (int i = 0; i < argument_count; i++) {
+ should_deoptimize = should_deoptimize || iter->IsMaterializedObject();
+ Handle<Object> value = iter->GetValue();
+ param_data[prefix_argc + i] = value;
+ iter++;
+ }
+
+ if (should_deoptimize) {
+ translated_values.StoreMaterializedValuesAndDeopt();
}
- slot_refs.Finish(isolate);
return param_data;
} else {
« no previous file with comments | « src/ppc/lithium-codegen-ppc.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698