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

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

Issue 2950773002: [turbofan] Introduce new JSCallWithArrayLike operator. (Closed)
Patch Set: 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
Index: src/builtins/mips/builtins-mips.cc
diff --git a/src/builtins/mips/builtins-mips.cc b/src/builtins/mips/builtins-mips.cc
index 9ecb5f8a61c7d5156ae2a2f343d64bee87675e7d..8a732cf28d72de0040f47a4827dfd034f651cb70 100644
--- a/src/builtins/mips/builtins-mips.cc
+++ b/src/builtins/mips/builtins-mips.cc
@@ -1847,13 +1847,9 @@ void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) {
// -- sp[0] : thisArg
// -----------------------------------
- // 2. Make sure the receiver is actually callable.
- Label receiver_not_callable;
- __ JumpIfSmi(a1, &receiver_not_callable);
- __ lw(t0, FieldMemOperand(a1, HeapObject::kMapOffset));
- __ lbu(t0, FieldMemOperand(t0, Map::kBitFieldOffset));
- __ And(t0, t0, Operand(1 << Map::kIsCallable));
- __ Branch(&receiver_not_callable, eq, t0, Operand(zero_reg));
+ // 2. We don't need to check explicitly for callable receiver here,
+ // since that's the first thing the Call/CallWithArrayLike builtins
+ // will do.
// 3. Tail call with no arguments if argArray is null or undefined.
Label no_arguments;
@@ -1871,13 +1867,6 @@ void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) {
__ mov(a0, zero_reg);
__ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
}
-
- // 4c. The receiver is not callable, throw an appropriate TypeError.
- __ bind(&receiver_not_callable);
- {
- __ sw(a1, MemOperand(sp));
- __ TailCallRuntime(Runtime::kThrowApplyNonFunction);
- }
}
// static
@@ -1964,24 +1953,13 @@ void Builtins::Generate_ReflectApply(MacroAssembler* masm) {
// -- sp[0] : thisArgument
// -----------------------------------
- // 2. Make sure the target is actually callable.
- Label target_not_callable;
- __ JumpIfSmi(a1, &target_not_callable);
- __ lw(t0, FieldMemOperand(a1, HeapObject::kMapOffset));
- __ lbu(t0, FieldMemOperand(t0, Map::kBitFieldOffset));
- __ And(t0, t0, Operand(1 << Map::kIsCallable));
- __ Branch(&target_not_callable, eq, t0, Operand(zero_reg));
+ // 2. We don't need to check explicitly for callable target here,
+ // since that's the first thing the Call/CallWithArrayLike builtins
+ // will do.
- // 3a. Apply the target to the given argumentsList.
+ // 3. Apply the target to the given argumentsList.
__ Jump(masm->isolate()->builtins()->CallWithArrayLike(),
RelocInfo::CODE_TARGET);
-
- // 3b. The target is not callable, throw an appropriate TypeError.
- __ bind(&target_not_callable);
- {
- __ sw(a1, MemOperand(sp));
- __ TailCallRuntime(Runtime::kThrowApplyNonFunction);
- }
}
void Builtins::Generate_ReflectConstruct(MacroAssembler* masm) {

Powered by Google App Engine
This is Rietveld 408576698