| Index: src/hydrogen-instructions.cc
|
| diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
|
| index 859c1ed8d90a961ae4e8b6d07db98436067d1c7f..f93df27f62d68866dcd9f10e0f3c60dd06f60caa 100644
|
| --- a/src/hydrogen-instructions.cc
|
| +++ b/src/hydrogen-instructions.cc
|
| @@ -2175,6 +2175,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();
|
| @@ -2191,6 +2192,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);
|
| }
|
|
|
| @@ -2201,6 +2205,7 @@ HConstant::HConstant(Handle<Object> handle,
|
| HType type,
|
| bool is_internalize_string,
|
| bool is_not_in_new_space,
|
| + bool is_cell,
|
| bool boolean_value)
|
| : handle_(handle),
|
| unique_id_(unique_id),
|
| @@ -2209,6 +2214,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_(is_cell),
|
| boolean_value_(boolean_value),
|
| type_from_value_(type) {
|
| ASSERT(!handle.is_null());
|
| @@ -2228,6 +2234,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)) {
|
| @@ -2246,6 +2253,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) {
|
| @@ -2268,9 +2276,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()) {
|
| + return block()->graph()->IsStandardConstant(this);
|
| }
|
| + if (IsCell()) return false;
|
| + if (representation().IsDouble()) return false;
|
| + return true;
|
| }
|
|
|
|
|
| @@ -2291,6 +2307,7 @@ HConstant* HConstant::CopyToRepresentation(Representation r, Zone* zone) const {
|
| type_from_value_,
|
| is_internalized_string_,
|
| is_not_in_new_space_,
|
| + is_cell_,
|
| boolean_value_);
|
| }
|
|
|
| @@ -3830,6 +3847,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) {
|
|
|