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

Unified Diff: src/compiler/interpreter-assembler.cc

Issue 1254293006: [interpreter] Change interpreter to use an BytecodeArray pointer and and offset. (Closed) Base URL: ssh://rmcilroy.lon.corp.google.com///usr/local/google/code/v8_full/v8@master
Patch Set: Fix MIPS merge error Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/interpreter-assembler.h ('k') | src/compiler/linkage.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/interpreter-assembler.cc
diff --git a/src/compiler/interpreter-assembler.cc b/src/compiler/interpreter-assembler.cc
index 691fa61db576a0b7030373df7e51da2b405b6ce9..93d857c0e404560adb34ae364bcf1fb7a38d8cf0 100644
--- a/src/compiler/interpreter-assembler.cc
+++ b/src/compiler/interpreter-assembler.cc
@@ -60,8 +60,14 @@ Handle<Code> InterpreterAssembler::GenerateCode() {
}
-Node* InterpreterAssembler::BytecodePointer() {
- return raw_assembler_->Parameter(Linkage::kInterpreterBytecodeParameter);
+Node* InterpreterAssembler::BytecodeArrayPointer() {
+ return raw_assembler_->Parameter(Linkage::kInterpreterBytecodeArrayParameter);
+}
+
+
+Node* InterpreterAssembler::BytecodeOffset() {
+ return raw_assembler_->Parameter(
+ Linkage::kInterpreterBytecodeOffsetParameter);
}
@@ -91,8 +97,9 @@ Node* InterpreterAssembler::RegisterFrameOffset(Node* index) {
Node* InterpreterAssembler::BytecodeArg(int delta) {
DCHECK_LT(delta, interpreter::Bytecodes::NumberOfArguments(bytecode_));
- return raw_assembler_->Load(kMachUint8, BytecodePointer(),
- Int32Constant(1 + delta));
+ return raw_assembler_->Load(
+ kMachUint8, BytecodeArrayPointer(),
+ raw_assembler_->IntPtrAdd(BytecodeOffset(), Int32Constant(1 + delta)));
}
@@ -121,14 +128,14 @@ Node* InterpreterAssembler::StoreRegister(Node* value, Node* index) {
Node* InterpreterAssembler::Advance(int delta) {
- return raw_assembler_->IntPtrAdd(BytecodePointer(), Int32Constant(delta));
+ return raw_assembler_->IntPtrAdd(BytecodeOffset(), Int32Constant(delta));
}
void InterpreterAssembler::Dispatch() {
- Node* new_bytecode_pointer = Advance(interpreter::Bytecodes::Size(bytecode_));
- Node* target_bytecode =
- raw_assembler_->Load(kMachUint8, new_bytecode_pointer);
+ Node* new_bytecode_offset = Advance(interpreter::Bytecodes::Size(bytecode_));
+ Node* target_bytecode = raw_assembler_->Load(
+ kMachUint8, BytecodeArrayPointer(), new_bytecode_offset);
// TODO(rmcilroy): Create a code target dispatch table to avoid conversion
// from code object on every dispatch.
@@ -138,12 +145,13 @@ void InterpreterAssembler::Dispatch() {
Int32Constant(kPointerSizeLog2)));
// If the order of the parameters you need to change the call signature below.
- STATIC_ASSERT(0 == Linkage::kInterpreterBytecodeParameter);
- STATIC_ASSERT(1 == Linkage::kInterpreterDispatchTableParameter);
- Node* tail_call = graph()->NewNode(common()->TailCall(call_descriptor()),
- target_code_object, new_bytecode_pointer,
- DispatchTablePointer(), graph()->start(),
- graph()->start());
+ STATIC_ASSERT(0 == Linkage::kInterpreterBytecodeOffsetParameter);
+ STATIC_ASSERT(1 == Linkage::kInterpreterBytecodeArrayParameter);
+ STATIC_ASSERT(2 == Linkage::kInterpreterDispatchTableParameter);
+ Node* tail_call = graph()->NewNode(
+ common()->TailCall(call_descriptor()), target_code_object,
+ new_bytecode_offset, BytecodeArrayPointer(), DispatchTablePointer(),
+ graph()->start(), graph()->start());
schedule()->AddTailCall(raw_assembler_->CurrentBlock(), tail_call);
// This should always be the end node.
« no previous file with comments | « src/compiler/interpreter-assembler.h ('k') | src/compiler/linkage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698