Index: src/builtins/arm/builtins-arm.cc |
diff --git a/src/builtins/arm/builtins-arm.cc b/src/builtins/arm/builtins-arm.cc |
index 1433c9c7038e77f5bce461f41df6b209d03b0fe4..c47a430d736046bba62d7e18d395c5883e2c9e45 100644 |
--- a/src/builtins/arm/builtins-arm.cc |
+++ b/src/builtins/arm/builtins-arm.cc |
@@ -2070,39 +2070,17 @@ void Builtins::Generate_ReflectConstruct(MacroAssembler* masm) { |
// -- sp[0] : receiver (undefined) |
// ----------------------------------- |
- // 2. Make sure the target is actually a constructor. |
- Label target_not_constructor; |
- __ JumpIfSmi(r1, &target_not_constructor); |
- __ ldr(r4, FieldMemOperand(r1, HeapObject::kMapOffset)); |
- __ ldrb(r4, FieldMemOperand(r4, Map::kBitFieldOffset)); |
- __ tst(r4, Operand(1 << Map::kIsConstructor)); |
- __ b(eq, &target_not_constructor); |
+ // 2. We don't need to check explicitly for constructor target here, |
+ // since that's the first thing the Construct/ConstructWithArrayLike |
+ // builtins will do. |
- // 3. Make sure the target is actually a constructor. |
- Label new_target_not_constructor; |
- __ JumpIfSmi(r3, &new_target_not_constructor); |
- __ ldr(r4, FieldMemOperand(r3, HeapObject::kMapOffset)); |
- __ ldrb(r4, FieldMemOperand(r4, Map::kBitFieldOffset)); |
- __ tst(r4, Operand(1 << Map::kIsConstructor)); |
- __ b(eq, &new_target_not_constructor); |
+ // 3. We don't need to check explicitly for constructor new.target here, |
+ // since that's the second thing the Construct/ConstructWithArrayLike |
+ // builtins will do. |
- // 4a. Construct the target with the given new.target and argumentsList. |
+ // 4. Construct the target with the given new.target and argumentsList. |
__ Jump(masm->isolate()->builtins()->ConstructWithArrayLike(), |
RelocInfo::CODE_TARGET); |
- |
- // 4b. The target is not a constructor, throw an appropriate TypeError. |
- __ bind(&target_not_constructor); |
- { |
- __ str(r1, MemOperand(sp, 0)); |
- __ TailCallRuntime(Runtime::kThrowNotConstructor); |
- } |
- |
- // 4c. The new.target is not a constructor, throw an appropriate TypeError. |
- __ bind(&new_target_not_constructor); |
- { |
- __ str(r3, MemOperand(sp, 0)); |
- __ TailCallRuntime(Runtime::kThrowNotConstructor); |
- } |
} |
static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) { |