Index: src/hydrogen-instructions.cc |
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc |
index 98fa93f92bcc23207b39216a64bc6c6159bdae6d..4caea5c413d11faad68cf60a91c99a84a1a12eef 100644 |
--- a/src/hydrogen-instructions.cc |
+++ b/src/hydrogen-instructions.cc |
@@ -2174,6 +2174,7 @@ HConstant::HConstant(Handle<Object> handle, Representation r) |
has_double_value_(false), |
is_internalized_string_(false), |
is_not_in_new_space_(true), |
+ is_cell_(false), |
boolean_value_(handle->BooleanValue()) { |
if (handle_->IsHeapObject()) { |
Heap* heap = Handle<HeapObject>::cast(handle)->GetHeap(); |
@@ -2190,6 +2191,9 @@ HConstant::HConstant(Handle<Object> handle, Representation r) |
type_from_value_ = HType::TypeFromValue(handle_); |
is_internalized_string_ = handle_->IsInternalizedString(); |
} |
+ |
+ is_cell_ = !handle_.is_null() && |
+ (handle_->IsCell() || handle_->IsPropertyCell()); |
Initialize(r); |
} |
@@ -2208,6 +2212,7 @@ HConstant::HConstant(Handle<Object> handle, |
has_double_value_(false), |
is_internalized_string_(is_internalize_string), |
is_not_in_new_space_(is_not_in_new_space), |
+ is_cell_(false), |
boolean_value_(boolean_value), |
type_from_value_(type) { |
ASSERT(!handle.is_null()); |
@@ -2227,6 +2232,7 @@ HConstant::HConstant(int32_t integer_value, |
has_double_value_(true), |
is_internalized_string_(false), |
is_not_in_new_space_(is_not_in_new_space), |
+ is_cell_(false), |
boolean_value_(integer_value != 0), |
int32_value_(integer_value), |
double_value_(FastI2D(integer_value)) { |
@@ -2245,6 +2251,7 @@ HConstant::HConstant(double double_value, |
has_double_value_(true), |
is_internalized_string_(false), |
is_not_in_new_space_(is_not_in_new_space), |
+ is_cell_(false), |
boolean_value_(double_value != 0 && !std::isnan(double_value)), |
int32_value_(DoubleToInt32(double_value)), |
double_value_(double_value) { |
@@ -2267,9 +2274,17 @@ void HConstant::Initialize(Representation r) { |
} |
set_representation(r); |
SetFlag(kUseGVN); |
- if (representation().IsInteger32()) { |
- ClearGVNFlag(kDependsOnOsrEntries); |
+} |
+ |
+ |
+bool HConstant::EmitAtUses() { |
+ ASSERT(IsLinked()); |
+ if (block()->graph()->has_osr_loop_entry()) { |
+ return block()->graph()->IsStandardConstant(this); |
} |
+ if (IsCell()) return false; |
+ if (representation().IsDouble()) return false; |
+ return true; |
} |
@@ -3824,6 +3839,13 @@ HObjectAccess HObjectAccess::ForField(Handle<Map> map, |
} |
+HObjectAccess HObjectAccess::ForCellPayload(Isolate* isolate) { |
+ return HObjectAccess( |
+ kInobject, Cell::kValueOffset, |
+ Handle<String>(isolate->heap()->cell_value_string())); |
+} |
+ |
+ |
void HObjectAccess::SetGVNFlags(HValue *instr, bool is_store) { |
// set the appropriate GVN flags for a given load or store instruction |
if (is_store) { |