Commit 232e28d6 authored by mythria's avatar mythria Committed by Commit bot

[Interpreter] Marks that 'throw' has returned a value.

This is to fix some of the failing test262 tests with ignition flag.
In few test262 tests, there is a throw from the script scope. Rewriter::Rewrite
pass converts expression statements into assignment statements in script scope.
This causes interpreter to fail because assignment expression expects a result
in accumulator but throw statement does not return a value. To fix this, we
now mark that accumulator contains a value when visiting throw statement.

BUG=v8:4280
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33408}
parent 96a333d9
...@@ -409,7 +409,7 @@ void BytecodeGenerator::MakeBytecodeBody() { ...@@ -409,7 +409,7 @@ void BytecodeGenerator::MakeBytecodeBody() {
// Visit illegal re-declaration and bail out if it exists. // Visit illegal re-declaration and bail out if it exists.
if (scope()->HasIllegalRedeclaration()) { if (scope()->HasIllegalRedeclaration()) {
Visit(scope()->GetIllegalRedeclaration()); VisitForEffect(scope()->GetIllegalRedeclaration());
return; return;
} }
...@@ -1519,6 +1519,11 @@ void BytecodeGenerator::VisitYield(Yield* expr) { UNIMPLEMENTED(); } ...@@ -1519,6 +1519,11 @@ void BytecodeGenerator::VisitYield(Yield* expr) { UNIMPLEMENTED(); }
void BytecodeGenerator::VisitThrow(Throw* expr) { void BytecodeGenerator::VisitThrow(Throw* expr) {
VisitForAccumulatorValue(expr->exception()); VisitForAccumulatorValue(expr->exception());
builder()->Throw(); builder()->Throw();
// Throw statments are modeled as expression instead of statments. These are
// converted from assignment statements in Rewriter::ReWrite pass. An
// assignment statement expects a value in the accumulator. This is a hack to
// avoid DCHECK fails assert accumulator has been set.
execution_result()->SetResultInAccumulator();
} }
......
...@@ -803,7 +803,6 @@ ...@@ -803,7 +803,6 @@
'compiler/variables': [SKIP], 'compiler/variables': [SKIP],
'context-calls-maintained': [SKIP], 'context-calls-maintained': [SKIP],
'contextual-calls': [SKIP], 'contextual-calls': [SKIP],
'cross-realm-filtering': [SKIP],
'cyclic-array-to-string': [SKIP], 'cyclic-array-to-string': [SKIP],
'd8-worker-sharedarraybuffer': [SKIP], 'd8-worker-sharedarraybuffer': [SKIP],
'declare-locally': [SKIP], 'declare-locally': [SKIP],
...@@ -829,7 +828,6 @@ ...@@ -829,7 +828,6 @@
'global-load-from-nested-eval': [SKIP], 'global-load-from-nested-eval': [SKIP],
'global-vars-with': [SKIP], 'global-vars-with': [SKIP],
'instanceof-2': [SKIP], 'instanceof-2': [SKIP],
'invalid-lhs': [SKIP],
'json-replacer-number-wrapper-tostring': [SKIP], 'json-replacer-number-wrapper-tostring': [SKIP],
'json-replacer-order': [SKIP], 'json-replacer-order': [SKIP],
'json': [SKIP], 'json': [SKIP],
...@@ -888,7 +886,6 @@ ...@@ -888,7 +886,6 @@
'regress/regress-1853': [SKIP], 'regress/regress-1853': [SKIP],
'regress/regress-186': [SKIP], 'regress/regress-186': [SKIP],
'regress/regress-1980': [SKIP], 'regress/regress-1980': [SKIP],
'regress/regress-2054': [SKIP],
'regress/regress-2071': [SKIP], 'regress/regress-2071': [SKIP],
'regress/regress-2163': [SKIP], 'regress/regress-2163': [SKIP],
'regress/regress-220': [SKIP], 'regress/regress-220': [SKIP],
...@@ -896,7 +893,6 @@ ...@@ -896,7 +893,6 @@
'regress/regress-2339': [SKIP], 'regress/regress-2339': [SKIP],
'regress/regress-2374': [SKIP], 'regress/regress-2374': [SKIP],
'regress/regress-2593': [SKIP], 'regress/regress-2593': [SKIP],
'regress/regress-259': [SKIP],
'regress/regress-2618': [SKIP], 'regress/regress-2618': [SKIP],
'regress/regress-263': [SKIP], 'regress/regress-263': [SKIP],
'regress/regress-265': [SKIP], 'regress/regress-265': [SKIP],
...@@ -946,10 +942,8 @@ ...@@ -946,10 +942,8 @@
'regress/regress-4309-3': [SKIP], 'regress/regress-4309-3': [SKIP],
'regress/regress-4320': [SKIP], 'regress/regress-4320': [SKIP],
'regress/regress-4325': [SKIP], 'regress/regress-4325': [SKIP],
'regress/regress-436893': [SKIP],
'regress/regress-4374': [SKIP], 'regress/regress-4374': [SKIP],
'regress/regress-4388': [SKIP], 'regress/regress-4388': [SKIP],
'regress/regress-444805': [SKIP],
'regress/regress-446389': [SKIP], 'regress/regress-446389': [SKIP],
'regress/regress-447756': [SKIP], 'regress/regress-447756': [SKIP],
'regress/regress-4509-Class-constructor-typeerror-realm' : [SKIP], 'regress/regress-4509-Class-constructor-typeerror-realm' : [SKIP],
...@@ -993,7 +987,6 @@ ...@@ -993,7 +987,6 @@
'regress/regress-arguments-gc': [SKIP], 'regress/regress-arguments-gc': [SKIP],
'regress/regress-assignment-in-test-context': [SKIP], 'regress/regress-assignment-in-test-context': [SKIP],
'regress/regress-bce-underflow': [SKIP], 'regress/regress-bce-underflow': [SKIP],
'regress/regress-builtinbust-7': [SKIP],
'regress/regress-cnlt-elements': [SKIP], 'regress/regress-cnlt-elements': [SKIP],
'regress/regress-cnlt-enum-indices': [SKIP], 'regress/regress-cnlt-enum-indices': [SKIP],
'regress/regress-cntl-descriptors-enum': [SKIP], 'regress/regress-cntl-descriptors-enum': [SKIP],
...@@ -1018,7 +1011,6 @@ ...@@ -1018,7 +1011,6 @@
'regress/regress-crbug-405922': [SKIP], 'regress/regress-crbug-405922': [SKIP],
'regress/regress-crbug-409614': [SKIP], 'regress/regress-crbug-409614': [SKIP],
'regress/regress-crbug-410033': [SKIP], 'regress/regress-crbug-410033': [SKIP],
'regress/regress-crbug-412208': [SKIP],
'regress/regress-crbug-416558': [SKIP], 'regress/regress-crbug-416558': [SKIP],
'regress/regress-crbug-424142': [SKIP], 'regress/regress-crbug-424142': [SKIP],
'regress/regress-crbug-429159': [SKIP], 'regress/regress-crbug-429159': [SKIP],
...@@ -1037,12 +1029,9 @@ ...@@ -1037,12 +1029,9 @@
'regress/regress-crbug-485548-2': [SKIP], 'regress/regress-crbug-485548-2': [SKIP],
'regress/regress-crbug-487289': [SKIP], 'regress/regress-crbug-487289': [SKIP],
'regress/regress-crbug-489293': [SKIP], 'regress/regress-crbug-489293': [SKIP],
'regress/regress-crbug-489597': [SKIP],
'regress/regress-crbug-498022': [SKIP], 'regress/regress-crbug-498022': [SKIP],
'regress/regress-crbug-498142': [SKIP], 'regress/regress-crbug-498142': [SKIP],
'regress/regress-crbug-501809': [SKIP], 'regress/regress-crbug-501809': [SKIP],
'regress/regress-crbug-503968': [SKIP],
'regress/regress-crbug-504729': [SKIP],
'regress/regress-crbug-506443': [SKIP], 'regress/regress-crbug-506443': [SKIP],
'regress/regress-crbug-507070': [SKIP], 'regress/regress-crbug-507070': [SKIP],
'regress/regress-crbug-517592': [SKIP], 'regress/regress-crbug-517592': [SKIP],
......
...@@ -587,7 +587,6 @@ ...@@ -587,7 +587,6 @@
'language/expressions/object/method-definition/generator*': [SKIP], 'language/expressions/object/method-definition/generator*': [SKIP],
'language/expressions/object/prop-def-id-eval-error-2': [SKIP], 'language/expressions/object/prop-def-id-eval-error-2': [SKIP],
'language/expressions/yield/*': [SKIP], 'language/expressions/yield/*': [SKIP],
'language/function-code/*': [SKIP],
'language/statements/class/*': [SKIP], 'language/statements/class/*': [SKIP],
'language/statements/const/*': [SKIP], 'language/statements/const/*': [SKIP],
'language/statements/for-in/const*': [SKIP], 'language/statements/for-in/const*': [SKIP],
...@@ -605,9 +604,7 @@ ...@@ -605,9 +604,7 @@
'built-ins/Array/prototype/toString/S15.4.4.2_A1_T4': [SKIP], 'built-ins/Array/prototype/toString/S15.4.4.2_A1_T4': [SKIP],
'built-ins/Date/15.9.1.15-1': [SKIP], 'built-ins/Date/15.9.1.15-1': [SKIP],
'built-ins/Date/prototype/toISOString/15.9.5.43-0-13': [SKIP], 'built-ins/Date/prototype/toISOString/15.9.5.43-0-13': [SKIP],
'built-ins/eval/S15.1.2.1_A3.3_T4': [SKIP],
'built-ins/JSON/stringify/*': [SKIP], 'built-ins/JSON/stringify/*': [SKIP],
'built-ins/Object/defineProperty/15.2.3.6-4-625gs': [SKIP],
'built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A12': [SKIP], 'built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A12': [SKIP],
'built-ins/Object/prototype/isPrototypeOf/S15.2.4.6_A12': [SKIP], 'built-ins/Object/prototype/isPrototypeOf/S15.2.4.6_A12': [SKIP],
'built-ins/Object/prototype/propertyIsEnumerable/S15.2.4.7_A12': [SKIP], 'built-ins/Object/prototype/propertyIsEnumerable/S15.2.4.7_A12': [SKIP],
...@@ -651,13 +648,11 @@ ...@@ -651,13 +648,11 @@
'language/expressions/tagged-template/call-expression-context-no-strict': [SKIP], 'language/expressions/tagged-template/call-expression-context-no-strict': [SKIP],
'language/expressions/tagged-template/call-expression-context-strict': [SKIP], 'language/expressions/tagged-template/call-expression-context-strict': [SKIP],
'language/expressions/template-literal/evaluation-order': [SKIP], 'language/expressions/template-literal/evaluation-order': [SKIP],
'language/expressions/this/11.1.1-1gs': [SKIP],
'language/identifier-resolution/S10.2.2_A1_T5': [SKIP], 'language/identifier-resolution/S10.2.2_A1_T5': [SKIP],
'language/identifier-resolution/S10.2.2_A1_T6': [SKIP], 'language/identifier-resolution/S10.2.2_A1_T6': [SKIP],
'language/identifier-resolution/S10.2.2_A1_T7': [SKIP], 'language/identifier-resolution/S10.2.2_A1_T7': [SKIP],
'language/identifier-resolution/S10.2.2_A1_T8': [SKIP], 'language/identifier-resolution/S10.2.2_A1_T8': [SKIP],
'language/identifier-resolution/S10.2.2_A1_T9': [SKIP], 'language/identifier-resolution/S10.2.2_A1_T9': [SKIP],
'language/line-terminators/S7.3_A3.1_T1': [SKIP],
'language/object-literal/concise-generator': [SKIP], 'language/object-literal/concise-generator': [SKIP],
'language/object-literal/getter': [SKIP], 'language/object-literal/getter': [SKIP],
'language/object-literal/method': [SKIP], 'language/object-literal/method': [SKIP],
......
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