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

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

Issue 1386133002: [Interpreter] Add bitwise operators (Or, Xor, And) to interpreter (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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/interpreter/bytecode-array-builder.h" 5 #include "src/interpreter/bytecode-array-builder.h"
6 6
7 namespace v8 { 7 namespace v8 {
8 namespace internal { 8 namespace internal {
9 namespace interpreter { 9 namespace interpreter {
10 10
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 552
553 bool BytecodeArrayBuilder::LastBytecodeInSameBlock() const { 553 bool BytecodeArrayBuilder::LastBytecodeInSameBlock() const {
554 return last_bytecode_start_ < bytecodes()->size() && 554 return last_bytecode_start_ < bytecodes()->size() &&
555 last_bytecode_start_ >= last_block_end_; 555 last_bytecode_start_ >= last_block_end_;
556 } 556 }
557 557
558 558
559 // static 559 // static
560 Bytecode BytecodeArrayBuilder::BytecodeForBinaryOperation(Token::Value op) { 560 Bytecode BytecodeArrayBuilder::BytecodeForBinaryOperation(Token::Value op) {
561 switch (op) { 561 switch (op) {
562 case Token::Value::BIT_OR:
563 return Bytecode::kBitwiseOr;
564 case Token::Value::BIT_XOR:
565 return Bytecode::kBitwiseXor;
566 case Token::Value::BIT_AND:
567 return Bytecode::kBitwiseAnd;
562 case Token::Value::ADD: 568 case Token::Value::ADD:
563 return Bytecode::kAdd; 569 return Bytecode::kAdd;
564 case Token::Value::SUB: 570 case Token::Value::SUB:
565 return Bytecode::kSub; 571 return Bytecode::kSub;
566 case Token::Value::MUL: 572 case Token::Value::MUL:
567 return Bytecode::kMul; 573 return Bytecode::kMul;
568 case Token::Value::DIV: 574 case Token::Value::DIV:
569 return Bytecode::kDiv; 575 return Bytecode::kDiv;
570 case Token::Value::MOD: 576 case Token::Value::MOD:
571 return Bytecode::kMod; 577 return Bytecode::kMod;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 649
644 Register TemporaryRegisterScope::NewRegister() { 650 Register TemporaryRegisterScope::NewRegister() {
645 count_++; 651 count_++;
646 last_register_index_ = builder_->BorrowTemporaryRegister(); 652 last_register_index_ = builder_->BorrowTemporaryRegister();
647 return Register(last_register_index_); 653 return Register(last_register_index_);
648 } 654 }
649 655
650 } // namespace interpreter 656 } // namespace interpreter
651 } // namespace internal 657 } // namespace internal
652 } // namespace v8 658 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698