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

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

Issue 2682153003: [stubs] Port LoadIndexedStringStub to CSA (Closed)
Patch Set: move to builtins-handler.cc Created 3 years, 10 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/builtins.h ('k') | src/builtins/builtins-string.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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/builtins/builtins-utils.h" 5 #include "src/builtins/builtins-utils.h"
6 #include "src/builtins/builtins.h" 6 #include "src/builtins/builtins.h"
7 #include "src/code-stub-assembler.h" 7 #include "src/code-stub-assembler.h"
8 #include "src/ic/handler-compiler.h" 8 #include "src/ic/handler-compiler.h"
9 #include "src/ic/ic.h" 9 #include "src/ic/ic.h"
10 #include "src/ic/keyed-store-generic.h" 10 #include "src/ic/keyed-store-generic.h"
11 11
12 namespace v8 { 12 namespace v8 {
13 namespace internal { 13 namespace internal {
14 14
15 TF_BUILTIN(KeyedLoadIC_IndexedString, CodeStubAssembler) {
16 typedef LoadWithVectorDescriptor Descriptor;
17
18 Node* receiver = Parameter(Descriptor::kReceiver);
19 Node* index = Parameter(Descriptor::kName);
20 Node* slot = Parameter(Descriptor::kSlot);
21 Node* vector = Parameter(Descriptor::kVector);
22 Node* context = Parameter(Descriptor::kContext);
23
24 Label miss(this);
25
26 Node* index_intptr = TryToIntptr(index, &miss);
27 Node* length = SmiUntag(LoadStringLength(receiver));
28 GotoIf(UintPtrGreaterThanOrEqual(index_intptr, length), &miss);
29
30 Node* code = StringCharCodeAt(receiver, index_intptr, INTPTR_PARAMETERS);
31 Node* result = StringFromCharCode(code);
32 Return(result);
33
34 Bind(&miss);
35 TailCallRuntime(Runtime::kKeyedLoadIC_Miss, context, receiver, index, slot,
36 vector);
37 }
38
15 TF_BUILTIN(KeyedLoadIC_Miss, CodeStubAssembler) { 39 TF_BUILTIN(KeyedLoadIC_Miss, CodeStubAssembler) {
16 typedef LoadWithVectorDescriptor Descriptor; 40 typedef LoadWithVectorDescriptor Descriptor;
17 41
18 Node* receiver = Parameter(Descriptor::kReceiver); 42 Node* receiver = Parameter(Descriptor::kReceiver);
19 Node* name = Parameter(Descriptor::kName); 43 Node* name = Parameter(Descriptor::kName);
20 Node* slot = Parameter(Descriptor::kSlot); 44 Node* slot = Parameter(Descriptor::kSlot);
21 Node* vector = Parameter(Descriptor::kVector); 45 Node* vector = Parameter(Descriptor::kVector);
22 Node* context = Parameter(Descriptor::kContext); 46 Node* context = Parameter(Descriptor::kContext);
23 47
24 TailCallRuntime(Runtime::kKeyedLoadIC_Miss, context, receiver, name, slot, 48 TailCallRuntime(Runtime::kKeyedLoadIC_Miss, context, receiver, name, slot,
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 TailCallRuntime(Runtime::kStoreIC_Miss, context, value, slot, vector, 233 TailCallRuntime(Runtime::kStoreIC_Miss, context, value, slot, vector,
210 receiver, name); 234 receiver, name);
211 } 235 }
212 236
213 void Builtins::Generate_StoreIC_Setter_ForDeopt(MacroAssembler* masm) { 237 void Builtins::Generate_StoreIC_Setter_ForDeopt(MacroAssembler* masm) {
214 NamedStoreHandlerCompiler::GenerateStoreViaSetterForDeopt(masm); 238 NamedStoreHandlerCompiler::GenerateStoreViaSetterForDeopt(masm);
215 } 239 }
216 240
217 } // namespace internal 241 } // namespace internal
218 } // namespace v8 242 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins/builtins.h ('k') | src/builtins/builtins-string.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698