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

Side by Side 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, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/contexts.h" 9 #include "src/contexts.h"
10 #include "src/deoptimizer.h" 10 #include "src/deoptimizer.h"
(...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after
1109 // Accessors::FunctionArguments 1109 // Accessors::FunctionArguments
1110 // 1110 //
1111 1111
1112 1112
1113 static Handle<Object> ArgumentsForInlinedFunction( 1113 static Handle<Object> ArgumentsForInlinedFunction(
1114 JavaScriptFrame* frame, 1114 JavaScriptFrame* frame,
1115 Handle<JSFunction> inlined_function, 1115 Handle<JSFunction> inlined_function,
1116 int inlined_frame_index) { 1116 int inlined_frame_index) {
1117 Isolate* isolate = inlined_function->GetIsolate(); 1117 Isolate* isolate = inlined_function->GetIsolate();
1118 Factory* factory = isolate->factory(); 1118 Factory* factory = isolate->factory();
1119 SlotRefValueBuilder slot_refs(
1120 frame, inlined_frame_index,
1121 inlined_function->shared()->internal_formal_parameter_count());
1122 1119
1123 int args_count = slot_refs.args_length(); 1120 TranslatedState translated_values(frame);
1121 translated_values.Prepare(false, frame->fp());
1122
1123 int argument_count = 0;
1124 TranslatedFrame* translated_frame =
1125 translated_values.GetArgumentsInfoFromJSFrameIndex(inlined_frame_index,
1126 &argument_count);
1127 TranslatedFrame::iterator iter = translated_frame->begin();
1128
1129 // Skip the receiver.
1130 iter++;
1131 argument_count--;
1132
1124 Handle<JSObject> arguments = 1133 Handle<JSObject> arguments =
1125 factory->NewArgumentsObject(inlined_function, args_count); 1134 factory->NewArgumentsObject(inlined_function, argument_count);
1126 Handle<FixedArray> array = factory->NewFixedArray(args_count); 1135 Handle<FixedArray> array = factory->NewFixedArray(argument_count);
1127 slot_refs.Prepare(isolate); 1136 bool should_deoptimize = false;
1128 for (int i = 0; i < args_count; ++i) { 1137 for (int i = 0; i < argument_count; ++i) {
1129 Handle<Object> value = slot_refs.GetNext(isolate, 0); 1138 // If we materialize any object, we should deopt because we might alias
1139 // an object that was eliminated by escape analysis.
1140 should_deoptimize = should_deoptimize || iter->IsMaterializedObject();
1141 Handle<Object> value = iter->GetValue();
1130 array->set(i, *value); 1142 array->set(i, *value);
1143 iter++;
1131 } 1144 }
1132 slot_refs.Finish(isolate);
1133 arguments->set_elements(*array); 1145 arguments->set_elements(*array);
1134 1146
1147 if (should_deoptimize) {
1148 translated_values.StoreMaterializedValuesAndDeopt();
1149 }
1150
1135 // Return the freshly allocated arguments object. 1151 // Return the freshly allocated arguments object.
1136 return arguments; 1152 return arguments;
1137 } 1153 }
1138 1154
1139 1155
1140 static int FindFunctionInFrame(JavaScriptFrame* frame, 1156 static int FindFunctionInFrame(JavaScriptFrame* frame,
1141 Handle<JSFunction> function) { 1157 Handle<JSFunction> function) {
1142 DisallowHeapAllocation no_allocation; 1158 DisallowHeapAllocation no_allocation;
1143 List<JSFunction*> functions(2); 1159 List<JSFunction*> functions(2);
1144 frame->GetFunctions(&functions); 1160 frame->GetFunctions(&functions);
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
1453 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); 1469 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport);
1454 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); 1470 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport);
1455 info->set_getter(*getter); 1471 info->set_getter(*getter);
1456 if (!(attributes & ReadOnly)) info->set_setter(*setter); 1472 if (!(attributes & ReadOnly)) info->set_setter(*setter);
1457 return info; 1473 return info;
1458 } 1474 }
1459 1475
1460 1476
1461 } // namespace internal 1477 } // namespace internal
1462 } // namespace v8 1478 } // namespace v8
OLDNEW
« 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