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

Unified Diff: src/interpreter/bytecode-array-builder.h

Issue 1410003003: [Interpreter] Add support for JS runtime calls. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_api_builtin
Patch Set: Fix unittests 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 side-by-side diff with in-line comments
Download patch
Index: src/interpreter/bytecode-array-builder.h
diff --git a/src/interpreter/bytecode-array-builder.h b/src/interpreter/bytecode-array-builder.h
index 02dae0757ab5db89b8e0b3fa071e3c9ea892ea44..19ef0389d58ab805d712724cfd03e0bc92810829 100644
--- a/src/interpreter/bytecode-array-builder.h
+++ b/src/interpreter/bytecode-array-builder.h
@@ -149,6 +149,12 @@ class BytecodeArrayBuilder {
BytecodeArrayBuilder& CallRuntime(Runtime::FunctionId function_id,
Register first_arg, size_t arg_count);
+ // Call the JS runtime function with |context_index|. The the receiver should
+ // be in |receiver| and all subsequent arguments should be in registers
+ // <receiver + 1> to <receiver + 1 + arg_count>.
+ BytecodeArrayBuilder& CallJSRuntime(int context_index, Register receiver,
+ size_t arg_count);
+
// Operators (register holds the lhs value, accumulator holds the rhs value).
BytecodeArrayBuilder& BinaryOperation(Token::Value binop, Register reg,
Strength strength);
@@ -225,12 +231,21 @@ class BytecodeArrayBuilder {
static Bytecode GetJumpWithConstantOperand(Bytecode jump_with_smi8_operand);
static Bytecode GetJumpWithToBoolean(Bytecode jump);
+ enum class RegisterValidityCheck { kCheckRegisters, kDontCheckRegisters };
+
template <size_t N>
- INLINE(void Output(Bytecode bytecode, uint32_t(&oprands)[N]));
+ INLINE(void Output(Bytecode bytecode, uint32_t(&oprands)[N],
+ RegisterValidityCheck reg_check =
+ RegisterValidityCheck::kCheckRegisters));
void Output(Bytecode bytecode, uint32_t operand0, uint32_t operand1,
- uint32_t operand2);
- void Output(Bytecode bytecode, uint32_t operand0, uint32_t operand1);
- void Output(Bytecode bytecode, uint32_t operand0);
+ uint32_t operand2, RegisterValidityCheck reg_check =
+ RegisterValidityCheck::kCheckRegisters);
+ void Output(
+ Bytecode bytecode, uint32_t operand0, uint32_t operand1,
+ RegisterValidityCheck reg_check = RegisterValidityCheck::kCheckRegisters);
+ void Output(
+ Bytecode bytecode, uint32_t operand0,
+ RegisterValidityCheck reg_check = RegisterValidityCheck::kCheckRegisters);
void Output(Bytecode bytecode);
BytecodeArrayBuilder& OutputJump(Bytecode jump_bytecode,
@@ -241,7 +256,8 @@ class BytecodeArrayBuilder {
void EnsureReturn();
bool OperandIsValid(Bytecode bytecode, int operand_index,
- uint32_t operand_value) const;
+ uint32_t operand_value,
+ RegisterValidityCheck reg_check) const;
bool LastBytecodeInSameBlock() const;
bool NeedToBooleanCast();

Powered by Google App Engine
This is Rietveld 408576698