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/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/compiler/graph.h" | 10 #include "src/compiler/graph.h" |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 kMachAnyTagged, RegisterFileRawPointer(), | 304 kMachAnyTagged, RegisterFileRawPointer(), |
305 IntPtrConstant(InterpreterFrameConstants::kFunctionFromRegisterPointer)); | 305 IntPtrConstant(InterpreterFrameConstants::kFunctionFromRegisterPointer)); |
306 Node* shared_info = | 306 Node* shared_info = |
307 LoadObjectField(function, JSFunction::kSharedFunctionInfoOffset); | 307 LoadObjectField(function, JSFunction::kSharedFunctionInfoOffset); |
308 Node* vector = | 308 Node* vector = |
309 LoadObjectField(shared_info, SharedFunctionInfo::kFeedbackVectorOffset); | 309 LoadObjectField(shared_info, SharedFunctionInfo::kFeedbackVectorOffset); |
310 return vector; | 310 return vector; |
311 } | 311 } |
312 | 312 |
313 | 313 |
| 314 Node* InterpreterAssembler::CallConstruct(Node* original_constructor, |
| 315 Node* constructor, Node* first_arg, |
| 316 Node* arg_count) { |
| 317 Callable callable = CodeFactory::InterpreterPushArgsAndConstruct(isolate()); |
| 318 CallDescriptor* descriptor = Linkage::GetStubCallDescriptor( |
| 319 isolate(), zone(), callable.descriptor(), 0, CallDescriptor::kNoFlags); |
| 320 |
| 321 Node* code_target = HeapConstant(callable.code()); |
| 322 |
| 323 Node** args = zone()->NewArray<Node*>(5); |
| 324 args[0] = arg_count; |
| 325 args[1] = original_constructor; |
| 326 args[2] = constructor; |
| 327 args[3] = first_arg; |
| 328 args[4] = ContextTaggedPointer(); |
| 329 |
| 330 return CallN(descriptor, code_target, args); |
| 331 } |
| 332 |
| 333 |
314 Node* InterpreterAssembler::CallN(CallDescriptor* descriptor, Node* code_target, | 334 Node* InterpreterAssembler::CallN(CallDescriptor* descriptor, Node* code_target, |
315 Node** args) { | 335 Node** args) { |
316 Node* stack_pointer_before_call = nullptr; | 336 Node* stack_pointer_before_call = nullptr; |
317 if (FLAG_debug_code) { | 337 if (FLAG_debug_code) { |
318 stack_pointer_before_call = raw_assembler_->LoadStackPointer(); | 338 stack_pointer_before_call = raw_assembler_->LoadStackPointer(); |
319 } | 339 } |
320 Node* return_val = raw_assembler_->CallN(descriptor, code_target, args); | 340 Node* return_val = raw_assembler_->CallN(descriptor, code_target, args); |
321 if (FLAG_debug_code) { | 341 if (FLAG_debug_code) { |
322 Node* stack_pointer_after_call = raw_assembler_->LoadStackPointer(); | 342 Node* stack_pointer_after_call = raw_assembler_->LoadStackPointer(); |
323 AbortIfWordNotEqual(stack_pointer_before_call, stack_pointer_after_call, | 343 AbortIfWordNotEqual(stack_pointer_before_call, stack_pointer_after_call, |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 return raw_assembler_->schedule(); | 582 return raw_assembler_->schedule(); |
563 } | 583 } |
564 | 584 |
565 | 585 |
566 Zone* InterpreterAssembler::zone() { return raw_assembler_->zone(); } | 586 Zone* InterpreterAssembler::zone() { return raw_assembler_->zone(); } |
567 | 587 |
568 | 588 |
569 } // namespace compiler | 589 } // namespace compiler |
570 } // namespace internal | 590 } // namespace internal |
571 } // namespace v8 | 591 } // namespace v8 |
OLD | NEW |