| Index: src/hydrogen-instructions.cc
|
| diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
|
| index e816471ce604561601f90dfd08f41e25ed3d7495..e7ad219964b3946b35e81dbd76011d7e8ff2133f 100644
|
| --- a/src/hydrogen-instructions.cc
|
| +++ b/src/hydrogen-instructions.cc
|
| @@ -947,6 +947,25 @@ void HBoundsCheck::InferRepresentation(HInferRepresentationPhase* h_infer) {
|
| }
|
|
|
|
|
| +Range* HBoundsCheck::InferRange(Zone* zone) {
|
| + Representation r = representation();
|
| + if (r.IsSmiOrInteger32() && length()->HasRange()) {
|
| + int upper = length()->range()->upper() - (allow_equality() ? 0 : 1);
|
| + int lower = 0;
|
| +
|
| + Range* result = new(zone) Range(lower, upper);
|
| + if (index()->HasRange()) {
|
| + result->Intersect(index()->range());
|
| + }
|
| +
|
| + // In case of Smi representation, clamp result to Smi::kMaxValue.
|
| + if (r.IsSmi()) result->ClampToSmi();
|
| + return result;
|
| + }
|
| + return HValue::InferRange(zone);
|
| +}
|
| +
|
| +
|
| void HBoundsCheckBaseIndexInformation::PrintDataTo(StringStream* stream) {
|
| stream->Add("base: ");
|
| base_index()->PrintNameTo(stream);
|
| @@ -1100,9 +1119,6 @@ const char* HUnaryMathOperation::OpName() const {
|
| case kMathRound: return "round";
|
| case kMathAbs: return "abs";
|
| case kMathLog: return "log";
|
| - case kMathSin: return "sin";
|
| - case kMathCos: return "cos";
|
| - case kMathTan: return "tan";
|
| case kMathExp: return "exp";
|
| case kMathSqrt: return "sqrt";
|
| case kMathPowHalf: return "pow-half";
|
| @@ -1262,6 +1278,26 @@ HValue* HBitwise::Canonicalize() {
|
| }
|
|
|
|
|
| +Representation HAdd::RepresentationFromInputs() {
|
| + Representation left_rep = left()->representation();
|
| + if (left_rep.IsExternal()) {
|
| + return Representation::External();
|
| + }
|
| + return HArithmeticBinaryOperation::RepresentationFromInputs();
|
| +}
|
| +
|
| +
|
| +Representation HAdd::RequiredInputRepresentation(int index) {
|
| + if (index == 2) {
|
| + Representation left_rep = left()->representation();
|
| + if (left_rep.IsExternal()) {
|
| + return Representation::Integer32();
|
| + }
|
| + }
|
| + return HArithmeticBinaryOperation::RequiredInputRepresentation(index);
|
| +}
|
| +
|
| +
|
| static bool IsIdentityOperation(HValue* arg1, HValue* arg2, int32_t identity) {
|
| return arg1->representation().IsSpecialization() &&
|
| arg2->EqualsInteger32Constant(identity);
|
| @@ -1497,7 +1533,7 @@ void HCheckInstanceType::GetCheckMaskAndTag(uint8_t* mask, uint8_t* tag) {
|
| *tag = kStringTag;
|
| return;
|
| case IS_INTERNALIZED_STRING:
|
| - *mask = kIsNotInternalizedMask;
|
| + *mask = kIsNotStringMask | kIsNotInternalizedMask;
|
| *tag = kInternalizedTag;
|
| return;
|
| default:
|
| @@ -1740,10 +1776,7 @@ Range* HDiv::InferRange(Zone* zone) {
|
| result->set_can_be_minus_zero(!CheckFlag(kAllUsesTruncatingToInt32) &&
|
| (a->CanBeMinusZero() ||
|
| (a->CanBeZero() && b->CanBeNegative())));
|
| - if (!a->Includes(kMinInt) ||
|
| - !b->Includes(-1) ||
|
| - CheckFlag(kAllUsesTruncatingToInt32)) {
|
| - // It is safe to clear kCanOverflow when kAllUsesTruncatingToInt32.
|
| + if (!a->Includes(kMinInt) || !b->Includes(-1)) {
|
| ClearFlag(HValue::kCanOverflow);
|
| }
|
|
|
| @@ -2462,7 +2495,7 @@ void HEnterInlined::RegisterReturnTarget(HBasicBlock* return_target,
|
|
|
| void HEnterInlined::PrintDataTo(StringStream* stream) {
|
| SmartArrayPointer<char> name = function()->debug_name()->ToCString();
|
| - stream->Add("%s, id=%d", *name, function()->id().ToInt());
|
| + stream->Add("%s, id=%d", name.get(), function()->id().ToInt());
|
| }
|
|
|
|
|
| @@ -3073,7 +3106,7 @@ HCheckMaps* HCheckMaps::New(Zone* zone,
|
| void HLoadNamedGeneric::PrintDataTo(StringStream* stream) {
|
| object()->PrintNameTo(stream);
|
| stream->Add(".");
|
| - stream->Add(*String::cast(*name())->ToCString());
|
| + stream->Add(String::cast(*name())->ToCString().get());
|
| }
|
|
|
|
|
| @@ -3211,7 +3244,7 @@ void HStoreNamedGeneric::PrintDataTo(StringStream* stream) {
|
| object()->PrintNameTo(stream);
|
| stream->Add(".");
|
| ASSERT(name()->IsString());
|
| - stream->Add(*String::cast(*name())->ToCString());
|
| + stream->Add(String::cast(*name())->ToCString().get());
|
| stream->Add(" = ");
|
| value()->PrintNameTo(stream);
|
| }
|
| @@ -3466,7 +3499,7 @@ void HAllocate::HandleSideEffectDominator(GVNFlag side_effect,
|
| HInnerAllocatedObject::New(zone,
|
| context(),
|
| dominator_allocate,
|
| - dominator_size_constant,
|
| + dominator_size,
|
| type());
|
| dominated_allocate_instr->InsertBefore(this);
|
| DeleteAndReplaceWith(dominated_allocate_instr);
|
| @@ -3562,11 +3595,9 @@ void HAllocate::UpdateFreeSpaceFiller(int32_t free_space_size) {
|
| void HAllocate::CreateFreeSpaceFiller(int32_t free_space_size) {
|
| ASSERT(filler_free_space_size_ == NULL);
|
| Zone* zone = block()->zone();
|
| - int32_t dominator_size =
|
| - HConstant::cast(dominating_allocate_->size())->GetInteger32Constant();
|
| HInstruction* free_space_instr =
|
| HInnerAllocatedObject::New(zone, context(), dominating_allocate_,
|
| - dominator_size, type());
|
| + dominating_allocate_->size(), type());
|
| free_space_instr->InsertBefore(this);
|
| HConstant* filler_map = HConstant::New(
|
| zone,
|
| @@ -3822,10 +3853,6 @@ HInstruction* HUnaryMathOperation::New(
|
| }
|
| if (std::isinf(d)) { // +Infinity and -Infinity.
|
| switch (op) {
|
| - case kMathSin:
|
| - case kMathCos:
|
| - case kMathTan:
|
| - return H_CONSTANT_DOUBLE(OS::nan_value());
|
| case kMathExp:
|
| return H_CONSTANT_DOUBLE((d > 0.0) ? d : 0.0);
|
| case kMathLog:
|
| @@ -3843,12 +3870,6 @@ HInstruction* HUnaryMathOperation::New(
|
| }
|
| }
|
| switch (op) {
|
| - case kMathSin:
|
| - return H_CONSTANT_DOUBLE(fast_sin(d));
|
| - case kMathCos:
|
| - return H_CONSTANT_DOUBLE(fast_cos(d));
|
| - case kMathTan:
|
| - return H_CONSTANT_DOUBLE(fast_tan(d));
|
| case kMathExp:
|
| return H_CONSTANT_DOUBLE(fast_exp(d));
|
| case kMathLog:
|
| @@ -4232,6 +4253,29 @@ HObjectAccess HObjectAccess::ForJSObjectOffset(int offset,
|
| }
|
|
|
|
|
| +HObjectAccess HObjectAccess::ForAllocationSiteOffset(int offset) {
|
| + switch (offset) {
|
| + case AllocationSite::kTransitionInfoOffset:
|
| + return HObjectAccess(kInobject, offset, Representation::Tagged());
|
| + case AllocationSite::kNestedSiteOffset:
|
| + return HObjectAccess(kInobject, offset, Representation::Tagged());
|
| + case AllocationSite::kMementoFoundCountOffset:
|
| + return HObjectAccess(kInobject, offset, Representation::Smi());
|
| + case AllocationSite::kMementoCreateCountOffset:
|
| + return HObjectAccess(kInobject, offset, Representation::Smi());
|
| + case AllocationSite::kPretenureDecisionOffset:
|
| + return HObjectAccess(kInobject, offset, Representation::Smi());
|
| + case AllocationSite::kDependentCodeOffset:
|
| + return HObjectAccess(kInobject, offset, Representation::Tagged());
|
| + case AllocationSite::kWeakNextOffset:
|
| + return HObjectAccess(kInobject, offset, Representation::Tagged());
|
| + default:
|
| + UNREACHABLE();
|
| + }
|
| + return HObjectAccess(kInobject, offset);
|
| +}
|
| +
|
| +
|
| HObjectAccess HObjectAccess::ForContextSlot(int index) {
|
| ASSERT(index >= 0);
|
| Portion portion = kInobject;
|
| @@ -4365,11 +4409,15 @@ void HObjectAccess::PrintTo(StringStream* stream) {
|
| break;
|
| case kDouble: // fall through
|
| case kInobject:
|
| - if (!name_.is_null()) stream->Add(*String::cast(*name_)->ToCString());
|
| + if (!name_.is_null()) {
|
| + stream->Add(String::cast(*name_)->ToCString().get());
|
| + }
|
| stream->Add("[in-object]");
|
| break;
|
| case kBackingStore:
|
| - if (!name_.is_null()) stream->Add(*String::cast(*name_)->ToCString());
|
| + if (!name_.is_null()) {
|
| + stream->Add(String::cast(*name_)->ToCString().get());
|
| + }
|
| stream->Add("[backing-store]");
|
| break;
|
| case kExternalMemory:
|
|
|