Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(258)

Unified Diff: src/builtins/ia32/builtins-ia32.cc

Issue 2949813002: [turbofan] Introduce new JSConstructWithArrayLike operator. (Closed)
Patch Set: Address feedback. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/builtins/builtins-call-gen.cc ('k') | src/builtins/mips/builtins-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/ia32/builtins-ia32.cc
diff --git a/src/builtins/ia32/builtins-ia32.cc b/src/builtins/ia32/builtins-ia32.cc
index 8770d320bf07e4d8a6ce0aeee8e1c1542c3b52c5..b6c228361bb0fb0e3c96082754b8492b544a05db 100644
--- a/src/builtins/ia32/builtins-ia32.cc
+++ b/src/builtins/ia32/builtins-ia32.cc
@@ -1858,39 +1858,17 @@ void Builtins::Generate_ReflectConstruct(MacroAssembler* masm) {
// -- esp[4] : receiver (undefined)
// -----------------------------------
- // 2. Make sure the target is actually a constructor.
- Label target_not_constructor;
- __ JumpIfSmi(edi, &target_not_constructor, Label::kNear);
- __ mov(ecx, FieldOperand(edi, HeapObject::kMapOffset));
- __ test_b(FieldOperand(ecx, Map::kBitFieldOffset),
- Immediate(1 << Map::kIsConstructor));
- __ j(zero, &target_not_constructor, Label::kNear);
+ // 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(edx, &new_target_not_constructor, Label::kNear);
- __ mov(ecx, FieldOperand(edx, HeapObject::kMapOffset));
- __ test_b(FieldOperand(ecx, Map::kBitFieldOffset),
- Immediate(1 << Map::kIsConstructor));
- __ j(zero, &new_target_not_constructor, Label::kNear);
+ // 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);
- {
- __ mov(Operand(esp, kPointerSize), edi);
- __ TailCallRuntime(Runtime::kThrowNotConstructor);
- }
-
- // 4c. The new.target is not a constructor, throw an appropriate TypeError.
- __ bind(&new_target_not_constructor);
- {
- __ mov(Operand(esp, kPointerSize), edx);
- __ TailCallRuntime(Runtime::kThrowNotConstructor);
- }
}
void Builtins::Generate_InternalArrayCode(MacroAssembler* masm) {
« no previous file with comments | « src/builtins/builtins-call-gen.cc ('k') | src/builtins/mips/builtins-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698