| 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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
| 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 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 // a0: number of arguments | 569 // a0: number of arguments |
| 570 // a1: constructor function | 570 // a1: constructor function |
| 571 // a3: new target | 571 // a3: new target |
| 572 if (is_api_function) { | 572 if (is_api_function) { |
| 573 __ lw(cp, FieldMemOperand(a1, JSFunction::kContextOffset)); | 573 __ lw(cp, FieldMemOperand(a1, JSFunction::kContextOffset)); |
| 574 Handle<Code> code = | 574 Handle<Code> code = |
| 575 masm->isolate()->builtins()->HandleApiCallConstruct(); | 575 masm->isolate()->builtins()->HandleApiCallConstruct(); |
| 576 __ Call(code, RelocInfo::CODE_TARGET); | 576 __ Call(code, RelocInfo::CODE_TARGET); |
| 577 } else { | 577 } else { |
| 578 ParameterCount actual(a0); | 578 ParameterCount actual(a0); |
| 579 __ InvokeFunction(a1, a3, actual, CALL_FUNCTION, NullCallWrapper()); | 579 __ InvokeFunction(a1, a3, actual, CALL_FUNCTION, |
| 580 CheckDebugStepCallWrapper()); |
| 580 } | 581 } |
| 581 | 582 |
| 582 // Store offset of return address for deoptimizer. | 583 // Store offset of return address for deoptimizer. |
| 583 if (create_implicit_receiver && !is_api_function) { | 584 if (create_implicit_receiver && !is_api_function) { |
| 584 masm->isolate()->heap()->SetConstructStubDeoptPCOffset(masm->pc_offset()); | 585 masm->isolate()->heap()->SetConstructStubDeoptPCOffset(masm->pc_offset()); |
| 585 } | 586 } |
| 586 | 587 |
| 587 // Restore context from the frame. | 588 // Restore context from the frame. |
| 588 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 589 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 589 | 590 |
| (...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1691 // ----------- S t a t e ------------- | 1692 // ----------- S t a t e ------------- |
| 1692 // -- a0 : the number of arguments (not including the receiver) | 1693 // -- a0 : the number of arguments (not including the receiver) |
| 1693 // -- a1 : the function to call (checked to be a JSFunction) | 1694 // -- a1 : the function to call (checked to be a JSFunction) |
| 1694 // -- a2 : the shared function info. | 1695 // -- a2 : the shared function info. |
| 1695 // -- cp : the function context. | 1696 // -- cp : the function context. |
| 1696 // ----------------------------------- | 1697 // ----------------------------------- |
| 1697 | 1698 |
| 1698 __ lw(a2, | 1699 __ lw(a2, |
| 1699 FieldMemOperand(a2, SharedFunctionInfo::kFormalParameterCountOffset)); | 1700 FieldMemOperand(a2, SharedFunctionInfo::kFormalParameterCountOffset)); |
| 1700 __ sra(a2, a2, kSmiTagSize); // Un-tag. | 1701 __ sra(a2, a2, kSmiTagSize); // Un-tag. |
| 1701 __ lw(t0, FieldMemOperand(a1, JSFunction::kCodeEntryOffset)); | |
| 1702 ParameterCount actual(a0); | 1702 ParameterCount actual(a0); |
| 1703 ParameterCount expected(a2); | 1703 ParameterCount expected(a2); |
| 1704 __ InvokeCode(t0, no_reg, expected, actual, JUMP_FUNCTION, NullCallWrapper()); | 1704 __ InvokeFunctionCode(a1, no_reg, expected, actual, JUMP_FUNCTION, |
| 1705 CheckDebugStepCallWrapper()); |
| 1705 | 1706 |
| 1706 // The function is a "classConstructor", need to raise an exception. | 1707 // The function is a "classConstructor", need to raise an exception. |
| 1707 __ bind(&class_constructor); | 1708 __ bind(&class_constructor); |
| 1708 { | 1709 { |
| 1709 FrameScope frame(masm, StackFrame::INTERNAL); | 1710 FrameScope frame(masm, StackFrame::INTERNAL); |
| 1710 __ Push(a1); | 1711 __ Push(a1); |
| 1711 __ CallRuntime(Runtime::kThrowConstructorNonCallableError, 1); | 1712 __ CallRuntime(Runtime::kThrowConstructorNonCallableError, 1); |
| 1712 } | 1713 } |
| 1713 } | 1714 } |
| 1714 | 1715 |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1999 } | 2000 } |
| 2000 } | 2001 } |
| 2001 | 2002 |
| 2002 | 2003 |
| 2003 #undef __ | 2004 #undef __ |
| 2004 | 2005 |
| 2005 } // namespace internal | 2006 } // namespace internal |
| 2006 } // namespace v8 | 2007 } // namespace v8 |
| 2007 | 2008 |
| 2008 #endif // V8_TARGET_ARCH_MIPS | 2009 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |