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

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

Issue 1513543003: [turbofan] Make MachineType a pair of enums. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Moar rebase Created 5 years 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/instruction-selector-impl.h ('k') | src/compiler/js-builtin-reducer.cc » ('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 fa2612354f16c680afb25c5b659d189ed05fc27f..3179895c92924e8f3f09a3867eeceec420360940 100644
--- a/src/compiler/interpreter-assembler.cc
+++ b/src/compiler/interpreter-assembler.cc
@@ -30,7 +30,8 @@ InterpreterAssembler::InterpreterAssembler(Isolate* isolate, Zone* zone,
: bytecode_(bytecode),
raw_assembler_(new RawMachineAssembler(
isolate, new (zone) Graph(zone),
- Linkage::GetInterpreterDispatchDescriptor(zone), kMachPtr,
+ Linkage::GetInterpreterDispatchDescriptor(zone),
+ MachineType::PointerRepresentation(),
InstructionSelector::SupportedMachineOperatorFlags())),
accumulator_(
raw_assembler_->Parameter(Linkage::kInterpreterAccumulatorParameter)),
@@ -112,21 +113,22 @@ Node* InterpreterAssembler::RegisterLocation(Node* reg_index) {
Node* InterpreterAssembler::LoadRegister(interpreter::Register reg) {
return raw_assembler_->Load(
- kMachAnyTagged, RegisterFileRawPointer(),
+ MachineType::AnyTagged(), RegisterFileRawPointer(),
RegisterFrameOffset(Int32Constant(reg.ToOperand())));
}
Node* InterpreterAssembler::LoadRegister(Node* reg_index) {
- return raw_assembler_->Load(kMachAnyTagged, RegisterFileRawPointer(),
+ return raw_assembler_->Load(MachineType::AnyTagged(),
+ RegisterFileRawPointer(),
RegisterFrameOffset(reg_index));
}
Node* InterpreterAssembler::StoreRegister(Node* value, Node* reg_index) {
- return raw_assembler_->Store(kMachAnyTagged, RegisterFileRawPointer(),
- RegisterFrameOffset(reg_index), value,
- kNoWriteBarrier);
+ return raw_assembler_->Store(
+ MachineType::AnyTagged(), RegisterFileRawPointer(),
+ RegisterFrameOffset(reg_index), value, kNoWriteBarrier);
}
@@ -135,7 +137,7 @@ Node* InterpreterAssembler::BytecodeOperand(int operand_index) {
DCHECK_EQ(interpreter::OperandSize::kByte,
interpreter::Bytecodes::GetOperandSize(bytecode_, operand_index));
return raw_assembler_->Load(
- kMachUint8, BytecodeArrayTaggedPointer(),
+ MachineType::Uint8(), BytecodeArrayTaggedPointer(),
IntPtrAdd(BytecodeOffset(),
Int32Constant(interpreter::Bytecodes::GetOperandOffset(
bytecode_, operand_index))));
@@ -147,7 +149,7 @@ Node* InterpreterAssembler::BytecodeOperandSignExtended(int operand_index) {
DCHECK_EQ(interpreter::OperandSize::kByte,
interpreter::Bytecodes::GetOperandSize(bytecode_, operand_index));
Node* load = raw_assembler_->Load(
- kMachInt8, BytecodeArrayTaggedPointer(),
+ MachineType::Int8(), BytecodeArrayTaggedPointer(),
IntPtrAdd(BytecodeOffset(),
Int32Constant(interpreter::Bytecodes::GetOperandOffset(
bytecode_, operand_index))));
@@ -165,7 +167,7 @@ Node* InterpreterAssembler::BytecodeOperandShort(int operand_index) {
interpreter::Bytecodes::GetOperandSize(bytecode_, operand_index));
if (TargetSupportsUnalignedAccess()) {
return raw_assembler_->Load(
- kMachUint16, BytecodeArrayTaggedPointer(),
+ MachineType::Uint16(), BytecodeArrayTaggedPointer(),
IntPtrAdd(BytecodeOffset(),
Int32Constant(interpreter::Bytecodes::GetOperandOffset(
bytecode_, operand_index))));
@@ -173,10 +175,10 @@ Node* InterpreterAssembler::BytecodeOperandShort(int operand_index) {
int offset =
interpreter::Bytecodes::GetOperandOffset(bytecode_, operand_index);
Node* first_byte = raw_assembler_->Load(
- kMachUint8, BytecodeArrayTaggedPointer(),
+ MachineType::Uint8(), BytecodeArrayTaggedPointer(),
IntPtrAdd(BytecodeOffset(), Int32Constant(offset)));
Node* second_byte = raw_assembler_->Load(
- kMachUint8, BytecodeArrayTaggedPointer(),
+ MachineType::Uint8(), BytecodeArrayTaggedPointer(),
IntPtrAdd(BytecodeOffset(), Int32Constant(offset + 1)));
#if V8_TARGET_LITTLE_ENDIAN
return raw_assembler_->WordOr(WordShl(second_byte, kBitsPerByte),
@@ -308,7 +310,8 @@ Node* InterpreterAssembler::LoadConstantPoolEntry(Node* index) {
Node* entry_offset =
IntPtrAdd(IntPtrConstant(FixedArray::kHeaderSize - kHeapObjectTag),
WordShl(index, kPointerSizeLog2));
- return raw_assembler_->Load(kMachAnyTagged, constant_pool, entry_offset);
+ return raw_assembler_->Load(MachineType::AnyTagged(), constant_pool,
+ entry_offset);
}
@@ -317,18 +320,19 @@ Node* InterpreterAssembler::LoadFixedArrayElement(Node* fixed_array,
Node* entry_offset =
IntPtrAdd(IntPtrConstant(FixedArray::kHeaderSize - kHeapObjectTag),
WordShl(Int32Constant(index), kPointerSizeLog2));
- return raw_assembler_->Load(kMachAnyTagged, fixed_array, entry_offset);
+ return raw_assembler_->Load(MachineType::AnyTagged(), fixed_array,
+ entry_offset);
}
Node* InterpreterAssembler::LoadObjectField(Node* object, int offset) {
- return raw_assembler_->Load(kMachAnyTagged, object,
+ return raw_assembler_->Load(MachineType::AnyTagged(), object,
IntPtrConstant(offset - kHeapObjectTag));
}
Node* InterpreterAssembler::LoadContextSlot(Node* context, int slot_index) {
- return raw_assembler_->Load(kMachAnyTagged, context,
+ return raw_assembler_->Load(MachineType::AnyTagged(), context,
IntPtrConstant(Context::SlotOffset(slot_index)));
}
@@ -337,7 +341,7 @@ Node* InterpreterAssembler::LoadContextSlot(Node* context, Node* slot_index) {
Node* offset =
IntPtrAdd(WordShl(slot_index, kPointerSizeLog2),
Int32Constant(Context::kHeaderSize - kHeapObjectTag));
- return raw_assembler_->Load(kMachAnyTagged, context, offset);
+ return raw_assembler_->Load(MachineType::AnyTagged(), context, offset);
}
@@ -346,14 +350,14 @@ Node* InterpreterAssembler::StoreContextSlot(Node* context, Node* slot_index,
Node* offset =
IntPtrAdd(WordShl(slot_index, kPointerSizeLog2),
Int32Constant(Context::kHeaderSize - kHeapObjectTag));
- return raw_assembler_->Store(kMachAnyTagged, context, offset, value,
+ return raw_assembler_->Store(MachineType::AnyTagged(), context, offset, value,
kFullWriteBarrier);
}
Node* InterpreterAssembler::LoadTypeFeedbackVector() {
Node* function = raw_assembler_->Load(
- kMachAnyTagged, RegisterFileRawPointer(),
+ MachineType::AnyTagged(), RegisterFileRawPointer(),
IntPtrConstant(InterpreterFrameConstants::kFunctionFromRegisterPointer));
Node* shared_info =
LoadObjectField(function, JSFunction::kSharedFunctionInfoOffset);
@@ -477,8 +481,9 @@ Node* InterpreterAssembler::CallRuntime(Node* function_id, Node* first_arg,
Node* function_offset = raw_assembler_->Int32Mul(
function_id, Int32Constant(sizeof(Runtime::Function)));
Node* function = IntPtrAdd(function_table, function_offset);
- Node* function_entry = raw_assembler_->Load(
- kMachPtr, function, Int32Constant(offsetof(Runtime::Function, entry)));
+ Node* function_entry =
+ raw_assembler_->Load(MachineType::Pointer(), function,
+ Int32Constant(offsetof(Runtime::Function, entry)));
Node** args = zone()->NewArray<Node*>(4);
args[0] = arg_count;
@@ -562,12 +567,12 @@ void InterpreterAssembler::Dispatch() {
void InterpreterAssembler::DispatchTo(Node* new_bytecode_offset) {
Node* target_bytecode = raw_assembler_->Load(
- kMachUint8, BytecodeArrayTaggedPointer(), new_bytecode_offset);
+ MachineType::Uint8(), BytecodeArrayTaggedPointer(), new_bytecode_offset);
// TODO(rmcilroy): Create a code target dispatch table to avoid conversion
// from code object on every dispatch.
Node* target_code_object = raw_assembler_->Load(
- kMachPtr, DispatchTableRawPointer(),
+ MachineType::Pointer(), DispatchTableRawPointer(),
raw_assembler_->Word32Shl(target_bytecode,
Int32Constant(kPointerSizeLog2)));
« no previous file with comments | « src/compiler/instruction-selector-impl.h ('k') | src/compiler/js-builtin-reducer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698