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

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

Issue 1120613002: VectorICs: built-in function apply should use an IC. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/ia32/builtins-ia32.cc ('k') | no next file » | 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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_X64 7 #if V8_TARGET_ARCH_X64
8 8
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after
1110 Register key = LoadDescriptor::NameRegister(); 1110 Register key = LoadDescriptor::NameRegister();
1111 1111
1112 // Copy all arguments from the array to the stack. 1112 // Copy all arguments from the array to the stack.
1113 Label entry, loop; 1113 Label entry, loop;
1114 __ movp(key, Operand(rbp, indexOffset)); 1114 __ movp(key, Operand(rbp, indexOffset));
1115 __ jmp(&entry); 1115 __ jmp(&entry);
1116 __ bind(&loop); 1116 __ bind(&loop);
1117 __ movp(receiver, Operand(rbp, argumentsOffset)); // load arguments 1117 __ movp(receiver, Operand(rbp, argumentsOffset)); // load arguments
1118 1118
1119 // Use inline caching to speed up access to arguments. 1119 // Use inline caching to speed up access to arguments.
1120 if (FLAG_vector_ics) { 1120 Handle<Code> ic = masm->isolate()->builtins()->KeyedLoadIC_Megamorphic();
1121 // TODO(mvstanton): Vector-based ics need additional infrastructure to 1121 __ Call(ic, RelocInfo::CODE_TARGET);
1122 // be embedded here. For now, just call the runtime. 1122 // It is important that we do not have a test instruction after the
1123 __ Push(receiver); 1123 // call. A test instruction after the call is used to indicate that
1124 __ Push(key); 1124 // we have generated an inline version of the keyed load. In this
1125 __ CallRuntime(Runtime::kGetProperty, 2); 1125 // case, we know that we are not generating a test instruction next.
1126 } else {
1127 Handle<Code> ic = CodeFactory::KeyedLoadIC(masm->isolate()).code();
1128 __ Call(ic, RelocInfo::CODE_TARGET);
1129 // It is important that we do not have a test instruction after the
1130 // call. A test instruction after the call is used to indicate that
1131 // we have generated an inline version of the keyed load. In this
1132 // case, we know that we are not generating a test instruction next.
1133 }
1134 1126
1135 // Push the nth argument. 1127 // Push the nth argument.
1136 __ Push(rax); 1128 __ Push(rax);
1137 1129
1138 // Update the index on the stack and in register key. 1130 // Update the index on the stack and in register key.
1139 __ movp(key, Operand(rbp, indexOffset)); 1131 __ movp(key, Operand(rbp, indexOffset));
1140 __ SmiAddConstant(key, key, Smi::FromInt(1)); 1132 __ SmiAddConstant(key, key, Smi::FromInt(1));
1141 __ movp(Operand(rbp, indexOffset), key); 1133 __ movp(Operand(rbp, indexOffset), key);
1142 1134
1143 __ bind(&entry); 1135 __ bind(&entry);
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
1751 __ bind(&ok); 1743 __ bind(&ok);
1752 __ ret(0); 1744 __ ret(0);
1753 } 1745 }
1754 1746
1755 1747
1756 #undef __ 1748 #undef __
1757 1749
1758 } } // namespace v8::internal 1750 } } // namespace v8::internal
1759 1751
1760 #endif // V8_TARGET_ARCH_X64 1752 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698