[interpreter] Fix how 'throw' is translated to TurboFan.

This fixes the translation of 'throw' bytecodes to TurboFan graphs. The
correct runtime function is being used now, also the frame states are
attached to the correct nodes now.

R=mythria@chromium.org
TEST=cctest/test-run-jsexceptions/ThrowMessageIndirectly
BUG=v8:4674
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#33513}
This commit is contained in:
mstarzinger 2016-01-26 05:22:33 -08:00 committed by Commit bot
parent 32eade634f
commit fd5505ca15
2 changed files with 4 additions and 9 deletions

View File

@ -1361,11 +1361,9 @@ void BytecodeGraphBuilder::VisitThrow(
const interpreter::BytecodeArrayIterator& iterator) {
FrameStateBeforeAndAfter states(this, iterator);
Node* value = environment()->LookupAccumulator();
// TODO(mythria): Change to Runtime::kThrow when we have deoptimization
// information support in the interpreter.
NewNode(javascript()->CallRuntime(Runtime::kReThrow), value);
Node* call = NewNode(javascript()->CallRuntime(Runtime::kThrow), value);
environment()->RecordAfterState(call, &states);
Node* control = NewNode(common()->Throw(), value);
environment()->RecordAfterState(control, &states);
UpdateControlDependencyToLeaveFunction(control);
}
@ -1374,9 +1372,9 @@ void BytecodeGraphBuilder::VisitReThrow(
const interpreter::BytecodeArrayIterator& iterator) {
FrameStateBeforeAndAfter states(this, iterator);
Node* value = environment()->LookupAccumulator();
NewNode(javascript()->CallRuntime(Runtime::kReThrow), value);
Node* call = NewNode(javascript()->CallRuntime(Runtime::kReThrow), value);
environment()->RecordAfterState(call, &states);
Node* control = NewNode(common()->Throw(), value);
environment()->RecordAfterState(control, &states);
UpdateControlDependencyToLeaveFunction(control);
}

View File

@ -520,13 +520,10 @@
'test-run-jsexceptions/CatchCall': [FAIL],
'test-run-jsexceptions/CatchNested': [FAIL],
'test-run-jsexceptions/DeoptCatch': [FAIL],
'test-run-jsexceptions/ThrowMessageIndirectly': [FAIL],
'test-api-interceptors/InterceptorCallICInvalidatedConstantFunctionViaGlobal': [SKIP],
'test-api-interceptors/InterceptorLoadICInvalidatedCallbackViaGlobal': [SKIP],
'test-api-interceptors/InterceptorLoadICInvalidatedFieldViaGlobal': [SKIP],
'test-bytecode-generator/TryCatch': [SKIP],
'test-bytecode-generator/TryFinally': [SKIP],
'test-compiler/FeedbackVectorPreservedAcrossRecompiles': [SKIP],
'test-compiler/FeedbackVectorUnaffectedByScopeChanges': [SKIP],
'test-compiler/OptimizedCodeSharing2': [SKIP],