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

Side by Side Diff: src/code-stubs-hydrogen.cc

Issue 1124443004: New hydrogen instruction to reduce cost of growing an array on keyed stores. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Created 5 years, 7 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/arm64/lithium-codegen-arm64.cc ('k') | src/hydrogen.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/bailout-reason.h" 7 #include "src/bailout-reason.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/field-index.h" 9 #include "src/field-index.h"
10 #include "src/hydrogen.h" 10 #include "src/hydrogen.h"
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 689
690 template <> 690 template <>
691 HValue* CodeStubGraphBuilder<GrowArrayElementsStub>::BuildCodeStub() { 691 HValue* CodeStubGraphBuilder<GrowArrayElementsStub>::BuildCodeStub() {
692 ElementsKind kind = casted_stub()->elements_kind(); 692 ElementsKind kind = casted_stub()->elements_kind();
693 if (IsFastDoubleElementsKind(kind)) { 693 if (IsFastDoubleElementsKind(kind)) {
694 info()->MarkAsSavesCallerDoubles(); 694 info()->MarkAsSavesCallerDoubles();
695 } 695 }
696 696
697 HValue* object = GetParameter(GrowArrayElementsDescriptor::kObjectIndex); 697 HValue* object = GetParameter(GrowArrayElementsDescriptor::kObjectIndex);
698 HValue* key = GetParameter(GrowArrayElementsDescriptor::kKeyIndex); 698 HValue* key = GetParameter(GrowArrayElementsDescriptor::kKeyIndex);
699 HValue* current_capacity =
700 GetParameter(GrowArrayElementsDescriptor::kCapacityIndex);
701 699
702 HValue* elements = AddLoadElements(object); 700 HValue* elements = AddLoadElements(object);
701 HValue* current_capacity = Add<HLoadNamedField>(
702 elements, nullptr, HObjectAccess::ForFixedArrayLength());
703
703 HValue* length = 704 HValue* length =
704 casted_stub()->is_js_array() 705 casted_stub()->is_js_array()
705 ? Add<HLoadNamedField>(object, static_cast<HValue*>(NULL), 706 ? Add<HLoadNamedField>(object, static_cast<HValue*>(NULL),
706 HObjectAccess::ForArrayLength(kind)) 707 HObjectAccess::ForArrayLength(kind))
707 : current_capacity; 708 : current_capacity;
708 709
709 return BuildCheckAndGrowElementsCapacity(object, elements, kind, length, 710 return BuildCheckAndGrowElementsCapacity(object, elements, kind, length,
710 current_capacity, key); 711 current_capacity, key);
711 } 712 }
712 713
(...skipping 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after
2223 // need. 2224 // need.
2224 info()->MarkMustNotHaveEagerFrame(); 2225 info()->MarkMustNotHaveEagerFrame();
2225 2226
2226 // Probe the stub cache. 2227 // Probe the stub cache.
2227 Add<HTailCallThroughMegamorphicCache>(receiver, name); 2228 Add<HTailCallThroughMegamorphicCache>(receiver, name);
2228 2229
2229 // We never continue. 2230 // We never continue.
2230 return graph()->GetConstant0(); 2231 return graph()->GetConstant0();
2231 } 2232 }
2232 } } // namespace v8::internal 2233 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm64/lithium-codegen-arm64.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698