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

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

Issue 1109333003: Use a stub in crankshaft for grow store arrays. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix ARM failure. Created 5 years, 8 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/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 5a3c0e08ac8883fdabe4a9d0a61ef43cb1dcd119..108c135f34c2a87563df08df2f6eb6519f45eae1 100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -577,6 +577,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() {
LoadKeyedHoleMode hole_mode = casted_stub()->convert_hole_to_undefined()
? CONVERT_HOLE_TO_UNDEFINED
« 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