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

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

Issue 1550923002: Remove uses of result size in TailCallRuntime and friends (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: change spaces Created 4 years, 11 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/builtins.cc ('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 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after
1065 __ bind(&no_arguments); 1065 __ bind(&no_arguments);
1066 { 1066 {
1067 __ Set(eax, 0); 1067 __ Set(eax, 0);
1068 __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); 1068 __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
1069 } 1069 }
1070 1070
1071 // 4c. The receiver is not callable, throw an appropriate TypeError. 1071 // 4c. The receiver is not callable, throw an appropriate TypeError.
1072 __ bind(&receiver_not_callable); 1072 __ bind(&receiver_not_callable);
1073 { 1073 {
1074 __ mov(Operand(esp, kPointerSize), edi); 1074 __ mov(Operand(esp, kPointerSize), edi);
1075 __ TailCallRuntime(Runtime::kThrowApplyNonFunction, 1, 1); 1075 __ TailCallRuntime(Runtime::kThrowApplyNonFunction, 1);
1076 } 1076 }
1077 } 1077 }
1078 1078
1079 1079
1080 // static 1080 // static
1081 void Builtins::Generate_FunctionPrototypeCall(MacroAssembler* masm) { 1081 void Builtins::Generate_FunctionPrototypeCall(MacroAssembler* masm) {
1082 // Stack Layout: 1082 // Stack Layout:
1083 // esp[0] : Return address 1083 // esp[0] : Return address
1084 // esp[8] : Argument n 1084 // esp[8] : Argument n
1085 // esp[16] : Argument n-1 1085 // esp[16] : Argument n-1
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
1174 1174
1175 // 3a. Apply the target to the given argumentsList (passing undefined for 1175 // 3a. Apply the target to the given argumentsList (passing undefined for
1176 // new.target). 1176 // new.target).
1177 __ LoadRoot(edx, Heap::kUndefinedValueRootIndex); 1177 __ LoadRoot(edx, Heap::kUndefinedValueRootIndex);
1178 __ Jump(masm->isolate()->builtins()->Apply(), RelocInfo::CODE_TARGET); 1178 __ Jump(masm->isolate()->builtins()->Apply(), RelocInfo::CODE_TARGET);
1179 1179
1180 // 3b. The target is not callable, throw an appropriate TypeError. 1180 // 3b. The target is not callable, throw an appropriate TypeError.
1181 __ bind(&target_not_callable); 1181 __ bind(&target_not_callable);
1182 { 1182 {
1183 __ mov(Operand(esp, kPointerSize), edi); 1183 __ mov(Operand(esp, kPointerSize), edi);
1184 __ TailCallRuntime(Runtime::kThrowApplyNonFunction, 1, 1); 1184 __ TailCallRuntime(Runtime::kThrowApplyNonFunction, 1);
1185 } 1185 }
1186 } 1186 }
1187 1187
1188 1188
1189 void Builtins::Generate_ReflectConstruct(MacroAssembler* masm) { 1189 void Builtins::Generate_ReflectConstruct(MacroAssembler* masm) {
1190 // ----------- S t a t e ------------- 1190 // ----------- S t a t e -------------
1191 // -- eax : argc 1191 // -- eax : argc
1192 // -- esp[0] : return address 1192 // -- esp[0] : return address
1193 // -- esp[4] : new.target (optional) 1193 // -- esp[4] : new.target (optional)
1194 // -- esp[8] : argumentsList 1194 // -- esp[8] : argumentsList
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1244 __ test_b(FieldOperand(ecx, Map::kBitFieldOffset), 1 << Map::kIsConstructor); 1244 __ test_b(FieldOperand(ecx, Map::kBitFieldOffset), 1 << Map::kIsConstructor);
1245 __ j(zero, &new_target_not_constructor, Label::kNear); 1245 __ j(zero, &new_target_not_constructor, Label::kNear);
1246 1246
1247 // 4a. Construct the target with the given new.target and argumentsList. 1247 // 4a. Construct the target with the given new.target and argumentsList.
1248 __ Jump(masm->isolate()->builtins()->Apply(), RelocInfo::CODE_TARGET); 1248 __ Jump(masm->isolate()->builtins()->Apply(), RelocInfo::CODE_TARGET);
1249 1249
1250 // 4b. The target is not a constructor, throw an appropriate TypeError. 1250 // 4b. The target is not a constructor, throw an appropriate TypeError.
1251 __ bind(&target_not_constructor); 1251 __ bind(&target_not_constructor);
1252 { 1252 {
1253 __ mov(Operand(esp, kPointerSize), edi); 1253 __ mov(Operand(esp, kPointerSize), edi);
1254 __ TailCallRuntime(Runtime::kThrowCalledNonCallable, 1, 1); 1254 __ TailCallRuntime(Runtime::kThrowCalledNonCallable, 1);
1255 } 1255 }
1256 1256
1257 // 4c. The new.target is not a constructor, throw an appropriate TypeError. 1257 // 4c. The new.target is not a constructor, throw an appropriate TypeError.
1258 __ bind(&new_target_not_constructor); 1258 __ bind(&new_target_not_constructor);
1259 { 1259 {
1260 __ mov(Operand(esp, kPointerSize), edx); 1260 __ mov(Operand(esp, kPointerSize), edx);
1261 __ TailCallRuntime(Runtime::kThrowCalledNonCallable, 1, 1); 1261 __ TailCallRuntime(Runtime::kThrowCalledNonCallable, 1);
1262 } 1262 }
1263 } 1263 }
1264 1264
1265 1265
1266 void Builtins::Generate_InternalArrayCode(MacroAssembler* masm) { 1266 void Builtins::Generate_InternalArrayCode(MacroAssembler* masm) {
1267 // ----------- S t a t e ------------- 1267 // ----------- S t a t e -------------
1268 // -- eax : argc 1268 // -- eax : argc
1269 // -- esp[0] : return address 1269 // -- esp[0] : return address
1270 // -- esp[4] : last argument 1270 // -- esp[4] : last argument
1271 // ----------------------------------- 1271 // -----------------------------------
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
1370 ToStringStub stub(masm->isolate()); 1370 ToStringStub stub(masm->isolate());
1371 __ TailCallStub(&stub); 1371 __ TailCallStub(&stub);
1372 } 1372 }
1373 1373
1374 // 3b. Convert symbol in eax to a string. 1374 // 3b. Convert symbol in eax to a string.
1375 __ bind(&symbol_descriptive_string); 1375 __ bind(&symbol_descriptive_string);
1376 { 1376 {
1377 __ PopReturnAddressTo(ecx); 1377 __ PopReturnAddressTo(ecx);
1378 __ Push(eax); 1378 __ Push(eax);
1379 __ PushReturnAddressFrom(ecx); 1379 __ PushReturnAddressFrom(ecx);
1380 __ TailCallRuntime(Runtime::kSymbolDescriptiveString, 1, 1); 1380 __ TailCallRuntime(Runtime::kSymbolDescriptiveString, 1);
1381 } 1381 }
1382 } 1382 }
1383 1383
1384 1384
1385 // static 1385 // static
1386 void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) { 1386 void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) {
1387 // ----------- S t a t e ------------- 1387 // ----------- S t a t e -------------
1388 // -- eax : number of arguments 1388 // -- eax : number of arguments
1389 // -- edi : constructor function 1389 // -- edi : constructor function
1390 // -- edx : new target 1390 // -- edx : new target
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
1616 ExternalReference::address_of_real_stack_limit(masm->isolate()); 1616 ExternalReference::address_of_real_stack_limit(masm->isolate());
1617 __ mov(ecx, Operand::StaticVariable(real_stack_limit)); 1617 __ mov(ecx, Operand::StaticVariable(real_stack_limit));
1618 // Make ecx the space we have left. The stack might already be overflowed 1618 // Make ecx the space we have left. The stack might already be overflowed
1619 // here which will cause ecx to become negative. 1619 // here which will cause ecx to become negative.
1620 __ neg(ecx); 1620 __ neg(ecx);
1621 __ add(ecx, esp); 1621 __ add(ecx, esp);
1622 __ sar(ecx, kPointerSizeLog2); 1622 __ sar(ecx, kPointerSizeLog2);
1623 // Check if the arguments will overflow the stack. 1623 // Check if the arguments will overflow the stack.
1624 __ cmp(ecx, ebx); 1624 __ cmp(ecx, ebx);
1625 __ j(greater, &done, Label::kNear); // Signed comparison. 1625 __ j(greater, &done, Label::kNear); // Signed comparison.
1626 __ TailCallRuntime(Runtime::kThrowStackOverflow, 1, 1); 1626 __ TailCallRuntime(Runtime::kThrowStackOverflow, 1);
1627 __ bind(&done); 1627 __ bind(&done);
1628 } 1628 }
1629 1629
1630 // ----------- S t a t e ------------- 1630 // ----------- S t a t e -------------
1631 // -- edi : target 1631 // -- edi : target
1632 // -- eax : args (a FixedArray built from argumentsList) 1632 // -- eax : args (a FixedArray built from argumentsList)
1633 // -- ebx : len (number of elements to push from args) 1633 // -- ebx : len (number of elements to push from args)
1634 // -- edx : new.target (checked to be constructor or undefined) 1634 // -- edx : new.target (checked to be constructor or undefined)
1635 // -- esp[0] : return address. 1635 // -- esp[0] : return address.
1636 // -- esp[4] : thisArgument 1636 // -- esp[4] : thisArgument
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
2307 // Compatible receiver check failed: pop return address, arguments and 2307 // Compatible receiver check failed: pop return address, arguments and
2308 // receiver and throw an Illegal Invocation exception. 2308 // receiver and throw an Illegal Invocation exception.
2309 __ bind(&receiver_check_failed); 2309 __ bind(&receiver_check_failed);
2310 __ Pop(eax); 2310 __ Pop(eax);
2311 __ PopReturnAddressTo(ebx); 2311 __ PopReturnAddressTo(ebx);
2312 __ lea(eax, Operand(eax, times_pointer_size, 1 * kPointerSize)); 2312 __ lea(eax, Operand(eax, times_pointer_size, 1 * kPointerSize));
2313 __ add(esp, eax); 2313 __ add(esp, eax);
2314 __ PushReturnAddressFrom(ebx); 2314 __ PushReturnAddressFrom(ebx);
2315 { 2315 {
2316 FrameScope scope(masm, StackFrame::INTERNAL); 2316 FrameScope scope(masm, StackFrame::INTERNAL);
2317 __ TailCallRuntime(Runtime::kThrowIllegalInvocation, 0, 1); 2317 __ TailCallRuntime(Runtime::kThrowIllegalInvocation, 0);
2318 } 2318 }
2319 } 2319 }
2320 2320
2321 2321
2322 void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) { 2322 void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) {
2323 // Lookup the function in the JavaScript frame. 2323 // Lookup the function in the JavaScript frame.
2324 __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); 2324 __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
2325 { 2325 {
2326 FrameScope scope(masm, StackFrame::INTERNAL); 2326 FrameScope scope(masm, StackFrame::INTERNAL);
2327 // Pass function as argument. 2327 // Pass function as argument.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
2372 2372
2373 __ bind(&ok); 2373 __ bind(&ok);
2374 __ ret(0); 2374 __ ret(0);
2375 } 2375 }
2376 2376
2377 #undef __ 2377 #undef __
2378 } // namespace internal 2378 } // namespace internal
2379 } // namespace v8 2379 } // namespace v8
2380 2380
2381 #endif // V8_TARGET_ARCH_IA32 2381 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/builtins.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698