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

Unified Diff: src/hydrogen.cc

Issue 15861009: Tag smi-constants as smi. This also fixes code that copies holes into arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 54ae31f0f20196c8e4b61e4e4a28e2d72d1695fe..6bbcfe02b236182368295473e425302e43a621c2 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -603,19 +603,6 @@ HConstant* HGraph::GetConstantInt32(SetOncePointer<HConstant>* pointer,
}
-HConstant* HGraph::GetConstantSmi(SetOncePointer<HConstant>* pointer,
- int32_t value) {
- if (!pointer->is_set()) {
- HConstant* constant =
- new(zone()) HConstant(Handle<Object>(Smi::FromInt(value), isolate()),
- Representation::Tagged());
- constant->InsertAfter(GetConstantUndefined());
- pointer->set(constant);
- }
- return pointer->get();
-}
-
-
HConstant* HGraph::GetConstant0() {
return GetConstantInt32(&constant_0_, 0);
}
@@ -655,16 +642,6 @@ DEFINE_GET_CONSTANT(Hole, the_hole, HType::Tagged(), false)
DEFINE_GET_CONSTANT(Null, null, HType::Tagged(), false)
-HConstant* HGraph::GetConstantSmi0() {
- return GetConstantSmi(&constant_smi_0_, 0);
-}
-
-
-HConstant* HGraph::GetConstantSmi1() {
- return GetConstantSmi(&constant_smi_1_, 1);
-}
-
-
#undef DEFINE_GET_CONSTANT
@@ -1562,6 +1539,12 @@ void HGraphBuilder::BuildFillElementsWithHole(HValue* context,
}
}
+ // Since we're about to store a hole value, the store instruction below must
+ // assume an elements kind that supports heap object values.
+ if (IsFastSmiOrObjectElementsKind(elements_kind)) {
+ elements_kind = FAST_HOLEY_ELEMENTS;
+ }
+
if (unfold_loop) {
for (int i = 0; i < initial_capacity; i++) {
HInstruction* key = AddInstruction(new(zone)
@@ -1608,8 +1591,11 @@ void HGraphBuilder::BuildCopyElements(HValue* context,
from_elements_kind,
ALLOW_RETURN_HOLE));
- AddInstruction(new(zone()) HStoreKeyed(to_elements, key, element,
- to_elements_kind));
+ ElementsKind holey_kind = IsFastSmiElementsKind(to_elements_kind)
+ ? FAST_HOLEY_ELEMENTS : to_elements_kind;
+ HInstruction* holey_store = AddInstruction(
+ new(zone()) HStoreKeyed(to_elements, key, element, holey_kind));
+ holey_store->ClearFlag(HValue::kDeoptimizeOnUndefined);
builder.EndBody();
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698