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

Unified Diff: src/code-stubs-hydrogen.cc

Issue 726693004: Re-land r25392 Use a stub in crankshaft for grow store arrays. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix. Created 6 years, 1 month 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/code-stubs.cc ('k') | src/hydrogen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs-hydrogen.cc
diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc
index f66670bfe996f4d0bbcc62ef1b104667c3d65ce5..a9cd5b4691c1f3051100ca89742404548bd8d45e 100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -548,6 +548,31 @@ Handle<Code> StoreScriptContextFieldStub::GenerateCode() {
template <>
+HValue* CodeStubGraphBuilder<GrowArrayElementsStub>::BuildCodeStub() {
+ HValue* object = GetParameter(GrowArrayElementsDescriptor::kObjectIndex);
+ HValue* key = GetParameter(GrowArrayElementsDescriptor::kKeyIndex);
+ HValue* current_capacity =
+ GetParameter(GrowArrayElementsDescriptor::kCapacityIndex);
+ ElementsKind kind = casted_stub()->elements_kind();
+
+ HValue* elements = AddLoadElements(object);
+ HValue* length =
+ casted_stub()->is_js_array()
+ ? Add<HLoadNamedField>(object, static_cast<HValue*>(NULL),
+ HObjectAccess::ForArrayLength(kind))
+ : current_capacity;
+
+ return BuildCheckAndGrowElementsCapacity(object, elements, kind, length,
+ current_capacity, key);
+}
+
+
+Handle<Code> GrowArrayElementsStub::GenerateCode() {
+ return DoGenerateCode(this);
+}
+
+
+template <>
HValue* CodeStubGraphBuilder<LoadFastElementStub>::BuildCodeStub() {
HInstruction* load = BuildUncheckedMonomorphicElementAccess(
GetParameter(LoadDescriptor::kReceiverIndex),
« no previous file with comments | « src/code-stubs.cc ('k') | src/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698