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

Unified Diff: src/hydrogen-instructions.cc

Issue 11659022: Generate the TransitionElementsStub using Crankshaft (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review feedback Created 7 years, 10 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-instructions.h ('k') | src/ia32/assembler-ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index 4163b50045d8c61a114efbe119d5566e9f24db2e..11cc901b38ccfccf7a3607f99e1088b47b7f4ac9 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -2171,23 +2171,34 @@ void HLoadKeyed::PrintDataTo(StringStream* stream) {
}
-bool HLoadKeyed::RequiresHoleCheck() const {
+bool HLoadKeyed::UsesMustHandleHole() const {
if (IsFastPackedElementsKind(elements_kind())) {
return false;
}
+ if (hole_mode() == ALLOW_RETURN_HOLE) return true;
+
if (IsFastDoubleElementsKind(elements_kind())) {
- return true;
+ return false;
}
for (HUseIterator it(uses()); !it.Done(); it.Advance()) {
HValue* use = it.value();
if (!use->IsChange()) {
- return true;
+ return false;
}
}
- return false;
+ return true;
+}
+
+
+bool HLoadKeyed::RequiresHoleCheck() const {
+ if (IsFastPackedElementsKind(elements_kind())) {
+ return false;
+ }
+
+ return !UsesMustHandleHole();
}
@@ -2461,6 +2472,11 @@ HType HAllocateObject::CalculateInferredType() {
}
+HType HAllocate::CalculateInferredType() {
+ return type_;
+}
+
+
HType HFastLiteral::CalculateInferredType() {
// TODO(mstarzinger): Be smarter, could also be JSArray here.
return HType::JSObject();
@@ -2582,12 +2598,21 @@ HValue* HAdd::EnsureAndPropagateNotMinusZero(BitVector* visited) {
bool HStoreKeyed::NeedsCanonicalization() {
- // If value is an integer or comes from the result of a keyed load
- // then it will be a non-hole value: no need for canonicalization.
- if (value()->IsLoadKeyed() ||
- (value()->IsChange() && HChange::cast(value())->from().IsInteger32())) {
+ // If value is an integer or smi or comes from the result of a keyed load or
+ // constant then it is either be a non-hole value or in the case of a constant
+ // the hole is only being stored explicitly: no need for canonicalization.
+ if (value()->IsLoadKeyed() || value()->IsConstant()) {
return false;
}
+
+ if (value()->IsChange()) {
+ if (HChange::cast(value())->from().IsInteger32()) {
+ return false;
+ }
+ if (HChange::cast(value())->value()->type().IsSmi()) {
+ return false;
+ }
+ }
return true;
}
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698