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

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

Issue 1116943002: Function apply(): make all architectures use an IC for performance. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Oops, fixed arm64 failure to push argument. Created 5 years, 7 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/arm64/builtins-arm64.cc ('k') | src/mips64/builtins-mips64.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 5
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #if V8_TARGET_ARCH_MIPS 9 #if V8_TARGET_ARCH_MIPS
10 10
(...skipping 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after
1397 ParameterCount expected(0); 1397 ParameterCount expected(0);
1398 __ InvokeCode(a3, expected, expected, JUMP_FUNCTION, NullCallWrapper()); 1398 __ InvokeCode(a3, expected, expected, JUMP_FUNCTION, NullCallWrapper());
1399 } 1399 }
1400 1400
1401 1401
1402 static void Generate_PushAppliedArguments(MacroAssembler* masm, 1402 static void Generate_PushAppliedArguments(MacroAssembler* masm,
1403 const int argumentsOffset, 1403 const int argumentsOffset,
1404 const int indexOffset, 1404 const int indexOffset,
1405 const int limitOffset) { 1405 const int limitOffset) {
1406 Label entry, loop; 1406 Label entry, loop;
1407 __ lw(a0, MemOperand(fp, indexOffset)); 1407 Register receiver = LoadDescriptor::ReceiverRegister();
1408 Register key = LoadDescriptor::NameRegister();
1409
1410 __ lw(key, MemOperand(fp, indexOffset));
1408 __ Branch(&entry); 1411 __ Branch(&entry);
1409 1412
1410 // Load the current argument from the arguments array and push it to the 1413 // Load the current argument from the arguments array.
1411 // stack.
1412 // a0: current argument index
1413 __ bind(&loop); 1414 __ bind(&loop);
1414 __ lw(a1, MemOperand(fp, argumentsOffset)); 1415 __ lw(receiver, MemOperand(fp, argumentsOffset));
1415 __ Push(a1, a0);
1416 1416
1417 // Call the runtime to access the property in the arguments array. 1417 // Use inline caching to speed up access to arguments.
1418 __ CallRuntime(Runtime::kGetProperty, 2); 1418 Handle<Code> ic = masm->isolate()->builtins()->KeyedLoadIC_Megamorphic();
1419 __ Call(ic, RelocInfo::CODE_TARGET);
1420
1419 __ push(v0); 1421 __ push(v0);
1420 1422
1421 // Use inline caching to access the arguments. 1423 // Use inline caching to access the arguments.
1422 __ lw(a0, MemOperand(fp, indexOffset)); 1424 __ lw(key, MemOperand(fp, indexOffset));
1423 __ Addu(a0, a0, Operand(1 << kSmiTagSize)); 1425 __ Addu(key, key, Operand(1 << kSmiTagSize));
1424 __ sw(a0, MemOperand(fp, indexOffset)); 1426 __ sw(key, MemOperand(fp, indexOffset));
1425 1427
1426 // Test if the copy loop has finished copying all the elements from the 1428 // Test if the copy loop has finished copying all the elements from the
1427 // arguments object. 1429 // arguments object.
1428 __ bind(&entry); 1430 __ bind(&entry);
1429 __ lw(a1, MemOperand(fp, limitOffset)); 1431 __ lw(a1, MemOperand(fp, limitOffset));
1430 __ Branch(&loop, ne, a0, Operand(a1)); 1432 __ Branch(&loop, ne, key, Operand(a1));
1431 1433
1432 // On exit, the pushed arguments count is in a0, untagged 1434 // On exit, the pushed arguments count is in a0, untagged
1435 __ mov(a0, key);
1433 __ SmiUntag(a0); 1436 __ SmiUntag(a0);
1434 } 1437 }
1435 1438
1436 1439
1437 // Used by FunctionApply and ReflectApply 1440 // Used by FunctionApply and ReflectApply
1438 static void Generate_ApplyHelper(MacroAssembler* masm, bool targetIsArgument) { 1441 static void Generate_ApplyHelper(MacroAssembler* masm, bool targetIsArgument) {
1439 const int kFormalParameters = targetIsArgument ? 3 : 2; 1442 const int kFormalParameters = targetIsArgument ? 3 : 2;
1440 const int kStackSize = kFormalParameters + 1; 1443 const int kStackSize = kFormalParameters + 1;
1441 1444
1442 { 1445 {
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
1812 __ break_(0xCC); 1815 __ break_(0xCC);
1813 } 1816 }
1814 } 1817 }
1815 1818
1816 1819
1817 #undef __ 1820 #undef __
1818 1821
1819 } } // namespace v8::internal 1822 } } // namespace v8::internal
1820 1823
1821 #endif // V8_TARGET_ARCH_MIPS 1824 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/arm64/builtins-arm64.cc ('k') | src/mips64/builtins-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698