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

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

Issue 1399773002: [Interpreter] Adds logical and, logical or and comma operators to interpreter (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Added a new bytecode to jump by casting the value to boolean. This reduces code size for logical op… 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/bytecodes.h" 5 #include "src/interpreter/bytecodes.h"
6 6
7 #include "src/frames.h" 7 #include "src/frames.h"
8 #include "src/interpreter/bytecode-traits.h" 8 #include "src/interpreter/bytecode-traits.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 #undef CASE 154 #undef CASE
155 } 155 }
156 UNREACHABLE(); 156 UNREACHABLE();
157 return OperandSize::kNone; 157 return OperandSize::kNone;
158 } 158 }
159 159
160 160
161 // static 161 // static
162 bool Bytecodes::IsJump(Bytecode bytecode) { 162 bool Bytecodes::IsJump(Bytecode bytecode) {
163 return bytecode == Bytecode::kJump || bytecode == Bytecode::kJumpIfTrue || 163 return bytecode == Bytecode::kJump || bytecode == Bytecode::kJumpIfTrue ||
164 bytecode == Bytecode::kJumpIfFalse; 164 bytecode == Bytecode::kJumpIfFalse ||
165 bytecode == Bytecode::kJumpIfToBooleanTrue ||
166 bytecode == Bytecode::kJumpIfToBooleanFalse;
165 } 167 }
166 168
167 169
168 // static 170 // static
169 bool Bytecodes::IsJumpConstant(Bytecode bytecode) { 171 bool Bytecodes::IsJumpConstant(Bytecode bytecode) {
170 return bytecode == Bytecode::kJumpConstant || 172 return bytecode == Bytecode::kJumpConstant ||
171 bytecode == Bytecode::kJumpIfTrueConstant || 173 bytecode == Bytecode::kJumpIfTrueConstant ||
172 bytecode == Bytecode::kJumpIfFalseConstant; 174 bytecode == Bytecode::kJumpIfFalseConstant;
rmcilroy 2015/10/13 15:43:24 Add constant jumps here too
mythria 2015/10/14 13:33:42 Done.
173 } 175 }
174 176
175 177
176 // static 178 // static
177 uint16_t Bytecodes::ShortOperandFromBytes(const uint8_t* bytes) { 179 uint16_t Bytecodes::ShortOperandFromBytes(const uint8_t* bytes) {
178 return *reinterpret_cast<const uint16_t*>(bytes); 180 return *reinterpret_cast<const uint16_t*>(bytes);
179 } 181 }
180 182
181 183
182 // static 184 // static
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 uint8_t Register::ToOperand() const { return static_cast<uint8_t>(-index_); } 327 uint8_t Register::ToOperand() const { return static_cast<uint8_t>(-index_); }
326 328
327 329
328 Register Register::FromOperand(uint8_t operand) { 330 Register Register::FromOperand(uint8_t operand) {
329 return Register(-static_cast<int8_t>(operand)); 331 return Register(-static_cast<int8_t>(operand));
330 } 332 }
331 333
332 } // namespace interpreter 334 } // namespace interpreter
333 } // namespace internal 335 } // namespace internal
334 } // namespace v8 336 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698