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

Side by Side Diff: src/interpreter/bytecode-pipeline.cc

Issue 2111923002: [interpreter] Introduce binary op bytecodes for Smi operand. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 5 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/bytecode-pipeline.h ('k') | src/interpreter/bytecodes.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/bytecode-pipeline.h" 5 #include "src/interpreter/bytecode-pipeline.h"
6 6
7 #include <iomanip> 7 #include <iomanip>
8 #include "src/source-position-table.h" 8 #include "src/source-position-table.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 BytecodeNode::BytecodeNode(const BytecodeNode& other) { 53 BytecodeNode::BytecodeNode(const BytecodeNode& other) {
54 memcpy(this, &other, sizeof(other)); 54 memcpy(this, &other, sizeof(other));
55 } 55 }
56 56
57 BytecodeNode& BytecodeNode::operator=(const BytecodeNode& other) { 57 BytecodeNode& BytecodeNode::operator=(const BytecodeNode& other) {
58 memcpy(this, &other, sizeof(other)); 58 memcpy(this, &other, sizeof(other));
59 return *this; 59 return *this;
60 } 60 }
61 61
62 void BytecodeNode::set_bytecode(Bytecode bytecode) {
63 DCHECK_EQ(Bytecodes::NumberOfOperands(bytecode), 0);
64 bytecode_ = bytecode;
65 }
66
67 void BytecodeNode::set_bytecode(Bytecode bytecode, uint32_t operand0) {
68 DCHECK_EQ(Bytecodes::NumberOfOperands(bytecode), 1);
69 bytecode_ = bytecode;
70 operands_[0] = operand0;
71 }
72
73 void BytecodeNode::Clone(const BytecodeNode* const other) { 62 void BytecodeNode::Clone(const BytecodeNode* const other) {
74 memcpy(this, other, sizeof(*other)); 63 memcpy(this, other, sizeof(*other));
75 } 64 }
76 65
77 void BytecodeNode::Print(std::ostream& os) const { 66 void BytecodeNode::Print(std::ostream& os) const {
78 #ifdef DEBUG 67 #ifdef DEBUG
79 std::ios saved_state(nullptr); 68 std::ios saved_state(nullptr);
80 saved_state.copyfmt(os); 69 saved_state.copyfmt(os);
81 os << Bytecodes::ToString(bytecode_); 70 os << Bytecodes::ToString(bytecode_);
82 71
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 } 125 }
137 126
138 std::ostream& operator<<(std::ostream& os, const BytecodeNode& node) { 127 std::ostream& operator<<(std::ostream& os, const BytecodeNode& node) {
139 node.Print(os); 128 node.Print(os);
140 return os; 129 return os;
141 } 130 }
142 131
143 } // namespace interpreter 132 } // namespace interpreter
144 } // namespace internal 133 } // namespace internal
145 } // namespace v8 134 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-pipeline.h ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698