| Index: src/arm/lithium-arm.cc
|
| diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc
|
| index eeffc167c26d3daf7ab5132d8678ce0de438dd41..5a1d55e791c8f5a62ff414bf63036cdaa2c8cbd5 100644
|
| --- a/src/arm/lithium-arm.cc
|
| +++ b/src/arm/lithium-arm.cc
|
| @@ -256,7 +256,7 @@ void LTypeofIsAndBranch::PrintDataTo(StringStream* stream) {
|
| stream->Add("if typeof ");
|
| value()->PrintTo(stream);
|
| stream->Add(" == \"%s\" then B%d else B%d",
|
| - *hydrogen()->type_literal()->ToCString(),
|
| + hydrogen()->type_literal()->ToCString().get(),
|
| true_block_id(), false_block_id());
|
| }
|
|
|
| @@ -272,7 +272,8 @@ void LStoreCodeEntry::PrintDataTo(StringStream* stream) {
|
| void LInnerAllocatedObject::PrintDataTo(StringStream* stream) {
|
| stream->Add(" = ");
|
| base_object()->PrintTo(stream);
|
| - stream->Add(" + %d", offset());
|
| + stream->Add(" + ");
|
| + offset()->PrintTo(stream);
|
| }
|
|
|
|
|
| @@ -308,13 +309,13 @@ void LCallKeyed::PrintDataTo(StringStream* stream) {
|
|
|
| void LCallNamed::PrintDataTo(StringStream* stream) {
|
| SmartArrayPointer<char> name_string = name()->ToCString();
|
| - stream->Add("%s #%d / ", *name_string, arity());
|
| + stream->Add("%s #%d / ", name_string.get(), arity());
|
| }
|
|
|
|
|
| void LCallGlobal::PrintDataTo(StringStream* stream) {
|
| SmartArrayPointer<char> name_string = name()->ToCString();
|
| - stream->Add("%s #%d / ", *name_string, arity());
|
| + stream->Add("%s #%d / ", name_string.get(), arity());
|
| }
|
|
|
|
|
| @@ -359,7 +360,7 @@ void LStoreNamedField::PrintDataTo(StringStream* stream) {
|
| void LStoreNamedGeneric::PrintDataTo(StringStream* stream) {
|
| object()->PrintTo(stream);
|
| stream->Add(".");
|
| - stream->Add(*String::cast(*name())->ToCString());
|
| + stream->Add(String::cast(*name())->ToCString().get());
|
| stream->Add(" <- ");
|
| value()->PrintTo(stream);
|
| }
|
| @@ -758,13 +759,10 @@ LInstruction* LChunkBuilder::DoArithmeticD(Token::Value op,
|
| ASSERT(instr->left()->representation().IsDouble());
|
| ASSERT(instr->right()->representation().IsDouble());
|
| if (op == Token::MOD) {
|
| - LOperand* left = UseFixedDouble(instr->left(), d1);
|
| - LOperand* right = UseFixedDouble(instr->right(), d2);
|
| + LOperand* left = UseFixedDouble(instr->left(), d0);
|
| + LOperand* right = UseFixedDouble(instr->right(), d1);
|
| LArithmeticD* result = new(zone()) LArithmeticD(op, left, right);
|
| - // We call a C function for double modulo. It can't trigger a GC. We need
|
| - // to use fixed result register for the call.
|
| - // TODO(fschneider): Allow any register as input registers.
|
| - return MarkAsCall(DefineFixedDouble(result, d1), instr);
|
| + return MarkAsCall(DefineFixedDouble(result, d0), instr);
|
| } else {
|
| LOperand* left = UseRegisterAtStart(instr->left());
|
| LOperand* right = UseRegisterAtStart(instr->right());
|
| @@ -1087,7 +1085,7 @@ LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) {
|
| LOperand* receiver = UseRegisterAtStart(instr->receiver());
|
| LOperand* function = UseRegisterAtStart(instr->function());
|
| LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function);
|
| - return AssignEnvironment(DefineSameAsFirst(result));
|
| + return AssignEnvironment(DefineAsRegister(result));
|
| }
|
|
|
|
|
| @@ -1119,11 +1117,11 @@ LInstruction* LChunkBuilder::DoStoreCodeEntry(
|
|
|
|
|
| LInstruction* LChunkBuilder::DoInnerAllocatedObject(
|
| - HInnerAllocatedObject* inner_object) {
|
| - LOperand* base_object = UseRegisterAtStart(inner_object->base_object());
|
| - LInnerAllocatedObject* result =
|
| - new(zone()) LInnerAllocatedObject(base_object);
|
| - return DefineAsRegister(result);
|
| + HInnerAllocatedObject* instr) {
|
| + LOperand* base_object = UseRegisterAtStart(instr->base_object());
|
| + LOperand* offset = UseRegisterOrConstantAtStart(instr->offset());
|
| + return DefineAsRegister(
|
| + new(zone()) LInnerAllocatedObject(base_object, offset));
|
| }
|
|
|
|
|
| @@ -1189,9 +1187,6 @@ LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) {
|
| case kMathRound: return DoMathRound(instr);
|
| case kMathAbs: return DoMathAbs(instr);
|
| case kMathLog: return DoMathLog(instr);
|
| - case kMathSin: return DoMathSin(instr);
|
| - case kMathCos: return DoMathCos(instr);
|
| - case kMathTan: return DoMathTan(instr);
|
| case kMathExp: return DoMathExp(instr);
|
| case kMathSqrt: return DoMathSqrt(instr);
|
| case kMathPowHalf: return DoMathPowHalf(instr);
|
| @@ -1235,27 +1230,6 @@ LInstruction* LChunkBuilder::DoMathLog(HUnaryMathOperation* instr) {
|
| }
|
|
|
|
|
| -LInstruction* LChunkBuilder::DoMathSin(HUnaryMathOperation* instr) {
|
| - LOperand* input = UseFixedDouble(instr->value(), d2);
|
| - LMathSin* result = new(zone()) LMathSin(input);
|
| - return MarkAsCall(DefineFixedDouble(result, d2), instr);
|
| -}
|
| -
|
| -
|
| -LInstruction* LChunkBuilder::DoMathCos(HUnaryMathOperation* instr) {
|
| - LOperand* input = UseFixedDouble(instr->value(), d2);
|
| - LMathCos* result = new(zone()) LMathCos(input);
|
| - return MarkAsCall(DefineFixedDouble(result, d2), instr);
|
| -}
|
| -
|
| -
|
| -LInstruction* LChunkBuilder::DoMathTan(HUnaryMathOperation* instr) {
|
| - LOperand* input = UseFixedDouble(instr->value(), d2);
|
| - LMathTan* result = new(zone()) LMathTan(input);
|
| - return MarkAsCall(DefineFixedDouble(result, d2), instr);
|
| -}
|
| -
|
| -
|
| LInstruction* LChunkBuilder::DoMathExp(HUnaryMathOperation* instr) {
|
| ASSERT(instr->representation().IsDouble());
|
| ASSERT(instr->value()->representation().IsDouble());
|
| @@ -1269,17 +1243,16 @@ LInstruction* LChunkBuilder::DoMathExp(HUnaryMathOperation* instr) {
|
|
|
|
|
| LInstruction* LChunkBuilder::DoMathSqrt(HUnaryMathOperation* instr) {
|
| - LOperand* input = UseRegister(instr->value());
|
| + LOperand* input = UseRegisterAtStart(instr->value());
|
| LMathSqrt* result = new(zone()) LMathSqrt(input);
|
| return DefineAsRegister(result);
|
| }
|
|
|
|
|
| LInstruction* LChunkBuilder::DoMathPowHalf(HUnaryMathOperation* instr) {
|
| - LOperand* input = UseFixedDouble(instr->value(), d2);
|
| - LOperand* temp = FixedTemp(d3);
|
| - LMathPowHalf* result = new(zone()) LMathPowHalf(input, temp);
|
| - return DefineFixedDouble(result, d2);
|
| + LOperand* input = UseRegisterAtStart(instr->value());
|
| + LMathPowHalf* result = new(zone()) LMathPowHalf(input);
|
| + return DefineAsRegister(result);
|
| }
|
|
|
|
|
| @@ -1477,7 +1450,7 @@ LInstruction* LChunkBuilder::DoMod(HMod* instr) {
|
| if (instr->HasPowerOf2Divisor()) {
|
| ASSERT(!right->CanBeZero());
|
| LModI* mod = new(zone()) LModI(UseRegisterAtStart(left),
|
| - UseOrConstant(right));
|
| + UseConstant(right));
|
| LInstruction* result = DefineAsRegister(mod);
|
| return (left->CanBeNegative() &&
|
| instr->CheckFlag(HValue::kBailoutOnMinusZero))
|
| @@ -1667,6 +1640,15 @@ LInstruction* LChunkBuilder::DoAdd(HAdd* instr) {
|
| result = AssignEnvironment(result);
|
| }
|
| return result;
|
| + } else if (instr->representation().IsExternal()) {
|
| + ASSERT(instr->left()->representation().IsExternal());
|
| + ASSERT(instr->right()->representation().IsInteger32());
|
| + ASSERT(!instr->CheckFlag(HValue::kCanOverflow));
|
| + LOperand* left = UseRegisterAtStart(instr->left());
|
| + LOperand* right = UseOrConstantAtStart(instr->right());
|
| + LAddI* add = new(zone()) LAddI(left, right);
|
| + LInstruction* result = DefineAsRegister(add);
|
| + return result;
|
| } else if (instr->representation().IsDouble()) {
|
| if (instr->left()->IsMul()) {
|
| return DoMultiplyAdd(HMul::cast(instr->left()), instr->right());
|
| @@ -1709,12 +1691,12 @@ LInstruction* LChunkBuilder::DoPower(HPower* instr) {
|
| // We need to use fixed result register for the call.
|
| Representation exponent_type = instr->right()->representation();
|
| ASSERT(instr->left()->representation().IsDouble());
|
| - LOperand* left = UseFixedDouble(instr->left(), d1);
|
| + LOperand* left = UseFixedDouble(instr->left(), d0);
|
| LOperand* right = exponent_type.IsDouble() ?
|
| - UseFixedDouble(instr->right(), d2) :
|
| + UseFixedDouble(instr->right(), d1) :
|
| UseFixed(instr->right(), r2);
|
| LPower* result = new(zone()) LPower(left, right);
|
| - return MarkAsCall(DefineFixedDouble(result, d3),
|
| + return MarkAsCall(DefineFixedDouble(result, d2),
|
| instr,
|
| CAN_DEOPTIMIZE_EAGERLY);
|
| }
|
| @@ -2011,7 +1993,7 @@ LInstruction* LChunkBuilder::DoChange(HChange* instr) {
|
| LOperand* value = UseRegisterAtStart(val);
|
| if (val->CheckFlag(HInstruction::kUint32)) {
|
| LNumberTagU* result = new(zone()) LNumberTagU(value);
|
| - return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result)));
|
| + return AssignEnvironment(AssignPointerMap(DefineAsRegister(result)));
|
| } else if (val->HasRange() && val->range()->IsInSmiRange()) {
|
| return DefineAsRegister(new(zone()) LSmiTag(value));
|
| } else {
|
| @@ -2022,8 +2004,8 @@ LInstruction* LChunkBuilder::DoChange(HChange* instr) {
|
| HValue* val = instr->value();
|
| LOperand* value = UseRegister(val);
|
| LInstruction* result = val->CheckFlag(HInstruction::kUint32)
|
| - ? DefineSameAsFirst(new(zone()) LUint32ToSmi(value))
|
| - : DefineSameAsFirst(new(zone()) LInteger32ToSmi(value));
|
| + ? DefineAsRegister(new(zone()) LUint32ToSmi(value))
|
| + : DefineAsRegister(new(zone()) LInteger32ToSmi(value));
|
| if (val->HasRange() && val->range()->IsInSmiRange()) {
|
| return result;
|
| }
|
| @@ -2561,7 +2543,7 @@ LInstruction* LChunkBuilder::DoTypeofIsAndBranch(HTypeofIsAndBranch* instr) {
|
| LInstruction* goto_instr = CheckElideControlInstruction(instr);
|
| if (goto_instr != NULL) return goto_instr;
|
|
|
| - return new(zone()) LTypeofIsAndBranch(UseTempRegister(instr->value()));
|
| + return new(zone()) LTypeofIsAndBranch(UseRegister(instr->value()));
|
| }
|
|
|
|
|
| @@ -2671,5 +2653,4 @@ LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
|
| return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index));
|
| }
|
|
|
| -
|
| } } // namespace v8::internal
|
|
|