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

Unified Diff: src/ia32/lithium-ia32.h

Issue 6881003: Prevent deopt when assigning double values to typed arrays (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixes to make ia32 tests run Created 9 years, 8 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/ia32/lithium-ia32.h
diff --git a/src/ia32/lithium-ia32.h b/src/ia32/lithium-ia32.h
index 76c90be8c19ccb29ea5852403017198786d45201..440c9e09a827fcf50147f04aa7201a4f2a165332 100644
--- a/src/ia32/lithium-ia32.h
+++ b/src/ia32/lithium-ia32.h
@@ -106,6 +106,7 @@ class LCodeGen;
V(InstanceOf) \
V(InstanceOfAndBranch) \
V(InstanceOfKnownGlobal) \
+ V(Integer32ToClamped) \
V(Integer32ToDouble) \
V(InvokeFunction) \
V(IsNull) \
@@ -1589,6 +1590,16 @@ class LInteger32ToDouble: public LTemplateInstruction<1, 1, 0> {
};
+class LInteger32ToClamped: public LTemplateInstruction<1, 1, 0> {
+ public:
+ explicit LInteger32ToClamped(LOperand* value) {
+ inputs_[0] = value;
+ }
+
+ DECLARE_CONCRETE_INSTRUCTION(Integer32ToClamped, "int32-to-clamped-int-8")
+};
+
+
class LNumberTagI: public LTemplateInstruction<1, 1, 0> {
public:
explicit LNumberTagI(LOperand* value) {
@@ -1613,7 +1624,8 @@ class LNumberTagD: public LTemplateInstruction<1, 1, 1> {
// Sometimes truncating conversion from a tagged value to an int32.
class LDoubleToI: public LTemplateInstruction<1, 1, 1> {
public:
- LDoubleToI(LOperand* value, LOperand* temp) {
+ LDoubleToI(LOperand* value, LOperand* temp, ToIRoundingMode mode)
+ : rounding_mode_(mode) {
inputs_[0] = value;
temps_[0] = temp;
}
@@ -1621,14 +1633,18 @@ class LDoubleToI: public LTemplateInstruction<1, 1, 1> {
DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i")
DECLARE_HYDROGEN_ACCESSOR(Change)
- bool truncating() { return hydrogen()->CanTruncateToInt32(); }
+ ToIRoundingMode rounding_mode() const { return rounding_mode_; }
+
+ private:
+ ToIRoundingMode rounding_mode_;
};
// Truncating conversion from a tagged value to an int32.
class LTaggedToI: public LTemplateInstruction<1, 1, 1> {
public:
- LTaggedToI(LOperand* value, LOperand* temp) {
+ LTaggedToI(LOperand* value, LOperand* temp, ToIRoundingMode mode)
+ : rounding_mode_(mode) {
inputs_[0] = value;
temps_[0] = temp;
}
@@ -1636,7 +1652,10 @@ class LTaggedToI: public LTemplateInstruction<1, 1, 1> {
DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i")
DECLARE_HYDROGEN_ACCESSOR(Change)
- bool truncating() { return hydrogen()->CanTruncateToInt32(); }
+ bool rounding_mode() const { return rounding_mode_; }
+
+ private:
+ ToIRoundingMode rounding_mode_;
};
@@ -1662,17 +1681,20 @@ class LNumberUntagD: public LTemplateInstruction<1, 1, 0> {
class LSmiUntag: public LTemplateInstruction<1, 1, 0> {
public:
- LSmiUntag(LOperand* value, bool needs_check)
- : needs_check_(needs_check) {
+ LSmiUntag(LOperand* value, bool needs_check, bool should_clamp)
+ : needs_check_(needs_check),
+ should_clamp_(should_clamp) {
inputs_[0] = value;
}
DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag")
bool needs_check() const { return needs_check_; }
+ bool should_clamp() const { return should_clamp_; }
private:
bool needs_check_;
+ bool should_clamp_;
};
@@ -1741,16 +1763,14 @@ class LStoreKeyedFastElement: public LTemplateInstruction<0, 3, 0> {
};
-class LStoreKeyedSpecializedArrayElement: public LTemplateInstruction<0, 3, 1> {
+class LStoreKeyedSpecializedArrayElement: public LTemplateInstruction<0, 3, 0> {
public:
LStoreKeyedSpecializedArrayElement(LOperand* external_pointer,
LOperand* key,
- LOperand* val,
- LOperand* temp) {
+ LOperand* val) {
inputs_[0] = external_pointer;
inputs_[1] = key;
inputs_[2] = val;
- temps_[0] = temp;
}
DECLARE_CONCRETE_INSTRUCTION(StoreKeyedSpecializedArrayElement,

Powered by Google App Engine
This is Rietveld 408576698