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

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

Issue 18292018: Insert HTrapAllocationMemento only when required for TransitionElementsKindStub. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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 | « no previous file | no next file » | 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 fad8cfba2b9912a7600b4958d9955d2800ad482f..d8eaae019076f0d09111882c53849433b1d7ee73 100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -528,12 +528,18 @@ Handle<Code> KeyedStoreFastElementStub::GenerateCode() {
template <>
HValue* CodeStubGraphBuilder<TransitionElementsKindStub>::BuildCodeStub() {
+ TransitionElementsKindStub* stub = casted_stub();
+ ElementsKind from_kind = stub->from_kind();
+ ElementsKind to_kind = stub->to_kind();
+
HValue* js_array = GetParameter(0);
HValue* map = GetParameter(1);
info()->MarkAsSavesCallerDoubles();
- Add<HTrapAllocationMemento>(js_array);
+ if (AllocationSite::GetMode(from_kind, to_kind) == TRACK_ALLOCATION_SITE) {
+ Add<HTrapAllocationMemento>(js_array);
+ }
HInstruction* array_length =
AddLoad(js_array, HObjectAccess::ForArrayLength());
@@ -550,9 +556,7 @@ HValue* CodeStubGraphBuilder<TransitionElementsKindStub>::BuildCodeStub() {
HInstruction* elements_length = AddLoadFixedArrayLength(elements);
- BuildGrowElementsCapacity(js_array, elements,
- casted_stub()->from_kind(),
- casted_stub()->to_kind(),
+ BuildGrowElementsCapacity(js_array, elements, from_kind, to_kind,
array_length, elements_length);
if_builder.End();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698