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

Unified Diff: src/hydrogen-instructions.cc

Issue 12208013: Separated smi check from HBoundsCheck. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed review comments. 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
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index 11cc901b38ccfccf7a3607f99e1088b47b7f4ac9..4b91a8568c37ae720f37b2a4ea5111d784384ec0 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -829,9 +829,8 @@ void HBoundsCheck::InferRepresentation(HInferRepresentation* h_infer) {
!length()->representation().IsTagged()) {
r = Representation::Integer32();
} else if (index()->representation().IsTagged() ||
- (index()->IsConstant() &&
- HConstant::cast(index())->HasInteger32Value() &&
- Smi::IsValid(HConstant::cast(index())->Integer32Value()))) {
+ (index()->ActualValue()->IsConstant() &&
+ HConstant::cast(index()->ActualValue())->HasSmiValue())) {
// If the index is tagged, or a constant that holds a Smi, allow the length
// to be tagged, since it is usually already tagged from loading it out of
// the length field of a JSArray. This allows for direct comparison without
@@ -2392,6 +2391,15 @@ HType HCheckSmi::CalculateInferredType() {
}
+void HCheckSmiOrInt32::InferRepresentation(
+ HInferRepresentation* h_infer) {
Jakob Kummerow 2013/02/07 16:17:14 nit: fits on one line now.
Massi 2013/02/11 10:35:55 Done.
+ ASSERT(CheckFlag(kFlexibleRepresentation));
+ Representation r = value()->representation().IsTagged()
+ ? Representation::Tagged() : Representation::Integer32();
+ UpdateRepresentation(r, h_infer, "checksmiorint32");
+}
+
+
HType HPhi::CalculateInferredType() {
HType result = HType::Uninitialized();
for (int i = 0; i < OperandCount(); ++i) {
@@ -2927,6 +2935,11 @@ void HCheckSmi::Verify() {
}
+void HCheckSmiOrInt32::Verify() {
+ HInstruction::Verify();
+}
+
+
void HCheckNonSmi::Verify() {
HInstruction::Verify();
ASSERT(HasNoUses());

Powered by Google App Engine
This is Rietveld 408576698