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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 kMachAnyTagged, RegisterFileRawPointer(), | 310 kMachAnyTagged, RegisterFileRawPointer(), |
311 IntPtrConstant(InterpreterFrameConstants::kFunctionFromRegisterPointer)); | 311 IntPtrConstant(InterpreterFrameConstants::kFunctionFromRegisterPointer)); |
312 Node* shared_info = | 312 Node* shared_info = |
313 LoadObjectField(function, JSFunction::kSharedFunctionInfoOffset); | 313 LoadObjectField(function, JSFunction::kSharedFunctionInfoOffset); |
314 Node* vector = | 314 Node* vector = |
315 LoadObjectField(shared_info, SharedFunctionInfo::kFeedbackVectorOffset); | 315 LoadObjectField(shared_info, SharedFunctionInfo::kFeedbackVectorOffset); |
316 return vector; | 316 return vector; |
317 } | 317 } |
318 | 318 |
319 | 319 |
| 320 Node* InterpreterAssembler::CallConstruct(Node* original_constructor, |
| 321 Node* constructor, Node* first_arg, |
| 322 Node* arg_count) { |
| 323 Callable callable = CodeFactory::InterpreterPushArgsAndConstruct(isolate()); |
| 324 CallDescriptor* descriptor = Linkage::GetStubCallDescriptor( |
| 325 isolate(), zone(), callable.descriptor(), 0, CallDescriptor::kNoFlags); |
| 326 |
| 327 Node* code_target = HeapConstant(callable.code()); |
| 328 |
| 329 Node** args = zone()->NewArray<Node*>(5); |
| 330 args[0] = arg_count; |
| 331 args[1] = original_constructor; |
| 332 args[2] = constructor; |
| 333 args[3] = first_arg; |
| 334 args[4] = GetContext(); |
| 335 |
| 336 return CallN(descriptor, code_target, args); |
| 337 } |
| 338 |
| 339 |
320 Node* InterpreterAssembler::CallN(CallDescriptor* descriptor, Node* code_target, | 340 Node* InterpreterAssembler::CallN(CallDescriptor* descriptor, Node* code_target, |
321 Node** args) { | 341 Node** args) { |
322 Node* stack_pointer_before_call = nullptr; | 342 Node* stack_pointer_before_call = nullptr; |
323 if (FLAG_debug_code) { | 343 if (FLAG_debug_code) { |
324 stack_pointer_before_call = raw_assembler_->LoadStackPointer(); | 344 stack_pointer_before_call = raw_assembler_->LoadStackPointer(); |
325 } | 345 } |
326 Node* return_val = raw_assembler_->CallN(descriptor, code_target, args); | 346 Node* return_val = raw_assembler_->CallN(descriptor, code_target, args); |
327 if (FLAG_debug_code) { | 347 if (FLAG_debug_code) { |
328 Node* stack_pointer_after_call = raw_assembler_->LoadStackPointer(); | 348 Node* stack_pointer_after_call = raw_assembler_->LoadStackPointer(); |
329 AbortIfWordNotEqual(stack_pointer_before_call, stack_pointer_after_call, | 349 AbortIfWordNotEqual(stack_pointer_before_call, stack_pointer_after_call, |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 return raw_assembler_->schedule(); | 606 return raw_assembler_->schedule(); |
587 } | 607 } |
588 | 608 |
589 | 609 |
590 Zone* InterpreterAssembler::zone() { return raw_assembler_->zone(); } | 610 Zone* InterpreterAssembler::zone() { return raw_assembler_->zone(); } |
591 | 611 |
592 | 612 |
593 } // namespace compiler | 613 } // namespace compiler |
594 } // namespace internal | 614 } // namespace internal |
595 } // namespace v8 | 615 } // namespace v8 |
OLD | NEW |