| Index: src/hydrogen-instructions.cc
|
| diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
|
| index f69fbc9b938cc5466d859771eb707ee1b1762c54..a8dfb5bdf78d5f88521850819b15c6761b161502 100644
|
| --- a/src/hydrogen-instructions.cc
|
| +++ b/src/hydrogen-instructions.cc
|
| @@ -2153,6 +2153,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();
|
| @@ -2169,6 +2170,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);
|
| }
|
|
|
| @@ -2187,6 +2191,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());
|
| @@ -2206,6 +2211,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)) {
|
| @@ -2224,6 +2230,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) {
|
| @@ -2252,6 +2259,17 @@ void HConstant::Initialize(Representation r) {
|
| }
|
|
|
|
|
| +bool HConstant::EmitAtUses() {
|
| + ASSERT(IsLinked());
|
| + if (block()->graph()->has_osr_loop_entry()) return true;
|
| + if (representation().IsDouble()) return false;
|
| + if (representation().IsTagged() && UseCount() > 1) {
|
| + return false;
|
| + }
|
| + return true;
|
| +}
|
| +
|
| +
|
| HConstant* HConstant::CopyToRepresentation(Representation r, Zone* zone) const {
|
| if (r.IsSmi() && !has_smi_value_) return NULL;
|
| if (r.IsInteger32() && !has_int32_value_) return NULL;
|
| @@ -3804,6 +3822,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) {
|
|
|