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 2067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2078 __ Addu(sp, sp, Operand(scratch)); | 2078 __ Addu(sp, sp, Operand(scratch)); |
2079 } | 2079 } |
2080 | 2080 |
2081 // ----------- S t a t e ------------- | 2081 // ----------- S t a t e ------------- |
2082 // -- a2 : argumentsList | 2082 // -- a2 : argumentsList |
2083 // -- a3 : new.target | 2083 // -- a3 : new.target |
2084 // -- a1 : target | 2084 // -- a1 : target |
2085 // -- sp[0] : receiver (undefined) | 2085 // -- sp[0] : receiver (undefined) |
2086 // ----------------------------------- | 2086 // ----------------------------------- |
2087 | 2087 |
2088 // 2. Make sure the target is actually a constructor. | 2088 // 2. We don't need to check explicitly for constructor target here, |
2089 Label target_not_constructor; | 2089 // since that's the first thing the Construct/ConstructWithArrayLike |
2090 __ JumpIfSmi(a1, &target_not_constructor); | 2090 // builtins will do. |
2091 __ lw(t0, FieldMemOperand(a1, HeapObject::kMapOffset)); | |
2092 __ lbu(t0, FieldMemOperand(t0, Map::kBitFieldOffset)); | |
2093 __ And(t0, t0, Operand(1 << Map::kIsConstructor)); | |
2094 __ Branch(&target_not_constructor, eq, t0, Operand(zero_reg)); | |
2095 | 2091 |
2096 // 3. Make sure the target is actually a constructor. | 2092 // 3. We don't need to check explicitly for constructor new.target here, |
2097 Label new_target_not_constructor; | 2093 // since that's the second thing the Construct/ConstructWithArrayLike |
2098 __ JumpIfSmi(a3, &new_target_not_constructor); | 2094 // builtins will do. |
2099 __ lw(t0, FieldMemOperand(a3, HeapObject::kMapOffset)); | |
2100 __ lbu(t0, FieldMemOperand(t0, Map::kBitFieldOffset)); | |
2101 __ And(t0, t0, Operand(1 << Map::kIsConstructor)); | |
2102 __ Branch(&new_target_not_constructor, eq, t0, Operand(zero_reg)); | |
2103 | 2095 |
2104 // 4a. Construct the target with the given new.target and argumentsList. | 2096 // 4. Construct the target with the given new.target and argumentsList. |
2105 __ Jump(masm->isolate()->builtins()->ConstructWithArrayLike(), | 2097 __ Jump(masm->isolate()->builtins()->ConstructWithArrayLike(), |
2106 RelocInfo::CODE_TARGET); | 2098 RelocInfo::CODE_TARGET); |
2107 | |
2108 // 4b. The target is not a constructor, throw an appropriate TypeError. | |
2109 __ bind(&target_not_constructor); | |
2110 { | |
2111 __ sw(a1, MemOperand(sp)); | |
2112 __ TailCallRuntime(Runtime::kThrowNotConstructor); | |
2113 } | |
2114 | |
2115 // 4c. The new.target is not a constructor, throw an appropriate TypeError. | |
2116 __ bind(&new_target_not_constructor); | |
2117 { | |
2118 __ sw(a3, MemOperand(sp)); | |
2119 __ TailCallRuntime(Runtime::kThrowNotConstructor); | |
2120 } | |
2121 } | 2099 } |
2122 | 2100 |
2123 static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) { | 2101 static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) { |
2124 __ sll(a0, a0, kSmiTagSize); | 2102 __ sll(a0, a0, kSmiTagSize); |
2125 __ li(t0, Operand(StackFrame::TypeToMarker(StackFrame::ARGUMENTS_ADAPTOR))); | 2103 __ li(t0, Operand(StackFrame::TypeToMarker(StackFrame::ARGUMENTS_ADAPTOR))); |
2126 __ MultiPush(a0.bit() | a1.bit() | t0.bit() | fp.bit() | ra.bit()); | 2104 __ MultiPush(a0.bit() | a1.bit() | t0.bit() | fp.bit() | ra.bit()); |
2127 __ Addu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp + | 2105 __ Addu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp + |
2128 kPointerSize)); | 2106 kPointerSize)); |
2129 } | 2107 } |
2130 | 2108 |
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2978 // Now jump to the instructions of the returned code object. | 2956 // Now jump to the instructions of the returned code object. |
2979 __ Jump(at, v0, Code::kHeaderSize - kHeapObjectTag); | 2957 __ Jump(at, v0, Code::kHeaderSize - kHeapObjectTag); |
2980 } | 2958 } |
2981 | 2959 |
2982 #undef __ | 2960 #undef __ |
2983 | 2961 |
2984 } // namespace internal | 2962 } // namespace internal |
2985 } // namespace v8 | 2963 } // namespace v8 |
2986 | 2964 |
2987 #endif // V8_TARGET_ARCH_MIPS | 2965 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |