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

Side by Side Diff: src/interpreter/bytecode-generator.cc

Issue 1523423003: [Interpreter] Marks that 'throw' has returned a value. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/interpreter/bytecode-generator.h" 5 #include "src/interpreter/bytecode-generator.h"
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/compiler.h" 8 #include "src/compiler.h"
9 #include "src/interpreter/control-flow-builders.h" 9 #include "src/interpreter/control-flow-builders.h"
10 #include "src/objects.h" 10 #include "src/objects.h"
(...skipping 1521 matching lines...) Expand 10 before | Expand all | Expand 10 after
1532 execution_result()->SetResultInAccumulator(); 1532 execution_result()->SetResultInAccumulator();
1533 } 1533 }
1534 1534
1535 1535
1536 void BytecodeGenerator::VisitYield(Yield* expr) { UNIMPLEMENTED(); } 1536 void BytecodeGenerator::VisitYield(Yield* expr) { UNIMPLEMENTED(); }
1537 1537
1538 1538
1539 void BytecodeGenerator::VisitThrow(Throw* expr) { 1539 void BytecodeGenerator::VisitThrow(Throw* expr) {
1540 VisitForAccumulatorValue(expr->exception()); 1540 VisitForAccumulatorValue(expr->exception());
1541 builder()->Throw(); 1541 builder()->Throw();
1542 // For script and eval scopes expression statements are converted to
1543 // assignment statements in Rewriter::ReWrite pass. An assignment statement
1544 // expects a value in the accumulator. This is a hack to avoid DCHECK fails
1545 // assert accumulator has been set.
1546 if (info()->literal()->scope()->is_script_scope() ||
Michael Starzinger 2016/01/18 21:23:03 I wouldn't even narrow this to script or eval scop
mythria 2016/01/19 10:48:04 Done.
1547 info()->literal()->scope()->is_eval_scope()) {
1548 execution_result()->SetResultInAccumulator();
1549 }
1542 } 1550 }
1543 1551
1544 1552
1545 void BytecodeGenerator::VisitPropertyLoad(Register obj, Property* expr) { 1553 void BytecodeGenerator::VisitPropertyLoad(Register obj, Property* expr) {
1546 LhsKind property_kind = Property::GetAssignType(expr); 1554 LhsKind property_kind = Property::GetAssignType(expr);
1547 FeedbackVectorSlot slot = expr->PropertyFeedbackSlot(); 1555 FeedbackVectorSlot slot = expr->PropertyFeedbackSlot();
1548 switch (property_kind) { 1556 switch (property_kind) {
1549 case VARIABLE: 1557 case VARIABLE:
1550 UNREACHABLE(); 1558 UNREACHABLE();
1551 case NAMED_PROPERTY: { 1559 case NAMED_PROPERTY: {
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
2237 } 2245 }
2238 2246
2239 2247
2240 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { 2248 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const {
2241 return info()->feedback_vector()->GetIndex(slot); 2249 return info()->feedback_vector()->GetIndex(slot);
2242 } 2250 }
2243 2251
2244 } // namespace interpreter 2252 } // namespace interpreter
2245 } // namespace internal 2253 } // namespace internal
2246 } // namespace v8 2254 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698