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" |
11 #include "src/compiler/linkage.h" | 11 #include "src/compiler/linkage.h" |
12 #include "src/compiler/machine-type.h" | 12 #include "src/compiler/machine-type.h" |
13 #include "src/compiler/pipeline.h" | 13 #include "src/compiler/pipeline.h" |
14 #include "src/compiler/raw-machine-assembler.h" | 14 #include "src/compiler/raw-machine-assembler.h" |
15 #include "src/compiler/schedule.h" | 15 #include "src/compiler/schedule.h" |
16 #include "src/frames.h" | 16 #include "src/frames.h" |
17 #include "src/interface-descriptors.h" | |
17 #include "src/interpreter/bytecodes.h" | 18 #include "src/interpreter/bytecodes.h" |
18 #include "src/macro-assembler.h" | 19 #include "src/macro-assembler.h" |
19 #include "src/zone.h" | 20 #include "src/zone.h" |
20 | 21 |
21 namespace v8 { | 22 namespace v8 { |
22 namespace internal { | 23 namespace internal { |
23 namespace compiler { | 24 namespace compiler { |
24 | 25 |
25 | 26 |
26 InterpreterAssembler::InterpreterAssembler(Isolate* isolate, Zone* zone, | 27 InterpreterAssembler::InterpreterAssembler(Isolate* isolate, Zone* zone, |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
216 return raw_assembler_->Load(kMachAnyTagged, context, | 217 return raw_assembler_->Load(kMachAnyTagged, context, |
217 IntPtrConstant(Context::SlotOffset(slot_index))); | 218 IntPtrConstant(Context::SlotOffset(slot_index))); |
218 } | 219 } |
219 | 220 |
220 | 221 |
221 Node* InterpreterAssembler::LoadContextSlot(int slot_index) { | 222 Node* InterpreterAssembler::LoadContextSlot(int slot_index) { |
222 return LoadContextSlot(ContextTaggedPointer(), slot_index); | 223 return LoadContextSlot(ContextTaggedPointer(), slot_index); |
223 } | 224 } |
224 | 225 |
225 | 226 |
227 Node* InterpreterAssembler::LoadTypeFeedbackVector() { | |
228 Node* function = raw_assembler_->Load( | |
229 kMachAnyTagged, RegisterFileRawPointer(), | |
230 IntPtrConstant(InterpreterFrameConstants::kFunctionFromRegisterPointer)); | |
231 Node* shared_info = | |
232 LoadObjectField(function, JSFunction::kSharedFunctionInfoOffset); | |
233 Node* vector = | |
234 LoadObjectField(shared_info, SharedFunctionInfo::kFeedbackVectorOffset); | |
235 return vector; | |
236 } | |
237 | |
238 | |
239 Node* InterpreterAssembler::CallIC(CallInterfaceDescriptor descriptor, | |
mvstanton
2015/09/01 14:28:29
If the number of arguments are going to be fixed I
rmcilroy
2015/09/01 15:53:36
My plan was to have overloads for the number of pa
mvstanton
2015/09/01 16:54:13
Okay I can live with that :).
| |
240 Node* target, Node* arg1, Node* arg2, | |
241 Node* arg3, Node* arg4) { | |
242 CallDescriptor* call_descriptor = Linkage::GetStubCallDescriptor( | |
243 isolate(), zone(), descriptor, 0, CallDescriptor::kNoFlags); | |
244 | |
245 Node** args = zone()->NewArray<Node*>(5); | |
246 args[0] = arg1; | |
247 args[1] = arg2; | |
248 args[2] = arg3; | |
249 args[3] = arg4; | |
250 args[4] = ContextTaggedPointer(); | |
251 | |
252 return raw_assembler_->CallN(call_descriptor, target, args); | |
253 } | |
254 | |
255 | |
226 Node* InterpreterAssembler::CallJSBuiltin(int context_index, Node* receiver, | 256 Node* InterpreterAssembler::CallJSBuiltin(int context_index, Node* receiver, |
227 Node** js_args, int js_arg_count) { | 257 Node** js_args, int js_arg_count) { |
228 Node* global_object = LoadContextSlot(Context::GLOBAL_OBJECT_INDEX); | 258 Node* global_object = LoadContextSlot(Context::GLOBAL_OBJECT_INDEX); |
229 Node* native_context = | 259 Node* native_context = |
230 LoadObjectField(global_object, GlobalObject::kNativeContextOffset); | 260 LoadObjectField(global_object, GlobalObject::kNativeContextOffset); |
231 Node* function = LoadContextSlot(native_context, context_index); | 261 Node* function = LoadContextSlot(native_context, context_index); |
232 Node* context = LoadObjectField(function, JSFunction::kContextOffset); | 262 Node* context = LoadObjectField(function, JSFunction::kContextOffset); |
233 | 263 |
234 int index = 0; | 264 int index = 0; |
235 Node** args = zone()->NewArray<Node*>(js_arg_count + 2); | 265 Node** args = zone()->NewArray<Node*>(js_arg_count + 2); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
346 return raw_assembler_->schedule(); | 376 return raw_assembler_->schedule(); |
347 } | 377 } |
348 | 378 |
349 | 379 |
350 Zone* InterpreterAssembler::zone() { return raw_assembler_->zone(); } | 380 Zone* InterpreterAssembler::zone() { return raw_assembler_->zone(); } |
351 | 381 |
352 | 382 |
353 } // namespace interpreter | 383 } // namespace interpreter |
354 } // namespace internal | 384 } // namespace internal |
355 } // namespace v8 | 385 } // namespace v8 |
OLD | NEW |