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

Side by Side Diff: src/interpreter/bytecode-array-builder.cc

Issue 1804643002: [interpreter] Fix label binding for unreached labels. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_interpreter-test-webkit
Patch Set: Created 4 years, 9 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/webkit/webkit.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-array-builder.h" 5 #include "src/interpreter/bytecode-array-builder.h"
6 #include "src/compiler.h" 6 #include "src/compiler.h"
7 7
8 namespace v8 { 8 namespace v8 {
9 namespace internal { 9 namespace internal {
10 namespace interpreter { 10 namespace interpreter {
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 label->bind_to(bytecodes()->size()); 713 label->bind_to(bytecodes()->size());
714 LeaveBasicBlock(); 714 LeaveBasicBlock();
715 return *this; 715 return *this;
716 } 716 }
717 717
718 718
719 BytecodeArrayBuilder& BytecodeArrayBuilder::Bind(const BytecodeLabel& target, 719 BytecodeArrayBuilder& BytecodeArrayBuilder::Bind(const BytecodeLabel& target,
720 BytecodeLabel* label) { 720 BytecodeLabel* label) {
721 DCHECK(!label->is_bound()); 721 DCHECK(!label->is_bound());
722 DCHECK(target.is_bound()); 722 DCHECK(target.is_bound());
723 PatchJump(bytecodes()->begin() + target.offset(), 723 if (label->is_forward_target()) {
724 bytecodes()->begin() + label->offset()); 724 // An earlier jump instruction refers to this label. Update it's location.
725 PatchJump(bytecodes()->begin() + target.offset(),
726 bytecodes()->begin() + label->offset());
727 // Now treat as if the label will only be back referred to.
728 }
725 label->bind_to(target.offset()); 729 label->bind_to(target.offset());
726 LeaveBasicBlock(); 730 LeaveBasicBlock();
727 return *this; 731 return *this;
728 } 732 }
729 733
730 734
731 // static 735 // static
732 Bytecode BytecodeArrayBuilder::GetJumpWithConstantOperand( 736 Bytecode BytecodeArrayBuilder::GetJumpWithConstantOperand(
733 Bytecode jump_bytecode) { 737 Bytecode jump_bytecode) {
734 switch (jump_bytecode) { 738 switch (jump_bytecode) {
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after
1634 } 1638 }
1635 1639
1636 // static 1640 // static
1637 bool BytecodeArrayBuilder::FitsInReg16OperandUntranslated(Register value) { 1641 bool BytecodeArrayBuilder::FitsInReg16OperandUntranslated(Register value) {
1638 return value.is_short_operand(); 1642 return value.is_short_operand();
1639 } 1643 }
1640 1644
1641 } // namespace interpreter 1645 } // namespace interpreter
1642 } // namespace internal 1646 } // namespace internal
1643 } // namespace v8 1647 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/webkit/webkit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698