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

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

Issue 1546683002: [Interpreter] Add support for jumps using constants with wide operands. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Incorporate comments on patchset 13. Created 4 years, 11 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-array-iterator.cc ('k') | src/interpreter/bytecodes.cc » ('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 #ifndef V8_INTERPRETER_BYTECODES_H_ 5 #ifndef V8_INTERPRETER_BYTECODES_H_
6 #define V8_INTERPRETER_BYTECODES_H_ 6 #define V8_INTERPRETER_BYTECODES_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 9
10 // Clients of this interface shouldn't depend on lots of interpreter internals. 10 // Clients of this interface shouldn't depend on lots of interpreter internals.
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 V(CreateClosure, OperandType::kIdx8, OperandType::kImm8) \ 182 V(CreateClosure, OperandType::kIdx8, OperandType::kImm8) \
183 V(CreateClosureWide, OperandType::kIdx16, OperandType::kImm8) \ 183 V(CreateClosureWide, OperandType::kIdx16, OperandType::kImm8) \
184 \ 184 \
185 /* Arguments allocation */ \ 185 /* Arguments allocation */ \
186 V(CreateMappedArguments, OperandType::kNone) \ 186 V(CreateMappedArguments, OperandType::kNone) \
187 V(CreateUnmappedArguments, OperandType::kNone) \ 187 V(CreateUnmappedArguments, OperandType::kNone) \
188 \ 188 \
189 /* Control Flow */ \ 189 /* Control Flow */ \
190 V(Jump, OperandType::kImm8) \ 190 V(Jump, OperandType::kImm8) \
191 V(JumpConstant, OperandType::kIdx8) \ 191 V(JumpConstant, OperandType::kIdx8) \
192 V(JumpConstantWide, OperandType::kIdx16) \
192 V(JumpIfTrue, OperandType::kImm8) \ 193 V(JumpIfTrue, OperandType::kImm8) \
193 V(JumpIfTrueConstant, OperandType::kIdx8) \ 194 V(JumpIfTrueConstant, OperandType::kIdx8) \
195 V(JumpIfTrueConstantWide, OperandType::kIdx16) \
194 V(JumpIfFalse, OperandType::kImm8) \ 196 V(JumpIfFalse, OperandType::kImm8) \
195 V(JumpIfFalseConstant, OperandType::kIdx8) \ 197 V(JumpIfFalseConstant, OperandType::kIdx8) \
198 V(JumpIfFalseConstantWide, OperandType::kIdx16) \
196 V(JumpIfToBooleanTrue, OperandType::kImm8) \ 199 V(JumpIfToBooleanTrue, OperandType::kImm8) \
197 V(JumpIfToBooleanTrueConstant, OperandType::kIdx8) \ 200 V(JumpIfToBooleanTrueConstant, OperandType::kIdx8) \
201 V(JumpIfToBooleanTrueConstantWide, OperandType::kIdx16) \
198 V(JumpIfToBooleanFalse, OperandType::kImm8) \ 202 V(JumpIfToBooleanFalse, OperandType::kImm8) \
199 V(JumpIfToBooleanFalseConstant, OperandType::kIdx8) \ 203 V(JumpIfToBooleanFalseConstant, OperandType::kIdx8) \
204 V(JumpIfToBooleanFalseConstantWide, OperandType::kIdx16) \
200 V(JumpIfNull, OperandType::kImm8) \ 205 V(JumpIfNull, OperandType::kImm8) \
201 V(JumpIfNullConstant, OperandType::kIdx8) \ 206 V(JumpIfNullConstant, OperandType::kIdx8) \
207 V(JumpIfNullConstantWide, OperandType::kIdx16) \
202 V(JumpIfUndefined, OperandType::kImm8) \ 208 V(JumpIfUndefined, OperandType::kImm8) \
203 V(JumpIfUndefinedConstant, OperandType::kIdx8) \ 209 V(JumpIfUndefinedConstant, OperandType::kIdx8) \
210 V(JumpIfUndefinedConstantWide, OperandType::kIdx16) \
204 \ 211 \
205 /* Complex flow control For..in */ \ 212 /* Complex flow control For..in */ \
206 V(ForInPrepare, OperandType::kReg8, OperandType::kReg8, OperandType::kReg8) \ 213 V(ForInPrepare, OperandType::kReg8, OperandType::kReg8, OperandType::kReg8) \
207 V(ForInDone, OperandType::kReg8, OperandType::kReg8) \ 214 V(ForInDone, OperandType::kReg8, OperandType::kReg8) \
208 V(ForInNext, OperandType::kReg8, OperandType::kReg8, OperandType::kReg8, \ 215 V(ForInNext, OperandType::kReg8, OperandType::kReg8, OperandType::kReg8, \
209 OperandType::kReg8) \ 216 OperandType::kReg8) \
210 V(ForInStep, OperandType::kReg8) \ 217 V(ForInStep, OperandType::kReg8) \
211 \ 218 \
212 /* Non-local flow control */ \ 219 /* Non-local flow control */ \
213 V(Throw, OperandType::kNone) \ 220 V(Throw, OperandType::kNone) \
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 static int Size(Bytecode bytecode); 354 static int Size(Bytecode bytecode);
348 355
349 // Returns the size of |operand|. 356 // Returns the size of |operand|.
350 static OperandSize SizeOfOperand(OperandType operand); 357 static OperandSize SizeOfOperand(OperandType operand);
351 358
352 // Return true if the bytecode is a conditional jump taking 359 // Return true if the bytecode is a conditional jump taking
353 // an immediate byte operand (OperandType::kImm8). 360 // an immediate byte operand (OperandType::kImm8).
354 static bool IsConditionalJumpImmediate(Bytecode bytecode); 361 static bool IsConditionalJumpImmediate(Bytecode bytecode);
355 362
356 // Return true if the bytecode is a conditional jump taking 363 // Return true if the bytecode is a conditional jump taking
357 // a constant pool entry (OperandType::kIdx). 364 // a constant pool entry (OperandType::kIdx8).
358 static bool IsConditionalJumpConstant(Bytecode bytecode); 365 static bool IsConditionalJumpConstant(Bytecode bytecode);
359 366
360 // Return true if the bytecode is a conditional jump taking 367 // Return true if the bytecode is a conditional jump taking
368 // a constant pool entry (OperandType::kIdx16).
369 static bool IsConditionalJumpConstantWide(Bytecode bytecode);
370
371 // Return true if the bytecode is a conditional jump taking
361 // any kind of operand. 372 // any kind of operand.
362 static bool IsConditionalJump(Bytecode bytecode); 373 static bool IsConditionalJump(Bytecode bytecode);
363 374
364 // Return true if the bytecode is a jump or a conditional jump taking 375 // Return true if the bytecode is a jump or a conditional jump taking
365 // an immediate byte operand (OperandType::kImm8). 376 // an immediate byte operand (OperandType::kImm8).
366 static bool IsJumpImmediate(Bytecode bytecode); 377 static bool IsJumpImmediate(Bytecode bytecode);
367 378
368 // Return true if the bytecode is a jump or conditional jump taking a 379 // Return true if the bytecode is a jump or conditional jump taking a
369 // constant pool entry (OperandType::kIdx). 380 // constant pool entry (OperandType::kIdx8).
370 static bool IsJumpConstant(Bytecode bytecode); 381 static bool IsJumpConstant(Bytecode bytecode);
371 382
383 // Return true if the bytecode is a jump or conditional jump taking a
384 // constant pool entry (OperandType::kIdx16).
385 static bool IsJumpConstantWide(Bytecode bytecode);
386
372 // Return true if the bytecode is a jump or conditional jump taking 387 // Return true if the bytecode is a jump or conditional jump taking
373 // any kind of operand. 388 // any kind of operand.
374 static bool IsJump(Bytecode bytecode); 389 static bool IsJump(Bytecode bytecode);
375 390
376 // Return true if the bytecode is a conditional jump, a jump, or a return. 391 // Return true if the bytecode is a conditional jump, a jump, or a return.
377 static bool IsJumpOrReturn(Bytecode bytecode); 392 static bool IsJumpOrReturn(Bytecode bytecode);
378 393
379 // Decode a single bytecode and operands to |os|. 394 // Decode a single bytecode and operands to |os|.
380 static std::ostream& Decode(std::ostream& os, const uint8_t* bytecode_start, 395 static std::ostream& Decode(std::ostream& os, const uint8_t* bytecode_start,
381 int number_of_parameters); 396 int number_of_parameters);
382 397
383 private: 398 private:
384 DISALLOW_IMPLICIT_CONSTRUCTORS(Bytecodes); 399 DISALLOW_IMPLICIT_CONSTRUCTORS(Bytecodes);
385 }; 400 };
386 401
387 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); 402 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode);
388 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); 403 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type);
389 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_type); 404 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_type);
390 405
391 } // namespace interpreter 406 } // namespace interpreter
392 } // namespace internal 407 } // namespace internal
393 } // namespace v8 408 } // namespace v8
394 409
395 #endif // V8_INTERPRETER_BYTECODES_H_ 410 #endif // V8_INTERPRETER_BYTECODES_H_
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-array-iterator.cc ('k') | src/interpreter/bytecodes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698