| Index: src/hydrogen-instructions.cc
|
| ===================================================================
|
| --- src/hydrogen-instructions.cc (revision 9808)
|
| +++ src/hydrogen-instructions.cc (working copy)
|
| @@ -587,11 +587,10 @@
|
| HBasicBlock* other_block = other_operand->block();
|
| if (cur_block == other_block) {
|
| if (!other_operand->IsPhi()) {
|
| - HInstruction* cur = cur_block->first();
|
| + HInstruction* cur = this->previous();
|
| while (cur != NULL) {
|
| - ASSERT(cur != this); // We should reach other_operand before!
|
| if (cur == other_operand) break;
|
| - cur = cur->next();
|
| + cur = cur->previous();
|
| }
|
| // Must reach other operand in the same block!
|
| ASSERT(cur == other_operand);
|
| @@ -783,12 +782,21 @@
|
|
|
| void HTypeofIsAndBranch::PrintDataTo(StringStream* stream) {
|
| value()->PrintNameTo(stream);
|
| - stream->Add(" == ");
|
| - stream->Add(type_literal_->GetFlatContent().ToAsciiVector());
|
| + stream->Add(" == %o", *type_literal_);
|
| HControlInstruction::PrintDataTo(stream);
|
| }
|
|
|
|
|
| +HValue* HConstant::Canonicalize() {
|
| + return HasNoUses() && !IsBlockEntry() ? NULL : this;
|
| +}
|
| +
|
| +
|
| +HValue* HTypeof::Canonicalize() {
|
| + return HasNoUses() && !IsBlockEntry() ? NULL : this;
|
| +}
|
| +
|
| +
|
| void HTypeof::PrintDataTo(StringStream* stream) {
|
| value()->PrintNameTo(stream);
|
| }
|
| @@ -1138,15 +1146,16 @@
|
|
|
|
|
| void HSimulate::PrintDataTo(StringStream* stream) {
|
| - stream->Add("id=%d ", ast_id());
|
| - if (pop_count_ > 0) stream->Add("pop %d", pop_count_);
|
| + stream->Add("id=%d", ast_id());
|
| + if (pop_count_ > 0) stream->Add(" pop %d", pop_count_);
|
| if (values_.length() > 0) {
|
| if (pop_count_ > 0) stream->Add(" /");
|
| for (int i = 0; i < values_.length(); ++i) {
|
| - if (!HasAssignedIndexAt(i)) {
|
| + if (i > 0) stream->Add(",");
|
| + if (HasAssignedIndexAt(i)) {
|
| + stream->Add(" var[%d] = ", GetAssignedIndexAt(i));
|
| + } else {
|
| stream->Add(" push ");
|
| - } else {
|
| - stream->Add(" var[%d] = ", GetAssignedIndexAt(i));
|
| }
|
| values_[i]->PrintNameTo(stream);
|
| }
|
| @@ -1227,7 +1236,10 @@
|
|
|
|
|
| bool HArrayLiteral::IsCopyOnWrite() const {
|
| - return constant_elements()->map() == HEAP->fixed_cow_array_map();
|
| + Handle<FixedArray> constant_elements = this->constant_elements();
|
| + FixedArrayBase* constant_elements_values =
|
| + FixedArrayBase::cast(constant_elements->get(1));
|
| + return constant_elements_values->map() == HEAP->fixed_cow_array_map();
|
| }
|
|
|
|
|
| @@ -1392,7 +1404,7 @@
|
| i < types->length() && types_.length() < kMaxLoadPolymorphism;
|
| ++i) {
|
| Handle<Map> map = types->at(i);
|
| - LookupResult lookup;
|
| + LookupResult lookup(map->GetIsolate());
|
| map->LookupInDescriptors(NULL, *name, &lookup);
|
| if (lookup.IsProperty()) {
|
| switch (lookup.type()) {
|
| @@ -1445,14 +1457,14 @@
|
|
|
| void HLoadNamedFieldPolymorphic::PrintDataTo(StringStream* stream) {
|
| object()->PrintNameTo(stream);
|
| - stream->Add(" .");
|
| + stream->Add(".");
|
| stream->Add(*String::cast(*name())->ToCString());
|
| }
|
|
|
|
|
| void HLoadNamedGeneric::PrintDataTo(StringStream* stream) {
|
| object()->PrintNameTo(stream);
|
| - stream->Add(" .");
|
| + stream->Add(".");
|
| stream->Add(*String::cast(*name())->ToCString());
|
| }
|
|
|
| @@ -1549,10 +1561,10 @@
|
| void HStoreNamedField::PrintDataTo(StringStream* stream) {
|
| object()->PrintNameTo(stream);
|
| stream->Add(".");
|
| - ASSERT(name()->IsString());
|
| stream->Add(*String::cast(*name())->ToCString());
|
| stream->Add(" = ");
|
| value()->PrintNameTo(stream);
|
| + stream->Add(" @%d%s", offset(), is_in_object() ? "[in-object]" : "");
|
| if (!transition().is_null()) {
|
| stream->Add(" (transition map %p)", *transition());
|
| }
|
| @@ -1633,6 +1645,12 @@
|
| }
|
|
|
|
|
| +void HTransitionElementsKind::PrintDataTo(StringStream* stream) {
|
| + object()->PrintNameTo(stream);
|
| + stream->Add(" %p -> %p", *original_map(), *transitioned_map());
|
| +}
|
| +
|
| +
|
| void HLoadGlobalCell::PrintDataTo(StringStream* stream) {
|
| stream->Add("[%p]", *cell());
|
| if (!details_.IsDontDelete()) stream->Add(" (deleteable)");
|
| @@ -1746,6 +1764,12 @@
|
| }
|
|
|
|
|
| +HType HChange::CalculateInferredType() {
|
| + if (from().IsDouble() && to().IsTagged()) return HType::HeapNumber();
|
| + return type();
|
| +}
|
| +
|
| +
|
| HType HBitwiseBinaryOperation::CalculateInferredType() {
|
| return HType::TaggedNumber();
|
| }
|
| @@ -1801,6 +1825,31 @@
|
| }
|
|
|
|
|
| +HType HStringCharFromCode::CalculateInferredType() {
|
| + return HType::String();
|
| +}
|
| +
|
| +
|
| +HType HArrayLiteral::CalculateInferredType() {
|
| + return HType::JSArray();
|
| +}
|
| +
|
| +
|
| +HType HObjectLiteral::CalculateInferredType() {
|
| + return HType::JSObject();
|
| +}
|
| +
|
| +
|
| +HType HRegExpLiteral::CalculateInferredType() {
|
| + return HType::JSObject();
|
| +}
|
| +
|
| +
|
| +HType HFunctionLiteral::CalculateInferredType() {
|
| + return HType::JSObject();
|
| +}
|
| +
|
| +
|
| HValue* HUnaryMathOperation::EnsureAndPropagateNotMinusZero(
|
| BitVector* visited) {
|
| visited->Add(id());
|
|
|