| OLD | NEW |
| 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 #include "src/compiler/interpreter-assembler.h" | 5 #include "src/compiler/interpreter-assembler.h" |
| 6 | 6 |
| 7 #include <ostream> | 7 #include <ostream> |
| 8 | 8 |
| 9 #include "src/compiler/graph.h" | 9 #include "src/compiler/graph.h" |
| 10 #include "src/compiler/instruction-selector.h" | 10 #include "src/compiler/instruction-selector.h" |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 } | 140 } |
| 141 | 141 |
| 142 | 142 |
| 143 Node* InterpreterAssembler::BytecodeOperandImm8(int operand_index) { | 143 Node* InterpreterAssembler::BytecodeOperandImm8(int operand_index) { |
| 144 DCHECK_EQ(interpreter::OperandType::kImm8, | 144 DCHECK_EQ(interpreter::OperandType::kImm8, |
| 145 interpreter::Bytecodes::GetOperandType(bytecode_, operand_index)); | 145 interpreter::Bytecodes::GetOperandType(bytecode_, operand_index)); |
| 146 return BytecodeOperandSignExtended(operand_index); | 146 return BytecodeOperandSignExtended(operand_index); |
| 147 } | 147 } |
| 148 | 148 |
| 149 | 149 |
| 150 Node* InterpreterAssembler::BytecodeOperandIdx(int operand_index) { |
| 151 DCHECK_EQ(interpreter::OperandType::kIdx, |
| 152 interpreter::Bytecodes::GetOperandType(bytecode_, operand_index)); |
| 153 return BytecodeOperand(operand_index); |
| 154 } |
| 155 |
| 156 |
| 150 Node* InterpreterAssembler::BytecodeOperandReg(int operand_index) { | 157 Node* InterpreterAssembler::BytecodeOperandReg(int operand_index) { |
| 151 DCHECK_EQ(interpreter::OperandType::kReg, | 158 DCHECK_EQ(interpreter::OperandType::kReg, |
| 152 interpreter::Bytecodes::GetOperandType(bytecode_, operand_index)); | 159 interpreter::Bytecodes::GetOperandType(bytecode_, operand_index)); |
| 153 return BytecodeOperandSignExtended(operand_index); | 160 return BytecodeOperandSignExtended(operand_index); |
| 154 } | 161 } |
| 155 | 162 |
| 156 | 163 |
| 157 Node* InterpreterAssembler::Int32Constant(int value) { | 164 Node* InterpreterAssembler::Int32Constant(int value) { |
| 158 return raw_assembler_->Int32Constant(value); | 165 return raw_assembler_->Int32Constant(value); |
| 159 } | 166 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 182 Node* InterpreterAssembler::SmiTag(Node* value) { | 189 Node* InterpreterAssembler::SmiTag(Node* value) { |
| 183 return raw_assembler_->WordShl(value, SmiShiftBitsConstant()); | 190 return raw_assembler_->WordShl(value, SmiShiftBitsConstant()); |
| 184 } | 191 } |
| 185 | 192 |
| 186 | 193 |
| 187 Node* InterpreterAssembler::SmiUntag(Node* value) { | 194 Node* InterpreterAssembler::SmiUntag(Node* value) { |
| 188 return raw_assembler_->WordSar(value, SmiShiftBitsConstant()); | 195 return raw_assembler_->WordSar(value, SmiShiftBitsConstant()); |
| 189 } | 196 } |
| 190 | 197 |
| 191 | 198 |
| 199 Node* InterpreterAssembler::LoadConstantPoolEntry(Node* index) { |
| 200 Node* constant_pool = LoadObjectField(BytecodeArrayTaggedPointer(), |
| 201 BytecodeArray::kConstantPoolOffset); |
| 202 Node* entry_offset = raw_assembler_->IntPtrAdd( |
| 203 IntPtrConstant(FixedArray::kHeaderSize - kHeapObjectTag), |
| 204 raw_assembler_->WordShl(index, Int32Constant(kPointerSizeLog2))); |
| 205 return raw_assembler_->Load(kMachAnyTagged, constant_pool, entry_offset); |
| 206 } |
| 207 |
| 208 |
| 192 Node* InterpreterAssembler::LoadObjectField(Node* object, int offset) { | 209 Node* InterpreterAssembler::LoadObjectField(Node* object, int offset) { |
| 193 return raw_assembler_->Load(kMachAnyTagged, object, | 210 return raw_assembler_->Load(kMachAnyTagged, object, |
| 194 IntPtrConstant(offset - kHeapObjectTag)); | 211 IntPtrConstant(offset - kHeapObjectTag)); |
| 195 } | 212 } |
| 196 | 213 |
| 197 | 214 |
| 198 Node* InterpreterAssembler::LoadContextSlot(Node* context, int slot_index) { | 215 Node* InterpreterAssembler::LoadContextSlot(Node* context, int slot_index) { |
| 199 return raw_assembler_->Load(kMachAnyTagged, context, | 216 return raw_assembler_->Load(kMachAnyTagged, context, |
| 200 IntPtrConstant(Context::SlotOffset(slot_index))); | 217 IntPtrConstant(Context::SlotOffset(slot_index))); |
| 201 } | 218 } |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 return raw_assembler_->schedule(); | 347 return raw_assembler_->schedule(); |
| 331 } | 348 } |
| 332 | 349 |
| 333 | 350 |
| 334 Zone* InterpreterAssembler::zone() { return raw_assembler_->zone(); } | 351 Zone* InterpreterAssembler::zone() { return raw_assembler_->zone(); } |
| 335 | 352 |
| 336 | 353 |
| 337 } // namespace interpreter | 354 } // namespace interpreter |
| 338 } // namespace internal | 355 } // namespace internal |
| 339 } // namespace v8 | 356 } // namespace v8 |
| OLD | NEW |