Commit e9e77212 authored by jarin's avatar jarin Committed by Commit bot

[turbofan] Fix bunch of tests failing with --turbo-deoptimization.

R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/786333004

Cr-Commit-Position: refs/heads/master@{#26115}
parent ace94df5
...@@ -152,13 +152,16 @@ bool Linkage::NeedsFrameState(Runtime::FunctionId function) { ...@@ -152,13 +152,16 @@ bool Linkage::NeedsFrameState(Runtime::FunctionId function) {
case Runtime::kDebugGetLoadedScripts: case Runtime::kDebugGetLoadedScripts:
case Runtime::kDebugGetPropertyDetails: case Runtime::kDebugGetPropertyDetails:
case Runtime::kDebugPromiseEvent: case Runtime::kDebugPromiseEvent:
case Runtime::kDefaultConstructorSuperCall:
case Runtime::kDefineAccessorPropertyUnchecked: case Runtime::kDefineAccessorPropertyUnchecked:
case Runtime::kDefineDataPropertyUnchecked: case Runtime::kDefineDataPropertyUnchecked:
case Runtime::kDeleteProperty: case Runtime::kDeleteProperty:
case Runtime::kDeliverObservationChangeRecords:
case Runtime::kDeoptimizeFunction: case Runtime::kDeoptimizeFunction:
case Runtime::kFunctionBindArguments: case Runtime::kFunctionBindArguments:
case Runtime::kGetDefaultReceiver: case Runtime::kGetDefaultReceiver:
case Runtime::kGetFrameCount: case Runtime::kGetFrameCount:
case Runtime::kGetFrameDetails:
case Runtime::kGetOwnProperty: case Runtime::kGetOwnProperty:
case Runtime::kGetOwnPropertyNames: case Runtime::kGetOwnPropertyNames:
case Runtime::kGetPropertyNamesFast: case Runtime::kGetPropertyNamesFast:
......
...@@ -1014,8 +1014,9 @@ class RepresentationSelector { ...@@ -1014,8 +1014,9 @@ class RepresentationSelector {
case IrOpcode::kLoadStackPointer: case IrOpcode::kLoadStackPointer:
return VisitLeaf(node, kMachPtr); return VisitLeaf(node, kMachPtr);
case IrOpcode::kStateValues: case IrOpcode::kStateValues:
// State values declare tagged use so that we do not conflate values.
for (int i = 0; i < node->InputCount(); i++) { for (int i = 0; i < node->InputCount(); i++) {
ProcessInput(node, i, kTypeAny); Enqueue(node->InputAt(i), kMachAnyTagged);
} }
SetOutput(node, kMachAnyTagged); SetOutput(node, kMachAnyTagged);
break; break;
......
...@@ -2202,46 +2202,56 @@ RUNTIME_FUNCTION(Runtime_DebugEvaluate) { ...@@ -2202,46 +2202,56 @@ RUNTIME_FUNCTION(Runtime_DebugEvaluate) {
StackFrame::Id id = UnwrapFrameId(wrapped_id); StackFrame::Id id = UnwrapFrameId(wrapped_id);
JavaScriptFrameIterator it(isolate, id); JavaScriptFrameIterator it(isolate, id);
JavaScriptFrame* frame = it.frame(); JavaScriptFrame* frame = it.frame();
FrameInspector frame_inspector(frame, inlined_jsframe_index, isolate); Handle<JSFunction> function;
Handle<JSFunction> function(JSFunction::cast(frame_inspector.GetFunction())); Handle<SharedFunctionInfo> outer_info;
Handle<SharedFunctionInfo> outer_info(function->shared()); Handle<JSObject> materialized;
Handle<Context> eval_context;
{
// We need a short scope for re-entrancy as we cannot have two frame
// inspectors at the same time (because they are using a global variable).
FrameInspector frame_inspector(frame, inlined_jsframe_index, isolate);
function =
Handle<JSFunction>(JSFunction::cast(frame_inspector.GetFunction()));
outer_info = Handle<SharedFunctionInfo>(function->shared());
// Traverse the saved contexts chain to find the active context for the // Traverse the saved contexts chain to find the active context for the
// selected frame. // selected frame.
SaveContext* save = FindSavedContextForFrame(isolate, frame); SaveContext* save = FindSavedContextForFrame(isolate, frame);
SaveContext savex(isolate); SaveContext savex(isolate);
isolate->set_context(*(save->context())); isolate->set_context(*(save->context()));
// Materialize stack locals and the arguments object. // Materialize stack locals and the arguments object.
Handle<JSObject> materialized = NewJSObjectWithNullProto(isolate); materialized = NewJSObjectWithNullProto(isolate);
ASSIGN_RETURN_FAILURE_ON_EXCEPTION( ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, materialized, isolate, materialized,
MaterializeStackLocalsWithFrameInspector(isolate, materialized, function, MaterializeStackLocalsWithFrameInspector(isolate, materialized,
&frame_inspector)); function, &frame_inspector));
ASSIGN_RETURN_FAILURE_ON_EXCEPTION( ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
isolate, materialized, isolate, materialized,
MaterializeArgumentsObject(isolate, materialized, function)); MaterializeArgumentsObject(isolate, materialized, function));
// At this point, the lookup chain may look like this: // At this point, the lookup chain may look like this:
// [inner context] -> [function stack]+[function context] -> [outer context] // [inner context] -> [function stack]+[function context] -> [outer context]
// The function stack is not an actual context, it complements the function // The function stack is not an actual context, it complements the function
// context. In order to have the same lookup chain when debug-evaluating, // context. In order to have the same lookup chain when debug-evaluating,
// we materialize the stack and insert it into the context chain as a // we materialize the stack and insert it into the context chain as a
// with-context before the function context. // with-context before the function context.
// [inner context] -> [with context] -> [function context] -> [outer context] // [inner context] -> [with context] -> [function context] -> [outer
// Ordering the with-context before the function context forces a dynamic // context]
// lookup instead of a static lookup that could fail as the scope info is // Ordering the with-context before the function context forces a dynamic
// outdated and may expect variables to still be stack-allocated. // lookup instead of a static lookup that could fail as the scope info is
// Afterwards, we write changes to the with-context back to the stack // outdated and may expect variables to still be stack-allocated.
// and remove it from the context chain. // Afterwards, we write changes to the with-context back to the stack
// This could cause lookup failures if debug-evaluate creates a closure that // and remove it from the context chain.
// uses this temporary context chain. // This could cause lookup failures if debug-evaluate creates a closure that
// uses this temporary context chain.
Handle<Context> eval_context(Context::cast(frame_inspector.GetContext()));
DCHECK(!eval_context.is_null()); eval_context = Handle<Context>(Context::cast(frame_inspector.GetContext()));
DCHECK(!eval_context.is_null());
}
Handle<Context> function_context = eval_context; Handle<Context> function_context = eval_context;
Handle<Context> outer_context(function->context(), isolate); Handle<Context> outer_context(function->context(), isolate);
Handle<Context> inner_context; Handle<Context> inner_context;
......
...@@ -83,12 +83,8 @@ ...@@ -83,12 +83,8 @@
'debug-step-turbofan': [PASS, FAIL], 'debug-step-turbofan': [PASS, FAIL],
# TODO(jarin): Some tests don't like --turbo-deoptimzation very much. # TODO(jarin): Some tests don't like --turbo-deoptimzation very much.
'asm/embenchen/lua_binarytrees': [SKIP],
'es6/symbols': [PASS, NO_VARIANTS], 'es6/symbols': [PASS, NO_VARIANTS],
'es7/object-observe-debug-event': [PASS, NO_VARIANTS],
'harmony/classes': [PASS, NO_VARIANTS],
'regress/regress-354433': [PASS, NO_VARIANTS], # only on ARM simulator. 'regress/regress-354433': [PASS, NO_VARIANTS], # only on ARM simulator.
'regress/regress-crbug-259300': [PASS, NO_VARIANTS],
# TODO(arv): TurboFan does not yet add [[HomeObject]] as needed. # TODO(arv): TurboFan does not yet add [[HomeObject]] as needed.
'harmony/object-literals-super': [PASS, NO_VARIANTS], 'harmony/object-literals-super': [PASS, NO_VARIANTS],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment