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

Unified Diff: src/builtins/builtins-string.cc

Issue 2541843006: [stubs] Add LoadFixedArrayElements with int index (Closed)
Patch Set: Address comments Created 4 years 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-regexp.cc ('k') | src/code-stub-assembler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/builtins-string.cc
diff --git a/src/builtins/builtins-string.cc b/src/builtins/builtins-string.cc
index 6aeab6b04f23c60c6560efe134bf2b1dabf13730..c80992359e36f22921213abb27e5944ae296a284 100644
--- a/src/builtins/builtins-string.cc
+++ b/src/builtins/builtins-string.cc
@@ -1281,10 +1281,8 @@ void Builtins::Generate_StringPrototypeIterator(
"String.prototype[Symbol.iterator]");
Node* native_context = assembler.LoadNativeContext(context);
- Node* map = assembler.LoadFixedArrayElement(
- native_context,
- assembler.IntPtrConstant(Context::STRING_ITERATOR_MAP_INDEX), 0,
- CodeStubAssembler::INTPTR_PARAMETERS);
+ Node* map = assembler.LoadContextElement(native_context,
+ Context::STRING_ITERATOR_MAP_INDEX);
Node* iterator = assembler.Allocate(JSStringIterator::kSize);
assembler.StoreMapNoWriteBarrier(iterator, map);
assembler.StoreObjectFieldRoot(iterator, JSValue::kPropertiesOffset,
@@ -1440,10 +1438,8 @@ void Builtins::Generate_StringIteratorPrototypeNext(
assembler.Bind(&return_result);
{
Node* native_context = assembler.LoadNativeContext(context);
- Node* map = assembler.LoadFixedArrayElement(
- native_context,
- assembler.IntPtrConstant(Context::ITERATOR_RESULT_MAP_INDEX), 0,
- CodeStubAssembler::INTPTR_PARAMETERS);
+ Node* map = assembler.LoadContextElement(
+ native_context, Context::ITERATOR_RESULT_MAP_INDEX);
Node* result = assembler.Allocate(JSIteratorResult::kSize);
assembler.StoreMapNoWriteBarrier(result, map);
assembler.StoreObjectFieldRoot(result, JSIteratorResult::kPropertiesOffset,
« no previous file with comments | « src/builtins/builtins-regexp.cc ('k') | src/code-stub-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698