OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #if V8_TARGET_ARCH_ARM | 5 #if V8_TARGET_ARCH_ARM |
6 | 6 |
7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 // r0: number of arguments | 563 // r0: number of arguments |
564 // r1: constructor function | 564 // r1: constructor function |
565 // r3: new target | 565 // r3: new target |
566 if (is_api_function) { | 566 if (is_api_function) { |
567 __ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset)); | 567 __ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset)); |
568 Handle<Code> code = | 568 Handle<Code> code = |
569 masm->isolate()->builtins()->HandleApiCallConstruct(); | 569 masm->isolate()->builtins()->HandleApiCallConstruct(); |
570 __ Call(code, RelocInfo::CODE_TARGET); | 570 __ Call(code, RelocInfo::CODE_TARGET); |
571 } else { | 571 } else { |
572 ParameterCount actual(r0); | 572 ParameterCount actual(r0); |
573 __ InvokeFunction(r1, r3, actual, CALL_FUNCTION, | 573 __ InvokeFunction(r1, r3, actual, CALL_FUNCTION, NullCallWrapper()); |
574 CheckDebugStepCallWrapper()); | |
575 } | 574 } |
576 | 575 |
577 // Store offset of return address for deoptimizer. | 576 // Store offset of return address for deoptimizer. |
578 if (create_implicit_receiver && !is_api_function) { | 577 if (create_implicit_receiver && !is_api_function) { |
579 masm->isolate()->heap()->SetConstructStubDeoptPCOffset(masm->pc_offset()); | 578 masm->isolate()->heap()->SetConstructStubDeoptPCOffset(masm->pc_offset()); |
580 } | 579 } |
581 | 580 |
582 // Restore context from the frame. | 581 // Restore context from the frame. |
583 // r0: result | 582 // r0: result |
584 // sp[0]: receiver | 583 // sp[0]: receiver |
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1677 // ----------- S t a t e ------------- | 1676 // ----------- S t a t e ------------- |
1678 // -- r0 : the number of arguments (not including the receiver) | 1677 // -- r0 : the number of arguments (not including the receiver) |
1679 // -- r1 : the function to call (checked to be a JSFunction) | 1678 // -- r1 : the function to call (checked to be a JSFunction) |
1680 // -- r2 : the shared function info. | 1679 // -- r2 : the shared function info. |
1681 // -- cp : the function context. | 1680 // -- cp : the function context. |
1682 // ----------------------------------- | 1681 // ----------------------------------- |
1683 | 1682 |
1684 __ ldr(r2, | 1683 __ ldr(r2, |
1685 FieldMemOperand(r2, SharedFunctionInfo::kFormalParameterCountOffset)); | 1684 FieldMemOperand(r2, SharedFunctionInfo::kFormalParameterCountOffset)); |
1686 __ SmiUntag(r2); | 1685 __ SmiUntag(r2); |
| 1686 __ ldr(r4, FieldMemOperand(r1, JSFunction::kCodeEntryOffset)); |
1687 ParameterCount actual(r0); | 1687 ParameterCount actual(r0); |
1688 ParameterCount expected(r2); | 1688 ParameterCount expected(r2); |
1689 __ InvokeFunctionCode(r1, no_reg, expected, actual, JUMP_FUNCTION, | 1689 __ InvokeCode(r4, no_reg, expected, actual, JUMP_FUNCTION, NullCallWrapper()); |
1690 CheckDebugStepCallWrapper()); | |
1691 | 1690 |
1692 // The function is a "classConstructor", need to raise an exception. | 1691 // The function is a "classConstructor", need to raise an exception. |
1693 __ bind(&class_constructor); | 1692 __ bind(&class_constructor); |
1694 { | 1693 { |
1695 FrameScope frame(masm, StackFrame::INTERNAL); | 1694 FrameScope frame(masm, StackFrame::INTERNAL); |
1696 __ push(r1); | 1695 __ push(r1); |
1697 __ CallRuntime(Runtime::kThrowConstructorNonCallableError, 1); | 1696 __ CallRuntime(Runtime::kThrowConstructorNonCallableError, 1); |
1698 } | 1697 } |
1699 } | 1698 } |
1700 | 1699 |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1972 } | 1971 } |
1973 } | 1972 } |
1974 | 1973 |
1975 | 1974 |
1976 #undef __ | 1975 #undef __ |
1977 | 1976 |
1978 } // namespace internal | 1977 } // namespace internal |
1979 } // namespace v8 | 1978 } // namespace v8 |
1980 | 1979 |
1981 #endif // V8_TARGET_ARCH_ARM | 1980 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |