Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Unified Diff: src/ppc/lithium-ppc.cc

Issue 422063005: Contribution of PowerPC port. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: re-upload - catch up to 8/19 level Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/ppc/lithium-ppc.cc
diff --git a/src/arm/lithium-arm.cc b/src/ppc/lithium-ppc.cc
similarity index 75%
copy from src/arm/lithium-arm.cc
copy to src/ppc/lithium-ppc.cc
index 6b86088ee7c9462469abb1a21af4559a0b2a0b8e..54c41030a6d72b7693255ae77a14ab9e911f68e9 100644
--- a/src/arm/lithium-arm.cc
+++ b/src/ppc/lithium-ppc.cc
@@ -1,19 +1,22 @@
// Copyright 2012 the V8 project authors. All rights reserved.
+//
+// Copyright IBM Corp. 2012, 2013. All rights reserved.
+//
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/v8.h"
-#include "src/arm/lithium-codegen-arm.h"
#include "src/hydrogen-osr.h"
#include "src/lithium-inl.h"
+#include "src/ppc/lithium-codegen-ppc.h"
namespace v8 {
namespace internal {
-#define DEFINE_COMPILE(type) \
- void L##type::CompileToNative(LCodeGen* generator) { \
- generator->Do##type(this); \
+#define DEFINE_COMPILE(type) \
+ void L##type::CompileToNative(LCodeGen* generator) { \
+ generator->Do##type(this); \
}
LITHIUM_CONCRETE_INSTRUCTION_LIST(DEFINE_COMPILE)
#undef DEFINE_COMPILE
@@ -24,17 +27,15 @@ void LInstruction::VerifyCall() {
// outputs because all registers are blocked by the calling convention.
// Inputs operands must use a fixed register or use-at-start policy or
// a non-register policy.
- DCHECK(Output() == NULL ||
- LUnallocated::cast(Output())->HasFixedPolicy() ||
+ DCHECK(Output() == NULL || LUnallocated::cast(Output())->HasFixedPolicy() ||
!LUnallocated::cast(Output())->HasRegisterPolicy());
for (UseIterator it(this); !it.Done(); it.Advance()) {
LUnallocated* operand = LUnallocated::cast(it.Current());
- DCHECK(operand->HasFixedPolicy() ||
- operand->IsUsedAtStart());
+ DCHECK(operand->HasFixedPolicy() || operand->IsUsedAtStart());
}
for (TempIterator it(this); !it.Done(); it.Advance()) {
LUnallocated* operand = LUnallocated::cast(it.Current());
- DCHECK(operand->HasFixedPolicy() ||!operand->HasRegisterPolicy());
+ DCHECK(operand->HasFixedPolicy() || !operand->HasRegisterPolicy());
}
}
#endif
@@ -110,11 +111,16 @@ void LGap::PrintDataTo(StringStream* stream) {
const char* LArithmeticD::Mnemonic() const {
switch (op()) {
- case Token::ADD: return "add-d";
- case Token::SUB: return "sub-d";
- case Token::MUL: return "mul-d";
- case Token::DIV: return "div-d";
- case Token::MOD: return "mod-d";
+ case Token::ADD:
+ return "add-d";
+ case Token::SUB:
+ return "sub-d";
+ case Token::MUL:
+ return "mul-d";
+ case Token::DIV:
+ return "div-d";
+ case Token::MOD:
+ return "mod-d";
default:
UNREACHABLE();
return NULL;
@@ -124,18 +130,30 @@ const char* LArithmeticD::Mnemonic() const {
const char* LArithmeticT::Mnemonic() const {
switch (op()) {
- case Token::ADD: return "add-t";
- case Token::SUB: return "sub-t";
- case Token::MUL: return "mul-t";
- case Token::MOD: return "mod-t";
- case Token::DIV: return "div-t";
- case Token::BIT_AND: return "bit-and-t";
- case Token::BIT_OR: return "bit-or-t";
- case Token::BIT_XOR: return "bit-xor-t";
- case Token::ROR: return "ror-t";
- case Token::SHL: return "shl-t";
- case Token::SAR: return "sar-t";
- case Token::SHR: return "shr-t";
+ case Token::ADD:
+ return "add-t";
+ case Token::SUB:
+ return "sub-t";
+ case Token::MUL:
+ return "mul-t";
+ case Token::MOD:
+ return "mod-t";
+ case Token::DIV:
+ return "div-t";
+ case Token::BIT_AND:
+ return "bit-and-t";
+ case Token::BIT_OR:
+ return "bit-or-t";
+ case Token::BIT_XOR:
+ return "bit-xor-t";
+ case Token::ROR:
+ return "ror-t";
+ case Token::SHL:
+ return "shl-t";
+ case Token::SAR:
+ return "sar-t";
+ case Token::SHR:
+ return "shr-t";
default:
UNREACHABLE();
return NULL;
@@ -221,10 +239,8 @@ void LHasCachedArrayIndexAndBranch::PrintDataTo(StringStream* stream) {
void LClassOfTestAndBranch::PrintDataTo(StringStream* stream) {
stream->Add("if class_of_test(");
value()->PrintTo(stream);
- stream->Add(", \"%o\") then B%d else B%d",
- *hydrogen()->class_name(),
- true_block_id(),
- false_block_id());
+ stream->Add(", \"%o\") then B%d else B%d", *hydrogen()->class_name(),
+ true_block_id(), false_block_id());
}
@@ -232,8 +248,8 @@ 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().get(),
- true_block_id(), false_block_id());
+ hydrogen()->type_literal()->ToCString().get(), true_block_id(),
+ false_block_id());
}
@@ -386,7 +402,7 @@ int LPlatformChunk::GetNextSpillIndex(RegisterKind kind) {
}
-LOperand* LPlatformChunk::GetNextSpillSlot(RegisterKind kind) {
+LOperand* LPlatformChunk::GetNextSpillSlot(RegisterKind kind) {
int index = GetNextSpillIndex(kind);
if (kind == DOUBLE_REGISTERS) {
return LDoubleStackSlot::Create(index, zone());
@@ -399,7 +415,7 @@ LOperand* LPlatformChunk::GetNextSpillSlot(RegisterKind kind) {
LPlatformChunk* LChunkBuilder::Build() {
DCHECK(is_unused());
- chunk_ = new(zone()) LPlatformChunk(info(), graph());
+ chunk_ = new (zone()) LPlatformChunk(info(), graph());
LPhase phase("L_Building chunk", chunk_);
status_ = BUILDING;
@@ -430,14 +446,14 @@ void LChunkBuilder::Abort(BailoutReason reason) {
LUnallocated* LChunkBuilder::ToUnallocated(Register reg) {
- return new(zone()) LUnallocated(LUnallocated::FIXED_REGISTER,
- Register::ToAllocationIndex(reg));
+ return new (zone()) LUnallocated(LUnallocated::FIXED_REGISTER,
+ Register::ToAllocationIndex(reg));
}
LUnallocated* LChunkBuilder::ToUnallocated(DoubleRegister reg) {
- return new(zone()) LUnallocated(LUnallocated::FIXED_DOUBLE_REGISTER,
- DoubleRegister::ToAllocationIndex(reg));
+ return new (zone()) LUnallocated(LUnallocated::FIXED_DOUBLE_REGISTER,
+ DoubleRegister::ToAllocationIndex(reg));
}
@@ -452,58 +468,58 @@ LOperand* LChunkBuilder::UseFixedDouble(HValue* value, DoubleRegister reg) {
LOperand* LChunkBuilder::UseRegister(HValue* value) {
- return Use(value, new(zone()) LUnallocated(LUnallocated::MUST_HAVE_REGISTER));
+ return Use(value,
+ new (zone()) LUnallocated(LUnallocated::MUST_HAVE_REGISTER));
}
LOperand* LChunkBuilder::UseRegisterAtStart(HValue* value) {
- return Use(value,
- new(zone()) LUnallocated(LUnallocated::MUST_HAVE_REGISTER,
- LUnallocated::USED_AT_START));
+ return Use(value, new (zone()) LUnallocated(LUnallocated::MUST_HAVE_REGISTER,
+ LUnallocated::USED_AT_START));
}
LOperand* LChunkBuilder::UseTempRegister(HValue* value) {
- return Use(value, new(zone()) LUnallocated(LUnallocated::WRITABLE_REGISTER));
+ return Use(value, new (zone()) LUnallocated(LUnallocated::WRITABLE_REGISTER));
}
LOperand* LChunkBuilder::Use(HValue* value) {
- return Use(value, new(zone()) LUnallocated(LUnallocated::NONE));
+ return Use(value, new (zone()) LUnallocated(LUnallocated::NONE));
}
LOperand* LChunkBuilder::UseAtStart(HValue* value) {
- return Use(value, new(zone()) LUnallocated(LUnallocated::NONE,
- LUnallocated::USED_AT_START));
+ return Use(value, new (zone())
+ LUnallocated(LUnallocated::NONE, LUnallocated::USED_AT_START));
}
LOperand* LChunkBuilder::UseOrConstant(HValue* value) {
return value->IsConstant()
- ? chunk_->DefineConstantOperand(HConstant::cast(value))
- : Use(value);
+ ? chunk_->DefineConstantOperand(HConstant::cast(value))
+ : Use(value);
}
LOperand* LChunkBuilder::UseOrConstantAtStart(HValue* value) {
return value->IsConstant()
- ? chunk_->DefineConstantOperand(HConstant::cast(value))
- : UseAtStart(value);
+ ? chunk_->DefineConstantOperand(HConstant::cast(value))
+ : UseAtStart(value);
}
LOperand* LChunkBuilder::UseRegisterOrConstant(HValue* value) {
return value->IsConstant()
- ? chunk_->DefineConstantOperand(HConstant::cast(value))
- : UseRegister(value);
+ ? chunk_->DefineConstantOperand(HConstant::cast(value))
+ : UseRegister(value);
}
LOperand* LChunkBuilder::UseRegisterOrConstantAtStart(HValue* value) {
return value->IsConstant()
- ? chunk_->DefineConstantOperand(HConstant::cast(value))
- : UseRegisterAtStart(value);
+ ? chunk_->DefineConstantOperand(HConstant::cast(value))
+ : UseRegisterAtStart(value);
}
@@ -514,8 +530,8 @@ LOperand* LChunkBuilder::UseConstant(HValue* value) {
LOperand* LChunkBuilder::UseAny(HValue* value) {
return value->IsConstant()
- ? chunk_->DefineConstantOperand(HConstant::cast(value))
- : Use(value, new(zone()) LUnallocated(LUnallocated::ANY));
+ ? chunk_->DefineConstantOperand(HConstant::cast(value))
+ : Use(value, new (zone()) LUnallocated(LUnallocated::ANY));
}
@@ -540,26 +556,26 @@ LInstruction* LChunkBuilder::Define(LTemplateResultInstruction<1>* instr,
LInstruction* LChunkBuilder::DefineAsRegister(
LTemplateResultInstruction<1>* instr) {
return Define(instr,
- new(zone()) LUnallocated(LUnallocated::MUST_HAVE_REGISTER));
+ new (zone()) LUnallocated(LUnallocated::MUST_HAVE_REGISTER));
}
LInstruction* LChunkBuilder::DefineAsSpilled(
LTemplateResultInstruction<1>* instr, int index) {
return Define(instr,
- new(zone()) LUnallocated(LUnallocated::FIXED_SLOT, index));
+ new (zone()) LUnallocated(LUnallocated::FIXED_SLOT, index));
}
LInstruction* LChunkBuilder::DefineSameAsFirst(
LTemplateResultInstruction<1>* instr) {
return Define(instr,
- new(zone()) LUnallocated(LUnallocated::SAME_AS_FIRST_INPUT));
+ new (zone()) LUnallocated(LUnallocated::SAME_AS_FIRST_INPUT));
}
-LInstruction* LChunkBuilder::DefineFixed(
- LTemplateResultInstruction<1>* instr, Register reg) {
+LInstruction* LChunkBuilder::DefineFixed(LTemplateResultInstruction<1>* instr,
+ Register reg) {
return Define(instr, ToUnallocated(reg));
}
@@ -574,9 +590,8 @@ LInstruction* LChunkBuilder::AssignEnvironment(LInstruction* instr) {
HEnvironment* hydrogen_env = current_block_->last_environment();
int argument_index_accumulator = 0;
ZoneList<HValue*> objects_to_materialize(0, zone());
- instr->set_environment(CreateEnvironment(hydrogen_env,
- &argument_index_accumulator,
- &objects_to_materialize));
+ instr->set_environment(CreateEnvironment(
+ hydrogen_env, &argument_index_accumulator, &objects_to_materialize));
return instr;
}
@@ -595,9 +610,8 @@ LInstruction* LChunkBuilder::MarkAsCall(LInstruction* instr,
// after the call will try to deoptimize to the point before the call.
// Thus we still need to attach environment to this call even if
// call sequence can not deoptimize eagerly.
- bool needs_environment =
- (can_deoptimize == CAN_DEOPTIMIZE_EAGERLY) ||
- !hinstr->HasObservableSideEffects();
+ bool needs_environment = (can_deoptimize == CAN_DEOPTIMIZE_EAGERLY) ||
+ !hinstr->HasObservableSideEffects();
if (needs_environment && !instr->HasEnvironment()) {
instr = AssignEnvironment(instr);
// We can't really figure out if the environment is needed or not.
@@ -610,14 +624,14 @@ LInstruction* LChunkBuilder::MarkAsCall(LInstruction* instr,
LInstruction* LChunkBuilder::AssignPointerMap(LInstruction* instr) {
DCHECK(!instr->HasPointerMap());
- instr->set_pointer_map(new(zone()) LPointerMap(zone()));
+ instr->set_pointer_map(new (zone()) LPointerMap(zone()));
return instr;
}
LUnallocated* LChunkBuilder::TempRegister() {
LUnallocated* operand =
- new(zone()) LUnallocated(LUnallocated::MUST_HAVE_REGISTER);
+ new (zone()) LUnallocated(LUnallocated::MUST_HAVE_REGISTER);
int vreg = allocator_->GetVirtualRegister();
if (!allocator_->AllocationOk()) {
Abort(kOutOfVirtualRegistersWhileTryingToAllocateTempRegister);
@@ -630,7 +644,7 @@ LUnallocated* LChunkBuilder::TempRegister() {
LUnallocated* LChunkBuilder::TempDoubleRegister() {
LUnallocated* operand =
- new(zone()) LUnallocated(LUnallocated::MUST_HAVE_DOUBLE_REGISTER);
+ new (zone()) LUnallocated(LUnallocated::MUST_HAVE_DOUBLE_REGISTER);
int vreg = allocator_->GetVirtualRegister();
if (!allocator_->AllocationOk()) {
Abort(kOutOfVirtualRegistersWhileTryingToAllocateTempRegister);
@@ -656,12 +670,12 @@ LOperand* LChunkBuilder::FixedTemp(DoubleRegister reg) {
LInstruction* LChunkBuilder::DoBlockEntry(HBlockEntry* instr) {
- return new(zone()) LLabel(instr->block());
+ return new (zone()) LLabel(instr->block());
}
LInstruction* LChunkBuilder::DoDummyUse(HDummyUse* instr) {
- return DefineAsRegister(new(zone()) LDummyUse(UseAny(instr->value())));
+ return DefineAsRegister(new (zone()) LDummyUse(UseAny(instr->value())));
}
@@ -672,7 +686,7 @@ LInstruction* LChunkBuilder::DoEnvironmentMarker(HEnvironmentMarker* instr) {
LInstruction* LChunkBuilder::DoDeoptimize(HDeoptimize* instr) {
- return AssignEnvironment(new(zone()) LDeoptimize);
+ return AssignEnvironment(new (zone()) LDeoptimize);
}
@@ -711,7 +725,7 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op,
}
LInstruction* result =
- DefineAsRegister(new(zone()) LShiftI(op, left, right, does_deopt));
+ DefineAsRegister(new (zone()) LShiftI(op, left, right, does_deopt));
return does_deopt ? AssignEnvironment(result) : result;
} else {
return DoArithmeticT(op, instr);
@@ -725,14 +739,17 @@ LInstruction* LChunkBuilder::DoArithmeticD(Token::Value op,
DCHECK(instr->left()->representation().IsDouble());
DCHECK(instr->right()->representation().IsDouble());
if (op == Token::MOD) {
- LOperand* left = UseFixedDouble(instr->left(), d0);
- LOperand* right = UseFixedDouble(instr->right(), d1);
- LArithmeticD* result = new(zone()) LArithmeticD(op, left, right);
- return MarkAsCall(DefineFixedDouble(result, d0), instr);
+ LOperand* left = UseFixedDouble(instr->left(), d1);
+ LOperand* right = UseFixedDouble(instr->right(), d2);
+ 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);
} else {
LOperand* left = UseRegisterAtStart(instr->left());
LOperand* right = UseRegisterAtStart(instr->right());
- LArithmeticD* result = new(zone()) LArithmeticD(op, left, right);
+ LArithmeticD* result = new (zone()) LArithmeticD(op, left, right);
return DefineAsRegister(result);
}
}
@@ -745,11 +762,11 @@ LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op,
DCHECK(left->representation().IsTagged());
DCHECK(right->representation().IsTagged());
LOperand* context = UseFixed(instr->context(), cp);
- LOperand* left_operand = UseFixed(left, r1);
- LOperand* right_operand = UseFixed(right, r0);
+ LOperand* left_operand = UseFixed(left, r4);
+ LOperand* right_operand = UseFixed(right, r3);
LArithmeticT* result =
- new(zone()) LArithmeticT(op, context, left_operand, right_operand);
- return MarkAsCall(DefineFixed(result, r0), instr);
+ new (zone()) LArithmeticT(op, context, left_operand, right_operand);
+ return MarkAsCall(DefineFixed(result, r3), instr);
}
@@ -827,16 +844,16 @@ void LChunkBuilder::VisitInstruction(HInstruction* current) {
LInstruction* instr = NULL;
if (current->CanReplaceWithDummyUses()) {
if (current->OperandCount() == 0) {
- instr = DefineAsRegister(new(zone()) LDummy());
+ instr = DefineAsRegister(new (zone()) LDummy());
} else {
DCHECK(!current->OperandAt(0)->IsControlInstruction());
- instr = DefineAsRegister(new(zone())
- LDummyUse(UseAny(current->OperandAt(0))));
+ instr = DefineAsRegister(new (zone())
+ LDummyUse(UseAny(current->OperandAt(0))));
}
for (int i = 1; i < current->OperandCount(); ++i) {
if (current->OperandAt(i)->IsControlInstruction()) continue;
LInstruction* dummy =
- new(zone()) LDummyUse(UseAny(current->OperandAt(i)));
+ new (zone()) LDummyUse(UseAny(current->OperandAt(i)));
dummy->set_hydrogen_value(current);
chunk_->AddInstruction(dummy, current_block_);
}
@@ -845,7 +862,7 @@ void LChunkBuilder::VisitInstruction(HInstruction* current) {
if (current->IsControlInstruction() &&
HControlInstruction::cast(current)->KnownSuccessorBlock(&successor) &&
successor != NULL) {
- instr = new(zone()) LGoto(successor);
+ instr = new (zone()) LGoto(successor);
} else {
instr = current->CompileToLithium(this);
}
@@ -915,21 +932,21 @@ void LChunkBuilder::AddInstruction(LInstruction* instr,
sim->ReplayEnvironment(current_block_->last_environment());
hydrogen_value_for_lazy_bailout = sim;
}
- LInstruction* bailout = AssignEnvironment(new(zone()) LLazyBailout());
+ LInstruction* bailout = AssignEnvironment(new (zone()) LLazyBailout());
bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout);
chunk_->AddInstruction(bailout, current_block_);
if (instruction_needing_environment != NULL) {
// Store the lazy deopt environment with the instruction if needed.
// Right now it is only used for LInstanceOfKnownGlobal.
- instruction_needing_environment->
- SetDeferredLazyDeoptimizationEnvironment(bailout->environment());
+ instruction_needing_environment->SetDeferredLazyDeoptimizationEnvironment(
+ bailout->environment());
}
}
}
LInstruction* LChunkBuilder::DoGoto(HGoto* instr) {
- return new(zone()) LGoto(instr->FirstSuccessor());
+ return new (zone()) LGoto(instr->FirstSuccessor());
}
@@ -941,8 +958,8 @@ LInstruction* LChunkBuilder::DoBranch(HBranch* instr) {
if (expected.IsEmpty()) expected = ToBooleanStub::Types::Generic();
bool easy_case = !r.IsTagged() || type.IsBoolean() || type.IsSmi() ||
- type.IsJSArray() || type.IsHeapNumber() || type.IsString();
- LInstruction* branch = new(zone()) LBranch(UseRegister(value));
+ type.IsJSArray() || type.IsHeapNumber() || type.IsString();
+ LInstruction* branch = new (zone()) LBranch(UseRegister(value));
if (!easy_case &&
((!expected.Contains(ToBooleanStub::SMI) && expected.NeedsMap()) ||
!expected.IsGeneric())) {
@@ -953,7 +970,7 @@ LInstruction* LChunkBuilder::DoBranch(HBranch* instr) {
LInstruction* LChunkBuilder::DoDebugBreak(HDebugBreak* instr) {
- return new(zone()) LDebugBreak();
+ return new (zone()) LDebugBreak();
}
@@ -961,61 +978,56 @@ LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) {
DCHECK(instr->value()->representation().IsTagged());
LOperand* value = UseRegisterAtStart(instr->value());
LOperand* temp = TempRegister();
- return new(zone()) LCmpMapAndBranch(value, temp);
+ return new (zone()) LCmpMapAndBranch(value, temp);
}
LInstruction* LChunkBuilder::DoArgumentsLength(HArgumentsLength* instr) {
info()->MarkAsRequiresFrame();
LOperand* value = UseRegister(instr->value());
- return DefineAsRegister(new(zone()) LArgumentsLength(value));
+ return DefineAsRegister(new (zone()) LArgumentsLength(value));
}
LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) {
info()->MarkAsRequiresFrame();
- return DefineAsRegister(new(zone()) LArgumentsElements);
+ return DefineAsRegister(new (zone()) LArgumentsElements);
}
LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) {
LOperand* context = UseFixed(instr->context(), cp);
- LInstanceOf* result =
- new(zone()) LInstanceOf(context, UseFixed(instr->left(), r0),
- UseFixed(instr->right(), r1));
- return MarkAsCall(DefineFixed(result, r0), instr);
+ LInstanceOf* result = new (zone()) LInstanceOf(
+ context, UseFixed(instr->left(), r3), UseFixed(instr->right(), r4));
+ return MarkAsCall(DefineFixed(result, r3), instr);
}
LInstruction* LChunkBuilder::DoInstanceOfKnownGlobal(
HInstanceOfKnownGlobal* instr) {
- LInstanceOfKnownGlobal* result =
- new(zone()) LInstanceOfKnownGlobal(
- UseFixed(instr->context(), cp),
- UseFixed(instr->left(), r0),
- FixedTemp(r4));
- return MarkAsCall(DefineFixed(result, r0), instr);
+ LInstanceOfKnownGlobal* result = new (zone())
+ LInstanceOfKnownGlobal(UseFixed(instr->context(), cp),
+ UseFixed(instr->left(), r3), FixedTemp(r7));
+ return MarkAsCall(DefineFixed(result, r3), instr);
}
LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) {
LOperand* receiver = UseRegisterAtStart(instr->receiver());
LOperand* function = UseRegisterAtStart(instr->function());
- LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function);
+ LWrapReceiver* result = new (zone()) LWrapReceiver(receiver, function);
return AssignEnvironment(DefineAsRegister(result));
}
LInstruction* LChunkBuilder::DoApplyArguments(HApplyArguments* instr) {
- LOperand* function = UseFixed(instr->function(), r1);
- LOperand* receiver = UseFixed(instr->receiver(), r0);
- LOperand* length = UseFixed(instr->length(), r2);
- LOperand* elements = UseFixed(instr->elements(), r3);
- LApplyArguments* result = new(zone()) LApplyArguments(function,
- receiver,
- length,
- elements);
- return MarkAsCall(DefineFixed(result, r0), instr, CAN_DEOPTIMIZE_EAGERLY);
+ LOperand* function = UseFixed(instr->function(), r4);
+ LOperand* receiver = UseFixed(instr->receiver(), r3);
+ LOperand* length = UseFixed(instr->length(), r5);
+ LOperand* elements = UseFixed(instr->elements(), r6);
+ LApplyArguments* result =
+ new (zone()) LApplyArguments(function, receiver, length, elements);
+ return MarkAsCall(DefineFixed(result, r3), instr, CAN_DEOPTIMIZE_EAGERLY);
}
@@ -1023,7 +1035,7 @@ LInstruction* LChunkBuilder::DoPushArguments(HPushArguments* instr) {
int argc = instr->OperandCount();
for (int i = 0; i < argc; ++i) {
LOperand* argument = Use(instr->argument(i));
- AddInstruction(new(zone()) LPushArgument(argument), instr);
+ AddInstruction(new (zone()) LPushArgument(argument), instr);
}
return NULL;
}
@@ -1033,7 +1045,7 @@ LInstruction* LChunkBuilder::DoStoreCodeEntry(
HStoreCodeEntry* store_code_entry) {
LOperand* function = UseRegister(store_code_entry->function());
LOperand* code_object = UseTempRegister(store_code_entry->code_object());
- return new(zone()) LStoreCodeEntry(function, code_object);
+ return new (zone()) LStoreCodeEntry(function, code_object);
}
@@ -1041,15 +1053,14 @@ LInstruction* LChunkBuilder::DoInnerAllocatedObject(
HInnerAllocatedObject* instr) {
LOperand* base_object = UseRegisterAtStart(instr->base_object());
LOperand* offset = UseRegisterOrConstantAtStart(instr->offset());
- return DefineAsRegister(
- new(zone()) LInnerAllocatedObject(base_object, offset));
+ return DefineAsRegister(new (zone())
+ LInnerAllocatedObject(base_object, offset));
}
LInstruction* LChunkBuilder::DoThisFunction(HThisFunction* instr) {
- return instr->HasNoUses()
- ? NULL
- : DefineAsRegister(new(zone()) LThisFunction);
+ return instr->HasNoUses() ? NULL
+ : DefineAsRegister(new (zone()) LThisFunction);
}
@@ -1057,53 +1068,51 @@ LInstruction* LChunkBuilder::DoContext(HContext* instr) {
if (instr->HasNoUses()) return NULL;
if (info()->IsStub()) {
- return DefineFixed(new(zone()) LContext, cp);
+ return DefineFixed(new (zone()) LContext, cp);
}
- return DefineAsRegister(new(zone()) LContext);
+ return DefineAsRegister(new (zone()) LContext);
}
LInstruction* LChunkBuilder::DoDeclareGlobals(HDeclareGlobals* instr) {
LOperand* context = UseFixed(instr->context(), cp);
- return MarkAsCall(new(zone()) LDeclareGlobals(context), instr);
+ return MarkAsCall(new (zone()) LDeclareGlobals(context), instr);
}
-LInstruction* LChunkBuilder::DoCallJSFunction(
- HCallJSFunction* instr) {
- LOperand* function = UseFixed(instr->function(), r1);
+LInstruction* LChunkBuilder::DoCallJSFunction(HCallJSFunction* instr) {
+ LOperand* function = UseFixed(instr->function(), r4);
- LCallJSFunction* result = new(zone()) LCallJSFunction(function);
+ LCallJSFunction* result = new (zone()) LCallJSFunction(function);
- return MarkAsCall(DefineFixed(result, r0), instr);
+ return MarkAsCall(DefineFixed(result, r3), instr);
}
-LInstruction* LChunkBuilder::DoCallWithDescriptor(
- HCallWithDescriptor* instr) {
+LInstruction* LChunkBuilder::DoCallWithDescriptor(HCallWithDescriptor* instr) {
const InterfaceDescriptor* descriptor = instr->descriptor();
LOperand* target = UseRegisterOrConstantAtStart(instr->target());
ZoneList<LOperand*> ops(instr->OperandCount(), zone());
ops.Add(target, zone());
for (int i = 1; i < instr->OperandCount(); i++) {
- LOperand* op = UseFixed(instr->OperandAt(i),
- descriptor->GetParameterRegister(i - 1));
+ LOperand* op =
+ UseFixed(instr->OperandAt(i), descriptor->GetParameterRegister(i - 1));
ops.Add(op, zone());
}
- LCallWithDescriptor* result = new(zone()) LCallWithDescriptor(
- descriptor, ops, zone());
- return MarkAsCall(DefineFixed(result, r0), instr);
+ LCallWithDescriptor* result =
+ new (zone()) LCallWithDescriptor(descriptor, ops, zone());
+ return MarkAsCall(DefineFixed(result, r3), instr);
}
LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) {
LOperand* context = UseFixed(instr->context(), cp);
- LOperand* function = UseFixed(instr->function(), r1);
- LInvokeFunction* result = new(zone()) LInvokeFunction(context, function);
- return MarkAsCall(DefineFixed(result, r0), instr, CANNOT_DEOPTIMIZE_EAGERLY);
+ LOperand* function = UseFixed(instr->function(), r4);
+ LInvokeFunction* result = new (zone()) LInvokeFunction(context, function);
+ return MarkAsCall(DefineFixed(result, r3), instr, CANNOT_DEOPTIMIZE_EAGERLY);
}
@@ -1136,7 +1145,7 @@ LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) {
LInstruction* LChunkBuilder::DoMathFloor(HUnaryMathOperation* instr) {
LOperand* input = UseRegister(instr->value());
- LMathFloor* result = new(zone()) LMathFloor(input);
+ LMathFloor* result = new (zone()) LMathFloor(input);
return AssignEnvironment(AssignPointerMap(DefineAsRegister(result)));
}
@@ -1144,7 +1153,7 @@ LInstruction* LChunkBuilder::DoMathFloor(HUnaryMathOperation* instr) {
LInstruction* LChunkBuilder::DoMathRound(HUnaryMathOperation* instr) {
LOperand* input = UseRegister(instr->value());
LOperand* temp = TempDoubleRegister();
- LMathRound* result = new(zone()) LMathRound(input, temp);
+ LMathRound* result = new (zone()) LMathRound(input, temp);
return AssignEnvironment(DefineAsRegister(result));
}
@@ -1159,11 +1168,11 @@ LInstruction* LChunkBuilder::DoMathFround(HUnaryMathOperation* instr) {
LInstruction* LChunkBuilder::DoMathAbs(HUnaryMathOperation* instr) {
Representation r = instr->value()->representation();
LOperand* context = (r.IsDouble() || r.IsSmiOrInteger32())
- ? NULL
- : UseFixed(instr->context(), cp);
+ ? NULL
+ : UseFixed(instr->context(), cp);
LOperand* input = UseRegister(instr->value());
LInstruction* result =
- DefineAsRegister(new(zone()) LMathAbs(context, input));
+ DefineAsRegister(new (zone()) LMathAbs(context, input));
if (!r.IsDouble() && !r.IsSmiOrInteger32()) result = AssignPointerMap(result);
if (!r.IsDouble()) result = AssignEnvironment(result);
return result;
@@ -1173,14 +1182,14 @@ LInstruction* LChunkBuilder::DoMathAbs(HUnaryMathOperation* instr) {
LInstruction* LChunkBuilder::DoMathLog(HUnaryMathOperation* instr) {
DCHECK(instr->representation().IsDouble());
DCHECK(instr->value()->representation().IsDouble());
- LOperand* input = UseFixedDouble(instr->value(), d0);
- return MarkAsCall(DefineFixedDouble(new(zone()) LMathLog(input), d0), instr);
+ LOperand* input = UseFixedDouble(instr->value(), d1);
+ return MarkAsCall(DefineFixedDouble(new (zone()) LMathLog(input), d1), instr);
}
LInstruction* LChunkBuilder::DoMathClz32(HUnaryMathOperation* instr) {
LOperand* input = UseRegisterAtStart(instr->value());
- LMathClz32* result = new(zone()) LMathClz32(input);
+ LMathClz32* result = new (zone()) LMathClz32(input);
return DefineAsRegister(result);
}
@@ -1192,52 +1201,52 @@ LInstruction* LChunkBuilder::DoMathExp(HUnaryMathOperation* instr) {
LOperand* temp1 = TempRegister();
LOperand* temp2 = TempRegister();
LOperand* double_temp = TempDoubleRegister();
- LMathExp* result = new(zone()) LMathExp(input, double_temp, temp1, temp2);
+ LMathExp* result = new (zone()) LMathExp(input, double_temp, temp1, temp2);
return DefineAsRegister(result);
}
LInstruction* LChunkBuilder::DoMathSqrt(HUnaryMathOperation* instr) {
LOperand* input = UseRegisterAtStart(instr->value());
- LMathSqrt* result = new(zone()) LMathSqrt(input);
+ LMathSqrt* result = new (zone()) LMathSqrt(input);
return DefineAsRegister(result);
}
LInstruction* LChunkBuilder::DoMathPowHalf(HUnaryMathOperation* instr) {
LOperand* input = UseRegisterAtStart(instr->value());
- LMathPowHalf* result = new(zone()) LMathPowHalf(input);
+ LMathPowHalf* result = new (zone()) LMathPowHalf(input);
return DefineAsRegister(result);
}
LInstruction* LChunkBuilder::DoCallNew(HCallNew* instr) {
LOperand* context = UseFixed(instr->context(), cp);
- LOperand* constructor = UseFixed(instr->constructor(), r1);
- LCallNew* result = new(zone()) LCallNew(context, constructor);
- return MarkAsCall(DefineFixed(result, r0), instr);
+ LOperand* constructor = UseFixed(instr->constructor(), r4);
+ LCallNew* result = new (zone()) LCallNew(context, constructor);
+ return MarkAsCall(DefineFixed(result, r3), instr);
}
LInstruction* LChunkBuilder::DoCallNewArray(HCallNewArray* instr) {
LOperand* context = UseFixed(instr->context(), cp);
- LOperand* constructor = UseFixed(instr->constructor(), r1);
- LCallNewArray* result = new(zone()) LCallNewArray(context, constructor);
- return MarkAsCall(DefineFixed(result, r0), instr);
+ LOperand* constructor = UseFixed(instr->constructor(), r4);
+ LCallNewArray* result = new (zone()) LCallNewArray(context, constructor);
+ return MarkAsCall(DefineFixed(result, r3), instr);
}
LInstruction* LChunkBuilder::DoCallFunction(HCallFunction* instr) {
LOperand* context = UseFixed(instr->context(), cp);
- LOperand* function = UseFixed(instr->function(), r1);
- LCallFunction* call = new(zone()) LCallFunction(context, function);
- return MarkAsCall(DefineFixed(call, r0), instr);
+ LOperand* function = UseFixed(instr->function(), r4);
+ LCallFunction* call = new (zone()) LCallFunction(context, function);
+ return MarkAsCall(DefineFixed(call, r3), instr);
}
LInstruction* LChunkBuilder::DoCallRuntime(HCallRuntime* instr) {
LOperand* context = UseFixed(instr->context(), cp);
- return MarkAsCall(DefineFixed(new(zone()) LCallRuntime(context), r0), instr);
+ return MarkAsCall(DefineFixed(new (zone()) LCallRuntime(context), r3), instr);
}
@@ -1269,7 +1278,7 @@ LInstruction* LChunkBuilder::DoBitwise(HBitwise* instr) {
LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand());
LOperand* right = UseOrConstantAtStart(instr->BetterRightOperand());
- return DefineAsRegister(new(zone()) LBitI(left, right));
+ return DefineAsRegister(new (zone()) LBitI(left, right));
} else {
return DoArithmeticT(instr->op(), instr);
}
@@ -1282,8 +1291,8 @@ LInstruction* LChunkBuilder::DoDivByPowerOf2I(HDiv* instr) {
DCHECK(instr->right()->representation().Equals(instr->representation()));
LOperand* dividend = UseRegister(instr->left());
int32_t divisor = instr->right()->GetInteger32Constant();
- LInstruction* result = DefineAsRegister(new(zone()) LDivByPowerOf2I(
- dividend, divisor));
+ LInstruction* result =
+ DefineAsRegister(new (zone()) LDivByPowerOf2I(dividend, divisor));
if ((instr->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) ||
(instr->CheckFlag(HValue::kCanOverflow) && divisor == -1) ||
(!instr->CheckFlag(HInstruction::kAllUsesTruncatingToInt32) &&
@@ -1300,8 +1309,8 @@ LInstruction* LChunkBuilder::DoDivByConstI(HDiv* instr) {
DCHECK(instr->right()->representation().Equals(instr->representation()));
LOperand* dividend = UseRegister(instr->left());
int32_t divisor = instr->right()->GetInteger32Constant();
- LInstruction* result = DefineAsRegister(new(zone()) LDivByConstI(
- dividend, divisor));
+ LInstruction* result =
+ DefineAsRegister(new (zone()) LDivByConstI(dividend, divisor));
if (divisor == 0 ||
(instr->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) ||
!instr->CheckFlag(HInstruction::kAllUsesTruncatingToInt32)) {
@@ -1317,15 +1326,12 @@ LInstruction* LChunkBuilder::DoDivI(HDiv* instr) {
DCHECK(instr->right()->representation().Equals(instr->representation()));
LOperand* dividend = UseRegister(instr->left());
LOperand* divisor = UseRegister(instr->right());
- LOperand* temp =
- CpuFeatures::IsSupported(SUDIV) ? NULL : TempDoubleRegister();
LInstruction* result =
- DefineAsRegister(new(zone()) LDivI(dividend, divisor, temp));
+ DefineAsRegister(new (zone()) LDivI(dividend, divisor));
if (instr->CheckFlag(HValue::kCanBeDivByZero) ||
instr->CheckFlag(HValue::kBailoutOnMinusZero) ||
(instr->CheckFlag(HValue::kCanOverflow) &&
- (!CpuFeatures::IsSupported(SUDIV) ||
- !instr->CheckFlag(HValue::kAllUsesTruncatingToInt32))) ||
+ !instr->CheckFlag(HValue::kAllUsesTruncatingToInt32)) ||
(!instr->IsMathFloorOfDiv() &&
!instr->CheckFlag(HValue::kAllUsesTruncatingToInt32))) {
result = AssignEnvironment(result);
@@ -1354,8 +1360,8 @@ LInstruction* LChunkBuilder::DoDiv(HDiv* instr) {
LInstruction* LChunkBuilder::DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr) {
LOperand* dividend = UseRegisterAtStart(instr->left());
int32_t divisor = instr->right()->GetInteger32Constant();
- LInstruction* result = DefineAsRegister(new(zone()) LFlooringDivByPowerOf2I(
- dividend, divisor));
+ LInstruction* result =
+ DefineAsRegister(new (zone()) LFlooringDivByPowerOf2I(dividend, divisor));
if ((instr->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) ||
(instr->CheckFlag(HValue::kLeftCanBeMinInt) && divisor == -1)) {
result = AssignEnvironment(result);
@@ -1372,10 +1378,11 @@ LInstruction* LChunkBuilder::DoFlooringDivByConstI(HMathFloorOfDiv* instr) {
int32_t divisor = instr->right()->GetInteger32Constant();
LOperand* temp =
((divisor > 0 && !instr->CheckFlag(HValue::kLeftCanBeNegative)) ||
- (divisor < 0 && !instr->CheckFlag(HValue::kLeftCanBePositive))) ?
- NULL : TempRegister();
+ (divisor < 0 && !instr->CheckFlag(HValue::kLeftCanBePositive)))
+ ? NULL
+ : TempRegister();
LInstruction* result = DefineAsRegister(
- new(zone()) LFlooringDivByConstI(dividend, divisor, temp));
+ new (zone()) LFlooringDivByConstI(dividend, divisor, temp));
if (divisor == 0 ||
(instr->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0)) {
result = AssignEnvironment(result);
@@ -1390,9 +1397,7 @@ LInstruction* LChunkBuilder::DoFlooringDivI(HMathFloorOfDiv* instr) {
DCHECK(instr->right()->representation().Equals(instr->representation()));
LOperand* dividend = UseRegister(instr->left());
LOperand* divisor = UseRegister(instr->right());
- LOperand* temp =
- CpuFeatures::IsSupported(SUDIV) ? NULL : TempDoubleRegister();
- LFlooringDivI* div = new(zone()) LFlooringDivI(dividend, divisor, temp);
+ LFlooringDivI* div = new (zone()) LFlooringDivI(dividend, divisor);
return AssignEnvironment(DefineAsRegister(div));
}
@@ -1414,8 +1419,8 @@ LInstruction* LChunkBuilder::DoModByPowerOf2I(HMod* instr) {
DCHECK(instr->right()->representation().Equals(instr->representation()));
LOperand* dividend = UseRegisterAtStart(instr->left());
int32_t divisor = instr->right()->GetInteger32Constant();
- LInstruction* result = DefineSameAsFirst(new(zone()) LModByPowerOf2I(
- dividend, divisor));
+ LInstruction* result =
+ DefineSameAsFirst(new (zone()) LModByPowerOf2I(dividend, divisor));
if (instr->CheckFlag(HValue::kLeftCanBeNegative) &&
instr->CheckFlag(HValue::kBailoutOnMinusZero)) {
result = AssignEnvironment(result);
@@ -1430,8 +1435,8 @@ LInstruction* LChunkBuilder::DoModByConstI(HMod* instr) {
DCHECK(instr->right()->representation().Equals(instr->representation()));
LOperand* dividend = UseRegister(instr->left());
int32_t divisor = instr->right()->GetInteger32Constant();
- LInstruction* result = DefineAsRegister(new(zone()) LModByConstI(
- dividend, divisor));
+ LInstruction* result =
+ DefineAsRegister(new (zone()) LModByConstI(dividend, divisor));
if (divisor == 0 || instr->CheckFlag(HValue::kBailoutOnMinusZero)) {
result = AssignEnvironment(result);
}
@@ -1445,12 +1450,8 @@ LInstruction* LChunkBuilder::DoModI(HMod* instr) {
DCHECK(instr->right()->representation().Equals(instr->representation()));
LOperand* dividend = UseRegister(instr->left());
LOperand* divisor = UseRegister(instr->right());
- LOperand* temp =
- CpuFeatures::IsSupported(SUDIV) ? NULL : TempDoubleRegister();
- LOperand* temp2 =
- CpuFeatures::IsSupported(SUDIV) ? NULL : TempDoubleRegister();
- LInstruction* result = DefineAsRegister(new(zone()) LModI(
- dividend, divisor, temp, temp2));
+ LInstruction* result =
+ DefineAsRegister(new (zone()) LModI(dividend, divisor));
if (instr->CheckFlag(HValue::kCanBeDivByZero) ||
instr->CheckFlag(HValue::kBailoutOnMinusZero)) {
result = AssignEnvironment(result);
@@ -1511,15 +1512,15 @@ LInstruction* LChunkBuilder::DoMul(HMul* instr) {
}
right_op = UseRegister(right);
}
- LMulI* mul = new(zone()) LMulI(left_op, right_op);
+ LMulI* mul = new (zone()) LMulI(left_op, right_op);
if (can_overflow || bailout_on_minus_zero) {
AssignEnvironment(mul);
}
return DefineAsRegister(mul);
} else if (instr->representation().IsDouble()) {
- if (instr->HasOneUse() && (instr->uses().value()->IsAdd() ||
- instr->uses().value()->IsSub())) {
+ if (instr->HasOneUse() &&
+ (instr->uses().value()->IsAdd() || instr->uses().value()->IsSub())) {
HBinaryOperation* use = HBinaryOperation::cast(instr->uses().value());
if (use->IsAdd() && instr == use->left()) {
@@ -1527,13 +1528,14 @@ LInstruction* LChunkBuilder::DoMul(HMul* instr) {
// multiply-add in DoAdd.
return NULL;
}
- if (instr == use->right() && use->IsAdd() && !use->left()->IsMul()) {
+ if (instr == use->right() && use->IsAdd() &&
+ !(use->left()->IsMul() && use->left()->HasOneUse())) {
// This mul is the rhs of an add, where the lhs is not another mul.
// The add and mul will be folded into a multiply-add in DoAdd.
return NULL;
}
- if (instr == use->right() && use->IsSub()) {
- // This mul is the rhs of a sub. The sub and mul will be folded into a
+ if (instr == use->left() && use->IsSub()) {
+ // This mul is the lhs of a sub. The mul and sub will be folded into a
// multiply-sub in DoSub.
return NULL;
}
@@ -1551,22 +1553,23 @@ LInstruction* LChunkBuilder::DoSub(HSub* instr) {
DCHECK(instr->left()->representation().Equals(instr->representation()));
DCHECK(instr->right()->representation().Equals(instr->representation()));
- if (instr->left()->IsConstant()) {
+ if (instr->left()->IsConstant() &&
+ !instr->CheckFlag(HValue::kCanOverflow)) {
// If lhs is constant, do reverse subtraction instead.
return DoRSub(instr);
}
LOperand* left = UseRegisterAtStart(instr->left());
LOperand* right = UseOrConstantAtStart(instr->right());
- LSubI* sub = new(zone()) LSubI(left, right);
+ LSubI* sub = new (zone()) LSubI(left, right);
LInstruction* result = DefineAsRegister(sub);
if (instr->CheckFlag(HValue::kCanOverflow)) {
result = AssignEnvironment(result);
}
return result;
} else if (instr->representation().IsDouble()) {
- if (instr->right()->IsMul() && instr->right()->HasOneUse()) {
- return DoMultiplySub(instr->left(), HMul::cast(instr->right()));
+ if (instr->left()->IsMul() && instr->left()->HasOneUse()) {
+ return DoMultiplySub(instr->right(), HMul::cast(instr->left()));
}
return DoArithmeticD(Token::SUB, instr);
@@ -1580,16 +1583,14 @@ LInstruction* LChunkBuilder::DoRSub(HSub* instr) {
DCHECK(instr->representation().IsSmiOrInteger32());
DCHECK(instr->left()->representation().Equals(instr->representation()));
DCHECK(instr->right()->representation().Equals(instr->representation()));
+ DCHECK(!instr->CheckFlag(HValue::kCanOverflow));
// Note: The lhs of the subtraction becomes the rhs of the
// reverse-subtraction.
LOperand* left = UseRegisterAtStart(instr->right());
LOperand* right = UseOrConstantAtStart(instr->left());
- LRSubI* rsb = new(zone()) LRSubI(left, right);
+ LRSubI* rsb = new (zone()) LRSubI(left, right);
LInstruction* result = DefineAsRegister(rsb);
- if (instr->CheckFlag(HValue::kCanOverflow)) {
- result = AssignEnvironment(result);
- }
return result;
}
@@ -1598,8 +1599,8 @@ LInstruction* LChunkBuilder::DoMultiplyAdd(HMul* mul, HValue* addend) {
LOperand* multiplier_op = UseRegisterAtStart(mul->left());
LOperand* multiplicand_op = UseRegisterAtStart(mul->right());
LOperand* addend_op = UseRegisterAtStart(addend);
- return DefineSameAsFirst(new(zone()) LMultiplyAddD(addend_op, multiplier_op,
- multiplicand_op));
+ return DefineSameAsFirst(
+ new (zone()) LMultiplyAddD(addend_op, multiplier_op, multiplicand_op));
}
@@ -1608,9 +1609,8 @@ LInstruction* LChunkBuilder::DoMultiplySub(HValue* minuend, HMul* mul) {
LOperand* multiplier_op = UseRegisterAtStart(mul->left());
LOperand* multiplicand_op = UseRegisterAtStart(mul->right());
- return DefineSameAsFirst(new(zone()) LMultiplySubD(minuend_op,
- multiplier_op,
- multiplicand_op));
+ return DefineSameAsFirst(
+ new (zone()) LMultiplySubD(minuend_op, multiplier_op, multiplicand_op));
}
@@ -1620,7 +1620,7 @@ LInstruction* LChunkBuilder::DoAdd(HAdd* instr) {
DCHECK(instr->right()->representation().Equals(instr->representation()));
LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand());
LOperand* right = UseOrConstantAtStart(instr->BetterRightOperand());
- LAddI* add = new(zone()) LAddI(left, right);
+ LAddI* add = new (zone()) LAddI(left, right);
LInstruction* result = DefineAsRegister(add);
if (instr->CheckFlag(HValue::kCanOverflow)) {
result = AssignEnvironment(result);
@@ -1632,7 +1632,7 @@ LInstruction* LChunkBuilder::DoAdd(HAdd* instr) {
DCHECK(!instr->CheckFlag(HValue::kCanOverflow));
LOperand* left = UseRegisterAtStart(instr->left());
LOperand* right = UseOrConstantAtStart(instr->right());
- LAddI* add = new(zone()) LAddI(left, right);
+ LAddI* add = new (zone()) LAddI(left, right);
LInstruction* result = DefineAsRegister(add);
return result;
} else if (instr->representation().IsDouble()) {
@@ -1667,7 +1667,7 @@ LInstruction* LChunkBuilder::DoMathMinMax(HMathMinMax* instr) {
left = UseRegisterAtStart(instr->left());
right = UseRegisterAtStart(instr->right());
}
- return DefineAsRegister(new(zone()) LMathMinMax(left, right));
+ return DefineAsRegister(new (zone()) LMathMinMax(left, right));
}
@@ -1677,13 +1677,12 @@ LInstruction* LChunkBuilder::DoPower(HPower* instr) {
// We need to use fixed result register for the call.
Representation exponent_type = instr->right()->representation();
DCHECK(instr->left()->representation().IsDouble());
- LOperand* left = UseFixedDouble(instr->left(), d0);
- LOperand* right = exponent_type.IsDouble() ?
- UseFixedDouble(instr->right(), d1) :
- UseFixed(instr->right(), r2);
- LPower* result = new(zone()) LPower(left, right);
- return MarkAsCall(DefineFixedDouble(result, d2),
- instr,
+ LOperand* left = UseFixedDouble(instr->left(), d1);
+ LOperand* right = exponent_type.IsDouble()
+ ? UseFixedDouble(instr->right(), d2)
+ : UseFixed(instr->right(), r5);
+ LPower* result = new (zone()) LPower(left, right);
+ return MarkAsCall(DefineFixedDouble(result, d3), instr,
CAN_DEOPTIMIZE_EAGERLY);
}
@@ -1692,10 +1691,10 @@ LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) {
DCHECK(instr->left()->representation().IsTagged());
DCHECK(instr->right()->representation().IsTagged());
LOperand* context = UseFixed(instr->context(), cp);
- LOperand* left = UseFixed(instr->left(), r1);
- LOperand* right = UseFixed(instr->right(), r0);
- LCmpT* result = new(zone()) LCmpT(context, left, right);
- return MarkAsCall(DefineFixed(result, r0), instr);
+ LOperand* left = UseFixed(instr->left(), r4);
+ LOperand* right = UseFixed(instr->right(), r3);
+ LCmpT* result = new (zone()) LCmpT(context, left, right);
+ return MarkAsCall(DefineFixed(result, r3), instr);
}
@@ -1707,14 +1706,14 @@ LInstruction* LChunkBuilder::DoCompareNumericAndBranch(
DCHECK(instr->right()->representation().Equals(r));
LOperand* left = UseRegisterOrConstantAtStart(instr->left());
LOperand* right = UseRegisterOrConstantAtStart(instr->right());
- return new(zone()) LCompareNumericAndBranch(left, right);
+ return new (zone()) LCompareNumericAndBranch(left, right);
} else {
DCHECK(r.IsDouble());
DCHECK(instr->left()->representation().IsDouble());
DCHECK(instr->right()->representation().IsDouble());
LOperand* left = UseRegisterAtStart(instr->left());
LOperand* right = UseRegisterAtStart(instr->right());
- return new(zone()) LCompareNumericAndBranch(left, right);
+ return new (zone()) LCompareNumericAndBranch(left, right);
}
}
@@ -1723,14 +1722,14 @@ LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch(
HCompareObjectEqAndBranch* instr) {
LOperand* left = UseRegisterAtStart(instr->left());
LOperand* right = UseRegisterAtStart(instr->right());
- return new(zone()) LCmpObjectEqAndBranch(left, right);
+ return new (zone()) LCmpObjectEqAndBranch(left, right);
}
LInstruction* LChunkBuilder::DoCompareHoleAndBranch(
HCompareHoleAndBranch* instr) {
LOperand* value = UseRegisterAtStart(instr->value());
- return new(zone()) LCmpHoleAndBranch(value);
+ return new (zone()) LCmpHoleAndBranch(value);
}
@@ -1738,7 +1737,7 @@ LInstruction* LChunkBuilder::DoCompareMinusZeroAndBranch(
HCompareMinusZeroAndBranch* instr) {
LOperand* value = UseRegister(instr->value());
LOperand* scratch = TempRegister();
- return new(zone()) LCompareMinusZeroAndBranch(value, scratch);
+ return new (zone()) LCompareMinusZeroAndBranch(value, scratch);
}
@@ -1746,7 +1745,7 @@ LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) {
DCHECK(instr->value()->representation().IsTagged());
LOperand* value = UseRegisterAtStart(instr->value());
LOperand* temp = TempRegister();
- return new(zone()) LIsObjectAndBranch(value, temp);
+ return new (zone()) LIsObjectAndBranch(value, temp);
}
@@ -1754,13 +1753,13 @@ LInstruction* LChunkBuilder::DoIsStringAndBranch(HIsStringAndBranch* instr) {
DCHECK(instr->value()->representation().IsTagged());
LOperand* value = UseRegisterAtStart(instr->value());
LOperand* temp = TempRegister();
- return new(zone()) LIsStringAndBranch(value, temp);
+ return new (zone()) LIsStringAndBranch(value, temp);
}
LInstruction* LChunkBuilder::DoIsSmiAndBranch(HIsSmiAndBranch* instr) {
DCHECK(instr->value()->representation().IsTagged());
- return new(zone()) LIsSmiAndBranch(Use(instr->value()));
+ return new (zone()) LIsSmiAndBranch(Use(instr->value()));
}
@@ -1768,7 +1767,7 @@ LInstruction* LChunkBuilder::DoIsUndetectableAndBranch(
HIsUndetectableAndBranch* instr) {
DCHECK(instr->value()->representation().IsTagged());
LOperand* value = UseRegisterAtStart(instr->value());
- return new(zone()) LIsUndetectableAndBranch(value, TempRegister());
+ return new (zone()) LIsUndetectableAndBranch(value, TempRegister());
}
@@ -1777,10 +1776,10 @@ LInstruction* LChunkBuilder::DoStringCompareAndBranch(
DCHECK(instr->left()->representation().IsTagged());
DCHECK(instr->right()->representation().IsTagged());
LOperand* context = UseFixed(instr->context(), cp);
- LOperand* left = UseFixed(instr->left(), r1);
- LOperand* right = UseFixed(instr->right(), r0);
+ LOperand* left = UseFixed(instr->left(), r4);
+ LOperand* right = UseFixed(instr->right(), r3);
LStringCompareAndBranch* result =
- new(zone()) LStringCompareAndBranch(context, left, right);
+ new (zone()) LStringCompareAndBranch(context, left, right);
return MarkAsCall(result, instr);
}
@@ -1789,24 +1788,24 @@ LInstruction* LChunkBuilder::DoHasInstanceTypeAndBranch(
HHasInstanceTypeAndBranch* instr) {
DCHECK(instr->value()->representation().IsTagged());
LOperand* value = UseRegisterAtStart(instr->value());
- return new(zone()) LHasInstanceTypeAndBranch(value);
+ return new (zone()) LHasInstanceTypeAndBranch(value);
}
LInstruction* LChunkBuilder::DoGetCachedArrayIndex(
- HGetCachedArrayIndex* instr) {
+ HGetCachedArrayIndex* instr) {
DCHECK(instr->value()->representation().IsTagged());
LOperand* value = UseRegisterAtStart(instr->value());
- return DefineAsRegister(new(zone()) LGetCachedArrayIndex(value));
+ return DefineAsRegister(new (zone()) LGetCachedArrayIndex(value));
}
LInstruction* LChunkBuilder::DoHasCachedArrayIndexAndBranch(
HHasCachedArrayIndexAndBranch* instr) {
DCHECK(instr->value()->representation().IsTagged());
- return new(zone()) LHasCachedArrayIndexAndBranch(
- UseRegisterAtStart(instr->value()));
+ return new (zone())
+ LHasCachedArrayIndexAndBranch(UseRegisterAtStart(instr->value()));
}
@@ -1814,39 +1813,39 @@ LInstruction* LChunkBuilder::DoClassOfTestAndBranch(
HClassOfTestAndBranch* instr) {
DCHECK(instr->value()->representation().IsTagged());
LOperand* value = UseRegister(instr->value());
- return new(zone()) LClassOfTestAndBranch(value, TempRegister());
+ return new (zone()) LClassOfTestAndBranch(value, TempRegister());
}
LInstruction* LChunkBuilder::DoMapEnumLength(HMapEnumLength* instr) {
LOperand* map = UseRegisterAtStart(instr->value());
- return DefineAsRegister(new(zone()) LMapEnumLength(map));
+ return DefineAsRegister(new (zone()) LMapEnumLength(map));
}
LInstruction* LChunkBuilder::DoDateField(HDateField* instr) {
- LOperand* object = UseFixed(instr->value(), r0);
+ LOperand* object = UseFixed(instr->value(), r3);
LDateField* result =
- new(zone()) LDateField(object, FixedTemp(r1), instr->index());
- return MarkAsCall(DefineFixed(result, r0), instr, CAN_DEOPTIMIZE_EAGERLY);
+ new (zone()) LDateField(object, FixedTemp(r4), instr->index());
+ return MarkAsCall(DefineFixed(result, r3), instr, CAN_DEOPTIMIZE_EAGERLY);
}
LInstruction* LChunkBuilder::DoSeqStringGetChar(HSeqStringGetChar* instr) {
LOperand* string = UseRegisterAtStart(instr->string());
LOperand* index = UseRegisterOrConstantAtStart(instr->index());
- return DefineAsRegister(new(zone()) LSeqStringGetChar(string, index));
+ return DefineAsRegister(new (zone()) LSeqStringGetChar(string, index));
}
LInstruction* LChunkBuilder::DoSeqStringSetChar(HSeqStringSetChar* instr) {
LOperand* string = UseRegisterAtStart(instr->string());
LOperand* index = FLAG_debug_code
- ? UseRegisterAtStart(instr->index())
- : UseRegisterOrConstantAtStart(instr->index());
+ ? UseRegisterAtStart(instr->index())
+ : UseRegisterOrConstantAtStart(instr->index());
LOperand* value = UseRegisterAtStart(instr->value());
LOperand* context = FLAG_debug_code ? UseFixed(instr->context(), cp) : NULL;
- return new(zone()) LSeqStringSetChar(context, string, index, value);
+ return new (zone()) LSeqStringSetChar(context, string, index, value);
}
@@ -1854,9 +1853,9 @@ LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) {
if (!FLAG_debug_code && instr->skip_check()) return NULL;
LOperand* index = UseRegisterOrConstantAtStart(instr->index());
LOperand* length = !index->IsConstantOperand()
- ? UseRegisterOrConstantAtStart(instr->length())
- : UseRegisterAtStart(instr->length());
- LInstruction* result = new(zone()) LBoundsCheck(index, length);
+ ? UseRegisterOrConstantAtStart(instr->length())
+ : UseRegisterAtStart(instr->length());
+ LInstruction* result = new (zone()) LBoundsCheck(index, length);
if (!FLAG_debug_code || !instr->skip_check()) {
result = AssignEnvironment(result);
}
@@ -1878,9 +1877,7 @@ LInstruction* LChunkBuilder::DoAbnormalExit(HAbnormalExit* instr) {
}
-LInstruction* LChunkBuilder::DoUseConst(HUseConst* instr) {
- return NULL;
-}
+LInstruction* LChunkBuilder::DoUseConst(HUseConst* instr) { return NULL; }
LInstruction* LChunkBuilder::DoForceRepresentation(HForceRepresentation* bad) {
@@ -1898,33 +1895,35 @@ LInstruction* LChunkBuilder::DoChange(HChange* instr) {
if (from.IsSmi()) {
if (to.IsTagged()) {
LOperand* value = UseRegister(val);
- return DefineSameAsFirst(new(zone()) LDummyUse(value));
+ return DefineSameAsFirst(new (zone()) LDummyUse(value));
}
from = Representation::Tagged();
}
if (from.IsTagged()) {
if (to.IsDouble()) {
LOperand* value = UseRegister(val);
- LInstruction* result = DefineAsRegister(new(zone()) LNumberUntagD(value));
+ LInstruction* result =
+ DefineAsRegister(new (zone()) LNumberUntagD(value));
if (!val->representation().IsSmi()) result = AssignEnvironment(result);
return result;
} else if (to.IsSmi()) {
LOperand* value = UseRegister(val);
if (val->type().IsSmi()) {
- return DefineSameAsFirst(new(zone()) LDummyUse(value));
+ return DefineSameAsFirst(new (zone()) LDummyUse(value));
}
- return AssignEnvironment(DefineSameAsFirst(new(zone()) LCheckSmi(value)));
+ return AssignEnvironment(
+ DefineSameAsFirst(new (zone()) LCheckSmi(value)));
} else {
DCHECK(to.IsInteger32());
if (val->type().IsSmi() || val->representation().IsSmi()) {
LOperand* value = UseRegisterAtStart(val);
- return DefineAsRegister(new(zone()) LSmiUntag(value, false));
+ return DefineAsRegister(new (zone()) LSmiUntag(value, false));
} else {
LOperand* value = UseRegister(val);
LOperand* temp1 = TempRegister();
LOperand* temp2 = TempDoubleRegister();
LInstruction* result =
- DefineSameAsFirst(new(zone()) LTaggedToI(value, temp1, temp2));
+ DefineSameAsFirst(new (zone()) LTaggedToI(value, temp1, temp2));
if (!val->representation().IsSmi()) result = AssignEnvironment(result);
return result;
}
@@ -1936,16 +1935,16 @@ LInstruction* LChunkBuilder::DoChange(HChange* instr) {
LOperand* temp1 = TempRegister();
LOperand* temp2 = TempRegister();
LUnallocated* result_temp = TempRegister();
- LNumberTagD* result = new(zone()) LNumberTagD(value, temp1, temp2);
+ LNumberTagD* result = new (zone()) LNumberTagD(value, temp1, temp2);
return AssignPointerMap(Define(result, result_temp));
} else if (to.IsSmi()) {
LOperand* value = UseRegister(val);
return AssignEnvironment(
- DefineAsRegister(new(zone()) LDoubleToSmi(value)));
+ DefineAsRegister(new (zone()) LDoubleToSmi(value)));
} else {
DCHECK(to.IsInteger32());
LOperand* value = UseRegister(val);
- LInstruction* result = DefineAsRegister(new(zone()) LDoubleToI(value));
+ LInstruction* result = DefineAsRegister(new (zone()) LDoubleToI(value));
if (!instr->CanTruncateToInt32()) result = AssignEnvironment(result);
return result;
}
@@ -1954,23 +1953,23 @@ LInstruction* LChunkBuilder::DoChange(HChange* instr) {
if (to.IsTagged()) {
if (!instr->CheckFlag(HValue::kCanOverflow)) {
LOperand* value = UseRegisterAtStart(val);
- return DefineAsRegister(new(zone()) LSmiTag(value));
+ return DefineAsRegister(new (zone()) LSmiTag(value));
} else if (val->CheckFlag(HInstruction::kUint32)) {
LOperand* value = UseRegisterAtStart(val);
LOperand* temp1 = TempRegister();
LOperand* temp2 = TempRegister();
- LNumberTagU* result = new(zone()) LNumberTagU(value, temp1, temp2);
+ LNumberTagU* result = new (zone()) LNumberTagU(value, temp1, temp2);
return AssignPointerMap(DefineAsRegister(result));
} else {
LOperand* value = UseRegisterAtStart(val);
LOperand* temp1 = TempRegister();
LOperand* temp2 = TempRegister();
- LNumberTagI* result = new(zone()) LNumberTagI(value, temp1, temp2);
+ LNumberTagI* result = new (zone()) LNumberTagI(value, temp1, temp2);
return AssignPointerMap(DefineAsRegister(result));
}
} else if (to.IsSmi()) {
LOperand* value = UseRegister(val);
- LInstruction* result = DefineAsRegister(new(zone()) LSmiTag(value));
+ LInstruction* result = DefineAsRegister(new (zone()) LSmiTag(value));
if (instr->CheckFlag(HValue::kCanOverflow)) {
result = AssignEnvironment(result);
}
@@ -1978,9 +1977,9 @@ LInstruction* LChunkBuilder::DoChange(HChange* instr) {
} else {
DCHECK(to.IsDouble());
if (val->CheckFlag(HInstruction::kUint32)) {
- return DefineAsRegister(new(zone()) LUint32ToDouble(UseRegister(val)));
+ return DefineAsRegister(new (zone()) LUint32ToDouble(UseRegister(val)));
} else {
- return DefineAsRegister(new(zone()) LInteger32ToDouble(Use(val)));
+ return DefineAsRegister(new (zone()) LInteger32ToDouble(Use(val)));
}
}
}
@@ -1991,7 +1990,7 @@ LInstruction* LChunkBuilder::DoChange(HChange* instr) {
LInstruction* LChunkBuilder::DoCheckHeapObject(HCheckHeapObject* instr) {
LOperand* value = UseRegisterAtStart(instr->value());
- LInstruction* result = new(zone()) LCheckNonSmi(value);
+ LInstruction* result = new (zone()) LCheckNonSmi(value);
if (!instr->value()->type().IsHeapObject()) {
result = AssignEnvironment(result);
}
@@ -2001,27 +2000,27 @@ LInstruction* LChunkBuilder::DoCheckHeapObject(HCheckHeapObject* instr) {
LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) {
LOperand* value = UseRegisterAtStart(instr->value());
- return AssignEnvironment(new(zone()) LCheckSmi(value));
+ return AssignEnvironment(new (zone()) LCheckSmi(value));
}
LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) {
LOperand* value = UseRegisterAtStart(instr->value());
- LInstruction* result = new(zone()) LCheckInstanceType(value);
+ LInstruction* result = new (zone()) LCheckInstanceType(value);
return AssignEnvironment(result);
}
LInstruction* LChunkBuilder::DoCheckValue(HCheckValue* instr) {
LOperand* value = UseRegisterAtStart(instr->value());
- return AssignEnvironment(new(zone()) LCheckValue(value));
+ return AssignEnvironment(new (zone()) LCheckValue(value));
}
LInstruction* LChunkBuilder::DoCheckMaps(HCheckMaps* instr) {
- if (instr->IsStabilityCheck()) return new(zone()) LCheckMaps;
+ if (instr->IsStabilityCheck()) return new (zone()) LCheckMaps;
LOperand* value = UseRegisterAtStart(instr->value());
- LInstruction* result = AssignEnvironment(new(zone()) LCheckMaps(value));
+ LInstruction* result = AssignEnvironment(new (zone()) LCheckMaps(value));
if (instr->HasMigrationTarget()) {
info()->MarkAsDeferredCalling();
result = AssignPointerMap(result);
@@ -2035,15 +2034,13 @@ LInstruction* LChunkBuilder::DoClampToUint8(HClampToUint8* instr) {
Representation input_rep = value->representation();
LOperand* reg = UseRegister(value);
if (input_rep.IsDouble()) {
- return DefineAsRegister(new(zone()) LClampDToUint8(reg));
+ return DefineAsRegister(new (zone()) LClampDToUint8(reg));
} else if (input_rep.IsInteger32()) {
- return DefineAsRegister(new(zone()) LClampIToUint8(reg));
+ return DefineAsRegister(new (zone()) LClampIToUint8(reg));
} else {
DCHECK(input_rep.IsSmiOrTagged());
- // Register allocator doesn't (yet) support allocation of double
- // temps. Reserve d1 explicitly.
LClampTToUint8* result =
- new(zone()) LClampTToUint8(reg, TempDoubleRegister());
+ new (zone()) LClampTToUint8(reg, TempDoubleRegister());
return AssignEnvironment(DefineAsRegister(result));
}
}
@@ -2052,39 +2049,37 @@ LInstruction* LChunkBuilder::DoClampToUint8(HClampToUint8* instr) {
LInstruction* LChunkBuilder::DoDoubleBits(HDoubleBits* instr) {
HValue* value = instr->value();
DCHECK(value->representation().IsDouble());
- return DefineAsRegister(new(zone()) LDoubleBits(UseRegister(value)));
+ return DefineAsRegister(new (zone()) LDoubleBits(UseRegister(value)));
}
LInstruction* LChunkBuilder::DoConstructDouble(HConstructDouble* instr) {
LOperand* lo = UseRegister(instr->lo());
LOperand* hi = UseRegister(instr->hi());
- return DefineAsRegister(new(zone()) LConstructDouble(hi, lo));
+ return DefineAsRegister(new (zone()) LConstructDouble(hi, lo));
}
LInstruction* LChunkBuilder::DoReturn(HReturn* instr) {
- LOperand* context = info()->IsStub()
- ? UseFixed(instr->context(), cp)
- : NULL;
+ LOperand* context = info()->IsStub() ? UseFixed(instr->context(), cp) : NULL;
LOperand* parameter_count = UseRegisterOrConstant(instr->parameter_count());
- return new(zone()) LReturn(UseFixed(instr->value(), r0), context,
- parameter_count);
+ return new (zone())
+ LReturn(UseFixed(instr->value(), r3), context, parameter_count);
}
LInstruction* LChunkBuilder::DoConstant(HConstant* instr) {
Representation r = instr->representation();
if (r.IsSmi()) {
- return DefineAsRegister(new(zone()) LConstantS);
+ return DefineAsRegister(new (zone()) LConstantS);
} else if (r.IsInteger32()) {
- return DefineAsRegister(new(zone()) LConstantI);
+ return DefineAsRegister(new (zone()) LConstantI);
} else if (r.IsDouble()) {
- return DefineAsRegister(new(zone()) LConstantD);
+ return DefineAsRegister(new (zone()) LConstantD);
} else if (r.IsExternal()) {
- return DefineAsRegister(new(zone()) LConstantE);
+ return DefineAsRegister(new (zone()) LConstantE);
} else if (r.IsTagged()) {
- return DefineAsRegister(new(zone()) LConstantT);
+ return DefineAsRegister(new (zone()) LConstantT);
} else {
UNREACHABLE();
return NULL;
@@ -2093,24 +2088,24 @@ LInstruction* LChunkBuilder::DoConstant(HConstant* instr) {
LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) {
- LLoadGlobalCell* result = new(zone()) LLoadGlobalCell;
+ LLoadGlobalCell* result = new (zone()) LLoadGlobalCell;
return instr->RequiresHoleCheck()
- ? AssignEnvironment(DefineAsRegister(result))
- : DefineAsRegister(result);
+ ? AssignEnvironment(DefineAsRegister(result))
+ : DefineAsRegister(result);
}
LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) {
LOperand* context = UseFixed(instr->context(), cp);
- LOperand* global_object = UseFixed(instr->global_object(),
- LoadIC::ReceiverRegister());
+ LOperand* global_object =
+ UseFixed(instr->global_object(), LoadIC::ReceiverRegister());
LOperand* vector = NULL;
if (FLAG_vector_ics) {
vector = FixedTemp(LoadIC::VectorRegister());
}
LLoadGlobalGeneric* result =
- new(zone()) LLoadGlobalGeneric(context, global_object, vector);
- return MarkAsCall(DefineFixed(result, r0), instr);
+ new (zone()) LLoadGlobalGeneric(context, global_object, vector);
+ return MarkAsCall(DefineFixed(result, r3), instr);
}
@@ -2119,15 +2114,16 @@ LInstruction* LChunkBuilder::DoStoreGlobalCell(HStoreGlobalCell* instr) {
// Use a temp to check the value in the cell in the case where we perform
// a hole check.
return instr->RequiresHoleCheck()
- ? AssignEnvironment(new(zone()) LStoreGlobalCell(value, TempRegister()))
- : new(zone()) LStoreGlobalCell(value, NULL);
+ ? AssignEnvironment(new (zone())
+ LStoreGlobalCell(value, TempRegister()))
+ : new (zone()) LStoreGlobalCell(value, NULL);
}
LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) {
LOperand* context = UseRegisterAtStart(instr->value());
LInstruction* result =
- DefineAsRegister(new(zone()) LLoadContextSlot(context));
+ DefineAsRegister(new (zone()) LLoadContextSlot(context));
if (instr->RequiresHoleCheck() && instr->DeoptimizesOnHole()) {
result = AssignEnvironment(result);
}
@@ -2145,7 +2141,7 @@ LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) {
context = UseRegister(instr->context());
value = UseRegister(instr->value());
}
- LInstruction* result = new(zone()) LStoreContextSlot(context, value);
+ LInstruction* result = new (zone()) LStoreContextSlot(context, value);
if (instr->RequiresHoleCheck() && instr->DeoptimizesOnHole()) {
result = AssignEnvironment(result);
}
@@ -2155,7 +2151,7 @@ LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) {
LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) {
LOperand* obj = UseRegisterAtStart(instr->object());
- return DefineAsRegister(new(zone()) LLoadNamedField(obj));
+ return DefineAsRegister(new (zone()) LLoadNamedField(obj));
}
@@ -2168,7 +2164,7 @@ LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) {
}
LInstruction* result =
- DefineFixed(new(zone()) LLoadNamedGeneric(context, object, vector), r0);
+ DefineFixed(new (zone()) LLoadNamedGeneric(context, object, vector), r3);
return MarkAsCall(result, instr);
}
@@ -2176,12 +2172,12 @@ LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) {
LInstruction* LChunkBuilder::DoLoadFunctionPrototype(
HLoadFunctionPrototype* instr) {
return AssignEnvironment(DefineAsRegister(
- new(zone()) LLoadFunctionPrototype(UseRegister(instr->function()))));
+ new (zone()) LLoadFunctionPrototype(UseRegister(instr->function()))));
}
LInstruction* LChunkBuilder::DoLoadRoot(HLoadRoot* instr) {
- return DefineAsRegister(new(zone()) LLoadRoot);
+ return DefineAsRegister(new (zone()) LLoadRoot);
}
@@ -2196,28 +2192,28 @@ LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) {
if (instr->representation().IsDouble()) {
obj = UseRegister(instr->elements());
} else {
- DCHECK(instr->representation().IsSmiOrTagged());
obj = UseRegisterAtStart(instr->elements());
}
- result = DefineAsRegister(new(zone()) LLoadKeyed(obj, key));
+ result = DefineAsRegister(new (zone()) LLoadKeyed(obj, key));
} else {
- DCHECK(
- (instr->representation().IsInteger32() &&
- !IsDoubleOrFloatElementsKind(elements_kind)) ||
- (instr->representation().IsDouble() &&
- IsDoubleOrFloatElementsKind(elements_kind)));
+ DCHECK((instr->representation().IsInteger32() &&
+ !IsDoubleOrFloatElementsKind(elements_kind)) ||
+ (instr->representation().IsDouble() &&
+ IsDoubleOrFloatElementsKind(elements_kind)));
LOperand* backing_store = UseRegister(instr->elements());
- result = DefineAsRegister(new(zone()) LLoadKeyed(backing_store, key));
- }
-
- if ((instr->is_external() || instr->is_fixed_typed_array()) ?
- // see LCodeGen::DoLoadKeyedExternalArray
- ((elements_kind == EXTERNAL_UINT32_ELEMENTS ||
- elements_kind == UINT32_ELEMENTS) &&
- !instr->CheckFlag(HInstruction::kUint32)) :
- // see LCodeGen::DoLoadKeyedFixedDoubleArray and
- // LCodeGen::DoLoadKeyedFixedArray
- instr->RequiresHoleCheck()) {
+ result = DefineAsRegister(new (zone()) LLoadKeyed(backing_store, key));
+ }
+
+ if ((instr->is_external() || instr->is_fixed_typed_array())
+ ?
+ // see LCodeGen::DoLoadKeyedExternalArray
+ ((elements_kind == EXTERNAL_UINT32_ELEMENTS ||
+ elements_kind == UINT32_ELEMENTS) &&
+ !instr->CheckFlag(HInstruction::kUint32))
+ :
+ // see LCodeGen::DoLoadKeyedFixedDoubleArray and
+ // LCodeGen::DoLoadKeyedFixedArray
+ instr->RequiresHoleCheck()) {
result = AssignEnvironment(result);
}
return result;
@@ -2233,9 +2229,8 @@ LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) {
vector = FixedTemp(LoadIC::VectorRegister());
}
- LInstruction* result =
- DefineFixed(new(zone()) LLoadKeyedGeneric(context, object, key, vector),
- r0);
+ LInstruction* result = DefineFixed(
+ new (zone()) LLoadKeyedGeneric(context, object, key, vector), r3);
return MarkAsCall(result, instr);
}
@@ -2253,7 +2248,6 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) {
val = UseRegister(instr->value());
key = UseRegisterOrConstantAtStart(instr->key());
} else {
- DCHECK(instr->value()->representation().IsSmiOrTagged());
if (needs_write_barrier) {
object = UseTempRegister(instr->elements());
val = UseTempRegister(instr->value());
@@ -2265,14 +2259,13 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) {
}
}
- return new(zone()) LStoreKeyed(object, key, val);
+ return new (zone()) LStoreKeyed(object, key, val);
}
- DCHECK(
- (instr->value()->representation().IsInteger32() &&
- !IsDoubleOrFloatElementsKind(instr->elements_kind())) ||
- (instr->value()->representation().IsDouble() &&
- IsDoubleOrFloatElementsKind(instr->elements_kind())));
+ DCHECK((instr->value()->representation().IsInteger32() &&
+ !IsDoubleOrFloatElementsKind(instr->elements_kind())) ||
+ (instr->value()->representation().IsDouble() &&
+ IsDoubleOrFloatElementsKind(instr->elements_kind())));
DCHECK((instr->is_fixed_typed_array() &&
instr->elements()->representation().IsTagged()) ||
(instr->is_external() &&
@@ -2280,7 +2273,7 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) {
LOperand* val = UseRegister(instr->value());
LOperand* key = UseRegisterOrConstantAtStart(instr->key());
LOperand* backing_store = UseRegister(instr->elements());
- return new(zone()) LStoreKeyed(backing_store, key, val);
+ return new (zone()) LStoreKeyed(backing_store, key, val);
}
@@ -2294,8 +2287,8 @@ LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) {
DCHECK(instr->key()->representation().IsTagged());
DCHECK(instr->value()->representation().IsTagged());
- return MarkAsCall(
- new(zone()) LStoreKeyedGeneric(context, obj, key, val), instr);
+ return MarkAsCall(new (zone()) LStoreKeyedGeneric(context, obj, key, val),
+ instr);
}
@@ -2305,13 +2298,13 @@ LInstruction* LChunkBuilder::DoTransitionElementsKind(
LOperand* object = UseRegister(instr->object());
LOperand* new_map_reg = TempRegister();
LTransitionElementsKind* result =
- new(zone()) LTransitionElementsKind(object, NULL, new_map_reg);
+ new (zone()) LTransitionElementsKind(object, NULL, new_map_reg);
return result;
} else {
- LOperand* object = UseFixed(instr->object(), r0);
+ LOperand* object = UseFixed(instr->object(), r3);
LOperand* context = UseFixed(instr->context(), cp);
LTransitionElementsKind* result =
- new(zone()) LTransitionElementsKind(object, context, NULL);
+ new (zone()) LTransitionElementsKind(object, context, NULL);
return MarkAsCall(result, instr);
}
}
@@ -2322,7 +2315,7 @@ LInstruction* LChunkBuilder::DoTrapAllocationMemento(
LOperand* object = UseRegister(instr->object());
LOperand* temp = TempRegister();
LTrapAllocationMemento* result =
- new(zone()) LTrapAllocationMemento(object, temp);
+ new (zone()) LTrapAllocationMemento(object, temp);
return AssignEnvironment(result);
}
@@ -2330,18 +2323,16 @@ LInstruction* LChunkBuilder::DoTrapAllocationMemento(
LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) {
bool is_in_object = instr->access().IsInobject();
bool needs_write_barrier = instr->NeedsWriteBarrier();
- bool needs_write_barrier_for_map = instr->has_transition() &&
- instr->NeedsWriteBarrierForMap();
+ bool needs_write_barrier_for_map =
+ instr->has_transition() && instr->NeedsWriteBarrierForMap();
LOperand* obj;
if (needs_write_barrier) {
- obj = is_in_object
- ? UseRegister(instr->object())
- : UseTempRegister(instr->object());
+ obj = is_in_object ? UseRegister(instr->object())
+ : UseTempRegister(instr->object());
} else {
- obj = needs_write_barrier_for_map
- ? UseRegister(instr->object())
- : UseRegisterAtStart(instr->object());
+ obj = needs_write_barrier_for_map ? UseRegister(instr->object())
+ : UseRegisterAtStart(instr->object());
}
LOperand* val;
@@ -2356,7 +2347,7 @@ LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) {
// We need a temporary register for write barrier of the map field.
LOperand* temp = needs_write_barrier_for_map ? TempRegister() : NULL;
- return new(zone()) LStoreNamedField(obj, val, temp);
+ return new (zone()) LStoreNamedField(obj, val, temp);
}
@@ -2365,18 +2356,17 @@ LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) {
LOperand* obj = UseFixed(instr->object(), StoreIC::ReceiverRegister());
LOperand* val = UseFixed(instr->value(), StoreIC::ValueRegister());
- LInstruction* result = new(zone()) LStoreNamedGeneric(context, obj, val);
+ LInstruction* result = new (zone()) LStoreNamedGeneric(context, obj, val);
return MarkAsCall(result, instr);
}
LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) {
LOperand* context = UseFixed(instr->context(), cp);
- LOperand* left = UseFixed(instr->left(), r1);
- LOperand* right = UseFixed(instr->right(), r0);
+ LOperand* left = UseFixed(instr->left(), r4);
+ LOperand* right = UseFixed(instr->right(), r3);
return MarkAsCall(
- DefineFixed(new(zone()) LStringAdd(context, left, right), r0),
- instr);
+ DefineFixed(new (zone()) LStringAdd(context, left, right), r3), instr);
}
@@ -2385,7 +2375,7 @@ LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) {
LOperand* index = UseTempRegister(instr->index());
LOperand* context = UseAny(instr->context());
LStringCharCodeAt* result =
- new(zone()) LStringCharCodeAt(context, string, index);
+ new (zone()) LStringCharCodeAt(context, string, index);
return AssignPointerMap(DefineAsRegister(result));
}
@@ -2394,7 +2384,7 @@ LInstruction* LChunkBuilder::DoStringCharFromCode(HStringCharFromCode* instr) {
LOperand* char_code = UseRegister(instr->value());
LOperand* context = UseAny(instr->context());
LStringCharFromCode* result =
- new(zone()) LStringCharFromCode(context, char_code);
+ new (zone()) LStringCharFromCode(context, char_code);
return AssignPointerMap(DefineAsRegister(result));
}
@@ -2405,22 +2395,22 @@ LInstruction* LChunkBuilder::DoAllocate(HAllocate* instr) {
LOperand* size = UseRegisterOrConstant(instr->size());
LOperand* temp1 = TempRegister();
LOperand* temp2 = TempRegister();
- LAllocate* result = new(zone()) LAllocate(context, size, temp1, temp2);
+ LAllocate* result = new (zone()) LAllocate(context, size, temp1, temp2);
return AssignPointerMap(DefineAsRegister(result));
}
LInstruction* LChunkBuilder::DoRegExpLiteral(HRegExpLiteral* instr) {
LOperand* context = UseFixed(instr->context(), cp);
- return MarkAsCall(
- DefineFixed(new(zone()) LRegExpLiteral(context), r0), instr);
+ return MarkAsCall(DefineFixed(new (zone()) LRegExpLiteral(context), r3),
+ instr);
}
LInstruction* LChunkBuilder::DoFunctionLiteral(HFunctionLiteral* instr) {
LOperand* context = UseFixed(instr->context(), cp);
- return MarkAsCall(
- DefineFixed(new(zone()) LFunctionLiteral(context), r0), instr);
+ return MarkAsCall(DefineFixed(new (zone()) LFunctionLiteral(context), r3),
+ instr);
}
@@ -2428,12 +2418,12 @@ LInstruction* LChunkBuilder::DoOsrEntry(HOsrEntry* instr) {
DCHECK(argument_count_ == 0);
allocator_->MarkAsOsrEntry();
current_block_->last_environment()->set_ast_id(instr->ast_id());
- return AssignEnvironment(new(zone()) LOsrEntry);
+ return AssignEnvironment(new (zone()) LOsrEntry);
}
LInstruction* LChunkBuilder::DoParameter(HParameter* instr) {
- LParameter* result = new(zone()) LParameter;
+ LParameter* result = new (zone()) LParameter;
if (instr->kind() == HParameter::STACK_PARAMETER) {
int spill_index = chunk()->GetParameterStackSlot(instr->index());
return DefineAsSpilled(result, spill_index);
@@ -2462,13 +2452,13 @@ LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) {
spill_index = 0;
}
}
- return DefineAsSpilled(new(zone()) LUnknownOSRValue, spill_index);
+ return DefineAsSpilled(new (zone()) LUnknownOSRValue, spill_index);
}
LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) {
LOperand* context = UseFixed(instr->context(), cp);
- return MarkAsCall(DefineFixed(new(zone()) LCallStub(context), r0), instr);
+ return MarkAsCall(DefineFixed(new (zone()) LCallStub(context), r3), instr);
}
@@ -2494,32 +2484,32 @@ LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) {
LOperand* args = UseRegister(instr->arguments());
LOperand* length = UseRegisterOrConstantAtStart(instr->length());
LOperand* index = UseRegisterOrConstantAtStart(instr->index());
- return DefineAsRegister(new(zone()) LAccessArgumentsAt(args, length, index));
+ return DefineAsRegister(new (zone()) LAccessArgumentsAt(args, length, index));
}
LInstruction* LChunkBuilder::DoToFastProperties(HToFastProperties* instr) {
- LOperand* object = UseFixed(instr->value(), r0);
- LToFastProperties* result = new(zone()) LToFastProperties(object);
- return MarkAsCall(DefineFixed(result, r0), instr);
+ LOperand* object = UseFixed(instr->value(), r3);
+ LToFastProperties* result = new (zone()) LToFastProperties(object);
+ return MarkAsCall(DefineFixed(result, r3), instr);
}
LInstruction* LChunkBuilder::DoTypeof(HTypeof* instr) {
LOperand* context = UseFixed(instr->context(), cp);
- LTypeof* result = new(zone()) LTypeof(context, UseFixed(instr->value(), r0));
- return MarkAsCall(DefineFixed(result, r0), instr);
+ LTypeof* result = new (zone()) LTypeof(context, UseFixed(instr->value(), r3));
+ return MarkAsCall(DefineFixed(result, r3), instr);
}
LInstruction* LChunkBuilder::DoTypeofIsAndBranch(HTypeofIsAndBranch* instr) {
- return new(zone()) LTypeofIsAndBranch(UseRegister(instr->value()));
+ return new (zone()) LTypeofIsAndBranch(UseRegister(instr->value()));
}
LInstruction* LChunkBuilder::DoIsConstructCallAndBranch(
HIsConstructCallAndBranch* instr) {
- return new(zone()) LIsConstructCallAndBranch(TempRegister());
+ return new (zone()) LIsConstructCallAndBranch(TempRegister());
}
@@ -2532,12 +2522,12 @@ LInstruction* LChunkBuilder::DoSimulate(HSimulate* instr) {
LInstruction* LChunkBuilder::DoStackCheck(HStackCheck* instr) {
if (instr->is_function_entry()) {
LOperand* context = UseFixed(instr->context(), cp);
- return MarkAsCall(new(zone()) LStackCheck(context), instr);
+ return MarkAsCall(new (zone()) LStackCheck(context), instr);
} else {
DCHECK(instr->is_backwards_branch());
LOperand* context = UseAny(instr->context());
return AssignEnvironment(
- AssignPointerMap(new(zone()) LStackCheck(context)));
+ AssignPointerMap(new (zone()) LStackCheck(context)));
}
}
@@ -2546,11 +2536,9 @@ LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) {
HEnvironment* outer = current_block_->last_environment();
outer->set_ast_id(instr->ReturnId());
HConstant* undefined = graph()->GetConstantUndefined();
- HEnvironment* inner = outer->CopyForInlining(instr->closure(),
- instr->arguments_count(),
- instr->function(),
- undefined,
- instr->inlining_kind());
+ HEnvironment* inner = outer->CopyForInlining(
+ instr->closure(), instr->arguments_count(), instr->function(), undefined,
+ instr->inlining_kind());
// Only replay binding of arguments object if it wasn't removed from graph.
if (instr->arguments_var() != NULL && instr->arguments_object()->IsLinked()) {
inner->Bind(instr->arguments_var(), instr->arguments_object());
@@ -2569,12 +2557,12 @@ LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) {
if (env->entry()->arguments_pushed()) {
int argument_count = env->arguments_environment()->parameter_count();
- pop = new(zone()) LDrop(argument_count);
+ pop = new (zone()) LDrop(argument_count);
DCHECK(instr->argument_delta() == -argument_count);
}
- HEnvironment* outer = current_block_->last_environment()->
- DiscardInlined(false);
+ HEnvironment* outer =
+ current_block_->last_environment()->DiscardInlined(false);
current_block_->UpdateEnvironment(outer);
return pop;
@@ -2583,29 +2571,30 @@ LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) {
LInstruction* LChunkBuilder::DoForInPrepareMap(HForInPrepareMap* instr) {
LOperand* context = UseFixed(instr->context(), cp);
- LOperand* object = UseFixed(instr->enumerable(), r0);
- LForInPrepareMap* result = new(zone()) LForInPrepareMap(context, object);
- return MarkAsCall(DefineFixed(result, r0), instr, CAN_DEOPTIMIZE_EAGERLY);
+ LOperand* object = UseFixed(instr->enumerable(), r3);
+ LForInPrepareMap* result = new (zone()) LForInPrepareMap(context, object);
+ return MarkAsCall(DefineFixed(result, r3), instr, CAN_DEOPTIMIZE_EAGERLY);
}
LInstruction* LChunkBuilder::DoForInCacheArray(HForInCacheArray* instr) {
LOperand* map = UseRegister(instr->map());
- return AssignEnvironment(DefineAsRegister(new(zone()) LForInCacheArray(map)));
+ return AssignEnvironment(
+ DefineAsRegister(new (zone()) LForInCacheArray(map)));
}
LInstruction* LChunkBuilder::DoCheckMapValue(HCheckMapValue* instr) {
LOperand* value = UseRegisterAtStart(instr->value());
LOperand* map = UseRegisterAtStart(instr->map());
- return AssignEnvironment(new(zone()) LCheckMapValue(value, map));
+ return AssignEnvironment(new (zone()) LCheckMapValue(value, map));
}
LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
LOperand* object = UseRegister(instr->object());
LOperand* index = UseTempRegister(instr->index());
- LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index);
+ LLoadFieldByIndex* load = new (zone()) LLoadFieldByIndex(object, index);
LInstruction* result = DefineSameAsFirst(load);
return AssignPointerMap(result);
}
@@ -2613,7 +2602,7 @@ LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
LInstruction* LChunkBuilder::DoStoreFrameContext(HStoreFrameContext* instr) {
LOperand* context = UseRegisterAtStart(instr->context());
- return new(zone()) LStoreFrameContext(context);
+ return new (zone()) LStoreFrameContext(context);
}
@@ -2622,8 +2611,8 @@ LInstruction* LChunkBuilder::DoAllocateBlockContext(
LOperand* context = UseFixed(instr->context(), cp);
LOperand* function = UseRegisterAtStart(instr->function());
LAllocateBlockContext* result =
- new(zone()) LAllocateBlockContext(context, function);
+ new (zone()) LAllocateBlockContext(context, function);
return MarkAsCall(DefineFixed(result, cp), instr);
}
-
-} } // namespace v8::internal
+}
+} // namespace v8::internal
« src/hydrogen-bch.cc ('K') | « src/ppc/lithium-ppc.h ('k') | src/ppc/macro-assembler-ppc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698