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

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

Issue 1362383002: [Interpreter] Add CallRuntime support to the interpreter. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Move function address calculation into bytecode handler and have an option on CEntry stub for argv_… Created 5 years, 3 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.cc
diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc
index b4615a557f61335e9ffd8119c584b3bc9bbcf978..78b5e1e76927762f6309150af6886b866669bf1b 100644
--- a/src/interpreter/bytecode-array-builder.cc
+++ b/src/interpreter/bytecode-array-builder.cc
@@ -474,6 +474,16 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::Call(Register callable,
}
+BytecodeArrayBuilder& BytecodeArrayBuilder::CallRuntime(
+ Runtime::FunctionId function_id, Register first_arg, size_t arg_count) {
+ DCHECK(FitsInWideIdxOperand(function_id));
+ DCHECK(FitsInIdxOperand(arg_count));
+ Output(Bytecode::kCallRuntime, static_cast<uint16_t>(function_id),
+ first_arg.ToOperand(), static_cast<uint8_t>(arg_count));
+ return *this;
+}
+
+
size_t BytecodeArrayBuilder::GetConstantPoolEntry(Handle<Object> object) {
// These constants shouldn't be added to the constant pool, the should use
// specialzed bytecodes instead.
@@ -611,6 +621,12 @@ bool BytecodeArrayBuilder::FitsInImm8Operand(int value) {
}
+// static
+bool BytecodeArrayBuilder::FitsInWideIdxOperand(int value) {
+ return kMinUInt16 <= value && value <= kMaxUInt16;
+}
+
+
TemporaryRegisterScope::TemporaryRegisterScope(BytecodeArrayBuilder* builder)
: builder_(builder), count_(0), last_register_index_(-1) {}

Powered by Google App Engine
This is Rietveld 408576698