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

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: Fixes nits and updates mjsunit.status and test262.status Created 4 years, 11 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 | test/mjsunit/mjsunit.status » ('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 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/bytecode-register-allocator.h" 9 #include "src/interpreter/bytecode-register-allocator.h"
10 #include "src/interpreter/control-flow-builders.h" 10 #include "src/interpreter/control-flow-builders.h"
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 // Build assignment to {new.target} variable if it is used. 402 // Build assignment to {new.target} variable if it is used.
403 VisitNewTargetVariable(scope()->new_target_var()); 403 VisitNewTargetVariable(scope()->new_target_var());
404 404
405 // TODO(rmcilroy): Emit tracing call if requested to do so. 405 // TODO(rmcilroy): Emit tracing call if requested to do so.
406 if (FLAG_trace) { 406 if (FLAG_trace) {
407 UNIMPLEMENTED(); 407 UNIMPLEMENTED();
408 } 408 }
409 409
410 // Visit illegal re-declaration and bail out if it exists. 410 // Visit illegal re-declaration and bail out if it exists.
411 if (scope()->HasIllegalRedeclaration()) { 411 if (scope()->HasIllegalRedeclaration()) {
412 Visit(scope()->GetIllegalRedeclaration()); 412 VisitForEffect(scope()->GetIllegalRedeclaration());
413 return; 413 return;
414 } 414 }
415 415
416 // Visit declarations within the function scope. 416 // Visit declarations within the function scope.
417 VisitDeclarations(scope()->declarations()); 417 VisitDeclarations(scope()->declarations());
418 418
419 // Visit statements in the function body. 419 // Visit statements in the function body.
420 VisitStatements(info()->literal()->body()); 420 VisitStatements(info()->literal()->body());
421 } 421 }
422 422
(...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after
1514 execution_result()->SetResultInAccumulator(); 1514 execution_result()->SetResultInAccumulator();
1515 } 1515 }
1516 1516
1517 1517
1518 void BytecodeGenerator::VisitYield(Yield* expr) { UNIMPLEMENTED(); } 1518 void BytecodeGenerator::VisitYield(Yield* expr) { UNIMPLEMENTED(); }
1519 1519
1520 1520
1521 void BytecodeGenerator::VisitThrow(Throw* expr) { 1521 void BytecodeGenerator::VisitThrow(Throw* expr) {
1522 VisitForAccumulatorValue(expr->exception()); 1522 VisitForAccumulatorValue(expr->exception());
1523 builder()->Throw(); 1523 builder()->Throw();
1524 // Throw statments are modeled as expression instead of statments. These are
1525 // converted from assignment statements in Rewriter::ReWrite pass. An
1526 // assignment statement expects a value in the accumulator. This is a hack to
1527 // avoid DCHECK fails assert accumulator has been set.
1528 execution_result()->SetResultInAccumulator();
1524 } 1529 }
1525 1530
1526 1531
1527 void BytecodeGenerator::VisitPropertyLoad(Register obj, Property* expr) { 1532 void BytecodeGenerator::VisitPropertyLoad(Register obj, Property* expr) {
1528 LhsKind property_kind = Property::GetAssignType(expr); 1533 LhsKind property_kind = Property::GetAssignType(expr);
1529 FeedbackVectorSlot slot = expr->PropertyFeedbackSlot(); 1534 FeedbackVectorSlot slot = expr->PropertyFeedbackSlot();
1530 switch (property_kind) { 1535 switch (property_kind) {
1531 case VARIABLE: 1536 case VARIABLE:
1532 UNREACHABLE(); 1537 UNREACHABLE();
1533 case NAMED_PROPERTY: { 1538 case NAMED_PROPERTY: {
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
2257 } 2262 }
2258 2263
2259 2264
2260 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { 2265 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const {
2261 return info()->feedback_vector()->GetIndex(slot); 2266 return info()->feedback_vector()->GetIndex(slot);
2262 } 2267 }
2263 2268
2264 } // namespace interpreter 2269 } // namespace interpreter
2265 } // namespace internal 2270 } // namespace internal
2266 } // namespace v8 2271 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698