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

Side by Side Diff: src/interpreter/bytecodes.cc

Issue 1830593002: [Interpreter] Move BytecodeHasHandler() from Interpreter to Bytecodes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@fix-codelog
Patch Set: Expand function doc. 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 | « src/interpreter/bytecodes.h ('k') | src/interpreter/interpreter.h » ('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/bytecodes.h" 5 #include "src/interpreter/bytecodes.h"
6 6
7 #include <iomanip> 7 #include <iomanip>
8 8
9 #include "src/frames.h" 9 #include "src/frames.h"
10 #include "src/interpreter/bytecode-traits.h" 10 #include "src/interpreter/bytecode-traits.h"
11 #include "src/interpreter/interpreter.h"
11 12
12 namespace v8 { 13 namespace v8 {
13 namespace internal { 14 namespace internal {
14 namespace interpreter { 15 namespace interpreter {
15 16
16 17
17 // static 18 // static
18 const char* Bytecodes::ToString(Bytecode bytecode) { 19 const char* Bytecodes::ToString(Bytecode bytecode) {
19 switch (bytecode) { 20 switch (bytecode) {
20 #define CASE(Name, ...) \ 21 #define CASE(Name, ...) \
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 UNREACHABLE(); 568 UNREACHABLE();
568 break; 569 break;
569 } 570 }
570 if (i != number_of_operands - 1) { 571 if (i != number_of_operands - 1) {
571 os << ", "; 572 os << ", ";
572 } 573 }
573 } 574 }
574 return os; 575 return os;
575 } 576 }
576 577
578 // static
579 bool Bytecodes::BytecodeHasHandler(Bytecode bytecode,
580 OperandScale operand_scale) {
581 return operand_scale == OperandScale::kSingle ||
582 Bytecodes::IsBytecodeWithScalableOperands(bytecode);
583 }
584
577 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode) { 585 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode) {
578 return os << Bytecodes::ToString(bytecode); 586 return os << Bytecodes::ToString(bytecode);
579 } 587 }
580 588
581 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_size) { 589 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_size) {
582 return os << Bytecodes::OperandSizeToString(operand_size); 590 return os << Bytecodes::OperandSizeToString(operand_size);
583 } 591 }
584 592
585 std::ostream& operator<<(std::ostream& os, const OperandScale& operand_scale) { 593 std::ostream& operator<<(std::ostream& os, const OperandScale& operand_scale) {
586 return os << Bytecodes::OperandScaleToString(operand_scale); 594 return os << Bytecodes::OperandScaleToString(operand_scale);
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 } else { 693 } else {
686 std::ostringstream s; 694 std::ostringstream s;
687 s << "r" << index(); 695 s << "r" << index();
688 return s.str(); 696 return s.str();
689 } 697 }
690 } 698 }
691 699
692 } // namespace interpreter 700 } // namespace interpreter
693 } // namespace internal 701 } // namespace internal
694 } // namespace v8 702 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | src/interpreter/interpreter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698