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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/builtins/builtins.h ('k') | src/builtins/builtins-string.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/builtins-handler.cc
diff --git a/src/builtins/builtins-handler.cc b/src/builtins/builtins-handler.cc
index 2ff5309159679652a0b776ec33ffbf55250ed44f..363132b007dfdf024f53bd9e7f33d9aab8ecf937 100644
--- a/src/builtins/builtins-handler.cc
+++ b/src/builtins/builtins-handler.cc
@@ -12,6 +12,30 @@
namespace v8 {
namespace internal {
+TF_BUILTIN(KeyedLoadIC_IndexedString, CodeStubAssembler) {
+ typedef LoadWithVectorDescriptor Descriptor;
+
+ Node* receiver = Parameter(Descriptor::kReceiver);
+ Node* index = Parameter(Descriptor::kName);
+ Node* slot = Parameter(Descriptor::kSlot);
+ Node* vector = Parameter(Descriptor::kVector);
+ Node* context = Parameter(Descriptor::kContext);
+
+ Label miss(this);
+
+ Node* index_intptr = TryToIntptr(index, &miss);
+ Node* length = SmiUntag(LoadStringLength(receiver));
+ GotoIf(UintPtrGreaterThanOrEqual(index_intptr, length), &miss);
+
+ Node* code = StringCharCodeAt(receiver, index_intptr, INTPTR_PARAMETERS);
+ Node* result = StringFromCharCode(code);
+ Return(result);
+
+ Bind(&miss);
+ TailCallRuntime(Runtime::kKeyedLoadIC_Miss, context, receiver, index, slot,
+ vector);
+}
+
TF_BUILTIN(KeyedLoadIC_Miss, CodeStubAssembler) {
typedef LoadWithVectorDescriptor Descriptor;
« 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