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

Side by Side Diff: src/ia32/builtins-ia32.cc

Issue 1815203002: ES6: Faster implementation of OrdinaryHasInstance (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « src/code-stubs.h ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/codegen.h" 8 #include "src/codegen.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 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after
1135 __ Jump(masm->isolate()->builtins()->Apply(), RelocInfo::CODE_TARGET); 1135 __ Jump(masm->isolate()->builtins()->Apply(), RelocInfo::CODE_TARGET);
1136 1136
1137 // 3b. The target is not callable, throw an appropriate TypeError. 1137 // 3b. The target is not callable, throw an appropriate TypeError.
1138 __ bind(&target_not_callable); 1138 __ bind(&target_not_callable);
1139 { 1139 {
1140 __ mov(Operand(esp, kPointerSize), edi); 1140 __ mov(Operand(esp, kPointerSize), edi);
1141 __ TailCallRuntime(Runtime::kThrowApplyNonFunction); 1141 __ TailCallRuntime(Runtime::kThrowApplyNonFunction);
1142 } 1142 }
1143 } 1143 }
1144 1144
1145 void Builtins::Generate_FunctionHasInstance(MacroAssembler* masm) {
1146 // Stack Layout:
1147 // esp[0] : Return address
1148 // esp[8] : Argument n
1149 // esp[16] : Argument n-1
1150 // ...
1151 // esp[8 * n] : Argument 1
1152 // esp[8 * (n + 1)] : Receiver (callable to call)
1153 //
1154 // eax contains the number of arguments, n, not counting the receiver.
1155 //
1156 {
1157 FrameScope scope(masm, StackFrame::INTERNAL);
1158 __ push(esi);
1159 __ push(edi);
1160 __ mov(edx, Operand(ebp, 2 * kPointerSize)); // load arg.
1161 __ mov(eax, Operand(ebp, 3 * kPointerSize)); // load receiver.
1162 InstanceOfStub stub(masm->isolate(), true);
1163 __ CallStub(&stub);
1164 }
1165
1166 // Pop the argument and the receiver.
1167 __ ret(2 * kPointerSize);
1168 }
1145 1169
1146 void Builtins::Generate_ReflectConstruct(MacroAssembler* masm) { 1170 void Builtins::Generate_ReflectConstruct(MacroAssembler* masm) {
1147 // ----------- S t a t e ------------- 1171 // ----------- S t a t e -------------
1148 // -- eax : argc 1172 // -- eax : argc
1149 // -- esp[0] : return address 1173 // -- esp[0] : return address
1150 // -- esp[4] : new.target (optional) 1174 // -- esp[4] : new.target (optional)
1151 // -- esp[8] : argumentsList 1175 // -- esp[8] : argumentsList
1152 // -- esp[12] : target 1176 // -- esp[12] : target
1153 // -- esp[16] : receiver 1177 // -- esp[16] : receiver
1154 // ----------------------------------- 1178 // -----------------------------------
(...skipping 1427 matching lines...) Expand 10 before | Expand all | Expand 10 after
2582 // And "return" to the OSR entry point of the function. 2606 // And "return" to the OSR entry point of the function.
2583 __ ret(0); 2607 __ ret(0);
2584 } 2608 }
2585 2609
2586 2610
2587 #undef __ 2611 #undef __
2588 } // namespace internal 2612 } // namespace internal
2589 } // namespace v8 2613 } // namespace v8
2590 2614
2591 #endif // V8_TARGET_ARCH_IA32 2615 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/code-stubs.h ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698