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

Side by Side Diff: src/compiler/interpreter-assembler.cc

Issue 1634153002: [Interpreter] Adds support for const/let variables to interpreter. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed rebase errors. Created 4 years, 10 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
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/compiler/interpreter-assembler.h" 5 #include "src/compiler/interpreter-assembler.h"
6 6
7 #include <ostream> 7 #include <ostream>
8 8
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/compiler/graph.h" 10 #include "src/compiler/graph.h"
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 return IntPtrAdd(BytecodeOffset(), Int32Constant(delta)); 649 return IntPtrAdd(BytecodeOffset(), Int32Constant(delta));
650 } 650 }
651 651
652 652
653 Node* InterpreterAssembler::Advance(Node* delta) { 653 Node* InterpreterAssembler::Advance(Node* delta) {
654 return raw_assembler_->IntPtrAdd(BytecodeOffset(), delta); 654 return raw_assembler_->IntPtrAdd(BytecodeOffset(), delta);
655 } 655 }
656 656
657 void InterpreterAssembler::Jump(Node* delta) { DispatchTo(Advance(delta)); } 657 void InterpreterAssembler::Jump(Node* delta) { DispatchTo(Advance(delta)); }
658 658
659 void InterpreterAssembler::JumpIfWordEqual(Node* lhs, Node* rhs, Node* delta) { 659 void InterpreterAssembler::JumpConditional(Node* condition, Node* delta) {
660 RawMachineLabel match, no_match; 660 RawMachineLabel match, no_match;
661 Node* condition = raw_assembler_->WordEqual(lhs, rhs);
662 raw_assembler_->Branch(condition, &match, &no_match); 661 raw_assembler_->Branch(condition, &match, &no_match);
663 raw_assembler_->Bind(&match); 662 raw_assembler_->Bind(&match);
664 DispatchTo(Advance(delta)); 663 DispatchTo(Advance(delta));
665 raw_assembler_->Bind(&no_match); 664 raw_assembler_->Bind(&no_match);
666 Dispatch(); 665 Dispatch();
667 } 666 }
668 667
668 void InterpreterAssembler::JumpIfWordEqual(Node* lhs, Node* rhs, Node* delta) {
669 JumpConditional(raw_assembler_->WordEqual(lhs, rhs), delta);
670 }
671
672 void InterpreterAssembler::JumpIfWordNotEqual(Node* lhs, Node* rhs,
673 Node* delta) {
674 JumpConditional(raw_assembler_->WordNotEqual(lhs, rhs), delta);
675 }
669 676
670 void InterpreterAssembler::Dispatch() { 677 void InterpreterAssembler::Dispatch() {
671 DispatchTo(Advance(interpreter::Bytecodes::Size(bytecode_))); 678 DispatchTo(Advance(interpreter::Bytecodes::Size(bytecode_)));
672 } 679 }
673 680
674 681
675 void InterpreterAssembler::DispatchTo(Node* new_bytecode_offset) { 682 void InterpreterAssembler::DispatchTo(Node* new_bytecode_offset) {
676 if (FLAG_trace_ignition) { 683 if (FLAG_trace_ignition) {
677 TraceBytecode(Runtime::kInterpreterTraceBytecodeExit); 684 TraceBytecode(Runtime::kInterpreterTraceBytecodeExit);
678 } 685 }
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 return raw_assembler_->call_descriptor(); 758 return raw_assembler_->call_descriptor();
752 } 759 }
753 760
754 761
755 Zone* InterpreterAssembler::zone() { return raw_assembler_->zone(); } 762 Zone* InterpreterAssembler::zone() { return raw_assembler_->zone(); }
756 763
757 764
758 } // namespace compiler 765 } // namespace compiler
759 } // namespace internal 766 } // namespace internal
760 } // namespace v8 767 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698