Chromium Code Reviews| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 127 kMachInt8, BytecodeArrayTaggedPointer(), | 127 kMachInt8, BytecodeArrayTaggedPointer(), |
| 128 raw_assembler_->IntPtrAdd(BytecodeOffset(), Int32Constant(1 + delta))); | 128 raw_assembler_->IntPtrAdd(BytecodeOffset(), Int32Constant(1 + delta))); |
| 129 // Ensure that we sign extend to full pointer size | 129 // Ensure that we sign extend to full pointer size |
| 130 if (kPointerSize == 8) { | 130 if (kPointerSize == 8) { |
| 131 load = raw_assembler_->ChangeInt32ToInt64(load); | 131 load = raw_assembler_->ChangeInt32ToInt64(load); |
| 132 } | 132 } |
| 133 return load; | 133 return load; |
| 134 } | 134 } |
| 135 | 135 |
| 136 | 136 |
| 137 Node* InterpreterAssembler::BytecodeOperandImm8(int delta) { | |
|
oth
2015/08/17 10:49:02
Suggest renaming delta for clarity - operand_index
rmcilroy
2015/08/18 13:06:22
Done.
| |
| 138 DCHECK_EQ(interpreter::OperandType::kImm8, | |
| 139 interpreter::Bytecodes::GetOperandType(bytecode_, delta)); | |
| 140 return BytecodeOperandSignExtended(delta); | |
| 141 } | |
| 142 | |
| 143 | |
| 144 Node* InterpreterAssembler::BytecodeOperandReg(int delta) { | |
| 145 DCHECK_EQ(interpreter::OperandType::kReg, | |
| 146 interpreter::Bytecodes::GetOperandType(bytecode_, delta)); | |
| 147 return BytecodeOperandSignExtended(delta); | |
| 148 } | |
| 149 | |
| 150 | |
| 151 Node* InterpreterAssembler::Int32Constant(int value) { | |
| 152 return raw_assembler_->Int32Constant(value); | |
| 153 } | |
| 154 | |
| 155 | |
| 156 Node* InterpreterAssembler::NumberConstant(double value) { | |
| 157 return raw_assembler_->NumberConstant(value); | |
| 158 } | |
| 159 | |
| 160 | |
| 161 Node* InterpreterAssembler::HeapConstant(Unique<HeapObject> object) { | |
| 162 return raw_assembler_->HeapConstant(object); | |
| 163 } | |
| 164 | |
| 165 | |
| 166 Node* InterpreterAssembler::SmiShiftBitsConstant() { | |
| 167 return Int32Constant(kSmiShiftSize + kSmiTagSize); | |
| 168 } | |
| 169 | |
| 170 | |
| 171 Node* InterpreterAssembler::SmiTag(Node* value) { | |
| 172 return raw_assembler_->WordShl(value, SmiShiftBitsConstant()); | |
| 173 } | |
| 174 | |
| 175 | |
| 176 Node* InterpreterAssembler::SmiUntag(Node* value) { | |
| 177 return raw_assembler_->WordSar(value, SmiShiftBitsConstant()); | |
| 178 } | |
| 179 | |
| 180 | |
| 137 void InterpreterAssembler::Return() { | 181 void InterpreterAssembler::Return() { |
| 138 Node* exit_trampoline_code_object = | 182 Node* exit_trampoline_code_object = |
| 139 HeapConstant(Unique<HeapObject>::CreateImmovable( | 183 HeapConstant(Unique<HeapObject>::CreateImmovable( |
| 140 isolate()->builtins()->InterpreterExitTrampoline())); | 184 isolate()->builtins()->InterpreterExitTrampoline())); |
| 141 // If the order of the parameters you need to change the call signature below. | 185 // If the order of the parameters you need to change the call signature below. |
| 142 STATIC_ASSERT(0 == Linkage::kInterpreterAccumulatorParameter); | 186 STATIC_ASSERT(0 == Linkage::kInterpreterAccumulatorParameter); |
| 143 STATIC_ASSERT(1 == Linkage::kInterpreterRegisterFileParameter); | 187 STATIC_ASSERT(1 == Linkage::kInterpreterRegisterFileParameter); |
| 144 STATIC_ASSERT(2 == Linkage::kInterpreterBytecodeOffsetParameter); | 188 STATIC_ASSERT(2 == Linkage::kInterpreterBytecodeOffsetParameter); |
| 145 STATIC_ASSERT(3 == Linkage::kInterpreterBytecodeArrayParameter); | 189 STATIC_ASSERT(3 == Linkage::kInterpreterBytecodeArrayParameter); |
| 146 STATIC_ASSERT(4 == Linkage::kInterpreterDispatchTableParameter); | 190 STATIC_ASSERT(4 == Linkage::kInterpreterDispatchTableParameter); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 209 CallDescriptor* InterpreterAssembler::call_descriptor() const { | 253 CallDescriptor* InterpreterAssembler::call_descriptor() const { |
| 210 return raw_assembler_->call_descriptor(); | 254 return raw_assembler_->call_descriptor(); |
| 211 } | 255 } |
| 212 | 256 |
| 213 | 257 |
| 214 Schedule* InterpreterAssembler::schedule() { | 258 Schedule* InterpreterAssembler::schedule() { |
| 215 return raw_assembler_->schedule(); | 259 return raw_assembler_->schedule(); |
| 216 } | 260 } |
| 217 | 261 |
| 218 | 262 |
| 219 Node* InterpreterAssembler::Int32Constant(int value) { | |
| 220 return raw_assembler_->Int32Constant(value); | |
| 221 } | |
| 222 | |
| 223 | |
| 224 Node* InterpreterAssembler::NumberConstant(double value) { | |
| 225 return raw_assembler_->NumberConstant(value); | |
| 226 } | |
| 227 | |
| 228 | |
| 229 Node* InterpreterAssembler::HeapConstant(Unique<HeapObject> object) { | |
| 230 return raw_assembler_->HeapConstant(object); | |
| 231 } | |
| 232 | 263 |
| 233 } // namespace interpreter | 264 } // namespace interpreter |
| 234 } // namespace internal | 265 } // namespace internal |
| 235 } // namespace v8 | 266 } // namespace v8 |
| OLD | NEW |