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

Unified Diff: runtime/vm/intermediate_language_arm64.cc

Issue 2481873005: clang-format runtime/vm (Closed)
Patch Set: Merge Created 4 years, 1 month 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
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_dbc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_arm64.cc
diff --git a/runtime/vm/intermediate_language_arm64.cc b/runtime/vm/intermediate_language_arm64.cc
index 1e4baa2673825cf84df5182a5843281c0fd81d62..5e4e500aaf956161cdf0cb3b24bca08103c9d64a 100644
--- a/runtime/vm/intermediate_language_arm64.cc
+++ b/runtime/vm/intermediate_language_arm64.cc
@@ -29,8 +29,8 @@ namespace dart {
// Generic summary for call instructions that have all arguments pushed
// on the stack and return the result in a fixed register R0.
LocationSummary* Instruction::MakeCallSummary(Zone* zone) {
- LocationSummary* result = new(zone) LocationSummary(
- zone, 0, 0, LocationSummary::kCall);
+ LocationSummary* result =
+ new (zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
result->set_out(0, Location::RegisterLocation(R0));
return result;
}
@@ -40,8 +40,8 @@ LocationSummary* PushArgumentInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* locs = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* locs = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
locs->set_in(0, Location::AnyOrConstant(value()));
return locs;
}
@@ -66,12 +66,11 @@ void PushArgumentInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* ReturnInstr::MakeLocationSummary(Zone* zone,
- bool opt) const {
+LocationSummary* ReturnInstr::MakeLocationSummary(Zone* zone, bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* locs = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* locs = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
locs->set_in(0, Location::RegisterLocation(R0));
return locs;
}
@@ -113,18 +112,30 @@ void ReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
static Condition NegateCondition(Condition condition) {
switch (condition) {
- case EQ: return NE;
- case NE: return EQ;
- case LT: return GE;
- case LE: return GT;
- case GT: return LE;
- case GE: return LT;
- case CC: return CS;
- case LS: return HI;
- case HI: return LS;
- case CS: return CC;
- case VS: return VC;
- case VC: return VS;
+ case EQ:
+ return NE;
+ case NE:
+ return EQ;
+ case LT:
+ return GE;
+ case LE:
+ return GT;
+ case GT:
+ return LE;
+ case GE:
+ return LT;
+ case CC:
+ return CS;
+ case LS:
+ return HI;
+ case HI:
+ return LS;
+ case CS:
+ return CC;
+ case VS:
+ return VC;
+ case VC:
+ return VS;
default:
UNREACHABLE();
return EQ;
@@ -154,7 +165,7 @@ void IfThenElseInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
ASSERT(!left.IsConstant() || !right.IsConstant());
// Emit comparison code. This must not overwrite the result register.
- BranchLabels labels = { NULL, NULL, NULL };
+ BranchLabels labels = {NULL, NULL, NULL};
Condition true_condition = comparison()->EmitComparisonCode(compiler, labels);
const bool is_power_of_two_kind = IsPowerOfTwoKind(if_true_, if_false_);
@@ -186,8 +197,7 @@ void IfThenElseInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ LslImmediate(result, result, shift + kSmiTagSize);
} else {
__ sub(result, result, Operand(1));
- const int64_t val =
- Smi::RawValue(true_value) - Smi::RawValue(false_value);
+ const int64_t val = Smi::RawValue(true_value) - Smi::RawValue(false_value);
__ AndImmediate(result, result, val);
if (false_value != 0) {
__ AddImmediate(result, result, Smi::RawValue(false_value));
@@ -200,8 +210,8 @@ LocationSummary* ClosureCallInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
summary->set_in(0, Location::RegisterLocation(R0)); // Function.
summary->set_out(0, Location::RegisterLocation(R0));
return summary;
@@ -211,9 +221,8 @@ LocationSummary* ClosureCallInstr::MakeLocationSummary(Zone* zone,
void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
// Load arguments descriptor in R4.
int argument_count = ArgumentCount();
- const Array& arguments_descriptor =
- Array::ZoneHandle(ArgumentsDescriptor::New(argument_count,
- argument_names()));
+ const Array& arguments_descriptor = Array::ZoneHandle(
+ ArgumentsDescriptor::New(argument_count, argument_names()));
__ LoadObject(R4, arguments_descriptor);
// R4: Arguments descriptor.
@@ -237,8 +246,7 @@ void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
// Add deoptimization continuation point after the call and before the
// arguments are removed.
// In optimized code this descriptor is needed for exception handling.
- compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
- deopt_id_after,
+ compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after,
token_pos());
__ Drop(argument_count);
}
@@ -246,9 +254,7 @@ void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
LocationSummary* LoadLocalInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
- return LocationSummary::Make(zone,
- 0,
- Location::RequiresRegister(),
+ return LocationSummary::Make(zone, 0, Location::RequiresRegister(),
LocationSummary::kNoCall);
}
@@ -261,9 +267,7 @@ void LoadLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
LocationSummary* StoreLocalInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
- return LocationSummary::Make(zone,
- 1,
- Location::SameAsFirstInput(),
+ return LocationSummary::Make(zone, 1, Location::SameAsFirstInput(),
LocationSummary::kNoCall);
}
@@ -278,9 +282,7 @@ void StoreLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
LocationSummary* ConstantInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
- return LocationSummary::Make(zone,
- 0,
- Location::RequiresRegister(),
+ return LocationSummary::Make(zone, 0, Location::RequiresRegister(),
LocationSummary::kNoCall);
}
@@ -297,12 +299,10 @@ void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
LocationSummary* UnboxedConstantInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 0;
- const Location out = (representation_ == kUnboxedInt32) ?
- Location::RequiresRegister() : Location::RequiresFpuRegister();
- return LocationSummary::Make(zone,
- kNumInputs,
- out,
- LocationSummary::kNoCall);
+ const Location out = (representation_ == kUnboxedInt32)
+ ? Location::RequiresRegister()
+ : Location::RequiresFpuRegister();
+ return LocationSummary::Make(zone, kNumInputs, out, LocationSummary::kNoCall);
}
@@ -334,8 +334,8 @@ LocationSummary* AssertAssignableInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
summary->set_in(0, Location::RegisterLocation(R0)); // Value.
summary->set_in(1, Location::RegisterLocation(R1)); // Type arguments.
summary->set_out(0, Location::RegisterLocation(R0));
@@ -347,8 +347,8 @@ LocationSummary* AssertBooleanInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* locs = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+ LocationSummary* locs = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
locs->set_in(0, Location::RegisterLocation(R0));
locs->set_out(0, Location::RegisterLocation(R0));
return locs;
@@ -377,11 +377,8 @@ static void EmitAssertBoolean(Register reg,
}
__ Push(reg); // Push the source object.
- compiler->GenerateRuntimeCall(token_pos,
- deopt_id,
- kNonBoolTypeErrorRuntimeEntry,
- 1,
- locs);
+ compiler->GenerateRuntimeCall(token_pos, deopt_id,
+ kNonBoolTypeErrorRuntimeEntry, 1, locs);
// We should never return here.
__ brk(0);
__ Bind(&done);
@@ -399,12 +396,18 @@ void AssertBooleanInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
static Condition TokenKindToSmiCondition(Token::Kind kind) {
switch (kind) {
- case Token::kEQ: return EQ;
- case Token::kNE: return NE;
- case Token::kLT: return LT;
- case Token::kGT: return GT;
- case Token::kLTE: return LE;
- case Token::kGTE: return GE;
+ case Token::kEQ:
+ return EQ;
+ case Token::kNE:
+ return NE;
+ case Token::kLT:
+ return LT;
+ case Token::kGT:
+ return GT;
+ case Token::kLTE:
+ return LE;
+ case Token::kGTE:
+ return GE;
default:
UNREACHABLE();
return VS;
@@ -414,16 +417,26 @@ static Condition TokenKindToSmiCondition(Token::Kind kind) {
static Condition FlipCondition(Condition condition) {
switch (condition) {
- case EQ: return EQ;
- case NE: return NE;
- case LT: return GT;
- case LE: return GE;
- case GT: return LT;
- case GE: return LE;
- case CC: return HI;
- case LS: return CS;
- case HI: return CC;
- case CS: return LS;
+ case EQ:
+ return EQ;
+ case NE:
+ return NE;
+ case LT:
+ return GT;
+ case LE:
+ return GE;
+ case GT:
+ return LT;
+ case GE:
+ return LE;
+ case CC:
+ return HI;
+ case LS:
+ return CS;
+ case HI:
+ return CC;
+ case CS:
+ return LS;
default:
UNREACHABLE();
return EQ;
@@ -475,9 +488,9 @@ LocationSummary* EqualityCompareInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 2;
if (operation_cid() == kDoubleCid) {
- const intptr_t kNumTemps = 0;
- LocationSummary* locs = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ const intptr_t kNumTemps = 0;
+ LocationSummary* locs = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
locs->set_in(0, Location::RequiresFpuRegister());
locs->set_in(1, Location::RequiresFpuRegister());
locs->set_out(0, Location::RequiresRegister());
@@ -485,8 +498,8 @@ LocationSummary* EqualityCompareInstr::MakeLocationSummary(Zone* zone,
}
if (operation_cid() == kSmiCid) {
const intptr_t kNumTemps = 0;
- LocationSummary* locs = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* locs = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
locs->set_in(0, Location::RegisterOrConstant(left()));
// Only one input can be a constant operand. The case of two constant
// operands should be handled by constant propagation.
@@ -504,12 +517,18 @@ LocationSummary* EqualityCompareInstr::MakeLocationSummary(Zone* zone,
static Condition TokenKindToDoubleCondition(Token::Kind kind) {
switch (kind) {
- case Token::kEQ: return EQ;
- case Token::kNE: return NE;
- case Token::kLT: return LT;
- case Token::kGT: return GT;
- case Token::kLTE: return LE;
- case Token::kGTE: return GE;
+ case Token::kEQ:
+ return EQ;
+ case Token::kNE:
+ return NE;
+ case Token::kLT:
+ return LT;
+ case Token::kGT:
+ return GT;
+ case Token::kLTE:
+ return LE;
+ case Token::kGTE:
+ return GE;
default:
UNREACHABLE();
return VS;
@@ -542,7 +561,7 @@ Condition EqualityCompareInstr::EmitComparisonCode(FlowGraphCompiler* compiler,
void EqualityCompareInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
ASSERT((kind() == Token::kEQ) || (kind() == Token::kNE));
Label is_true, is_false;
- BranchLabels labels = { &is_true, &is_false, &is_false };
+ BranchLabels labels = {&is_true, &is_false, &is_false};
Condition true_condition = EmitComparisonCode(compiler, labels);
if ((operation_cid() == kDoubleCid) && (true_condition != NE)) {
// Special case for NaN comparison. Result is always false unless
@@ -578,12 +597,11 @@ void EqualityCompareInstr::EmitBranchCode(FlowGraphCompiler* compiler,
}
-LocationSummary* TestSmiInstr::MakeLocationSummary(Zone* zone,
- bool opt) const {
+LocationSummary* TestSmiInstr::MakeLocationSummary(Zone* zone, bool opt) const {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
- LocationSummary* locs = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* locs = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
locs->set_in(0, Location::RequiresRegister());
// Only one input can be a constant operand. The case of two constant
// operands should be handled by constant propagation.
@@ -598,8 +616,7 @@ Condition TestSmiInstr::EmitComparisonCode(FlowGraphCompiler* compiler,
Location right = locs()->in(1);
if (right.IsConstant()) {
ASSERT(right.constant().IsSmi());
- const int64_t imm =
- reinterpret_cast<int64_t>(right.constant().raw());
+ const int64_t imm = reinterpret_cast<int64_t>(right.constant().raw());
__ TestImmediate(left, imm);
} else {
__ tst(left, Operand(right.reg()));
@@ -627,8 +644,8 @@ LocationSummary* TestCidsInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 1;
- LocationSummary* locs = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* locs = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
locs->set_in(0, Location::RequiresRegister());
locs->set_temp(0, Location::RequiresRegister());
locs->set_out(0, Location::RequiresRegister());
@@ -642,11 +659,11 @@ Condition TestCidsInstr::EmitComparisonCode(FlowGraphCompiler* compiler,
const Register val_reg = locs()->in(0).reg();
const Register cid_reg = locs()->temp(0).reg();
- Label* deopt = CanDeoptimize()
- ? compiler->AddDeoptStub(deopt_id(),
- ICData::kDeoptTestCids,
- licm_hoisted_ ? ICData::kHoisted : 0)
- : NULL;
+ Label* deopt =
+ CanDeoptimize()
+ ? compiler->AddDeoptStub(deopt_id(), ICData::kDeoptTestCids,
+ licm_hoisted_ ? ICData::kHoisted : 0)
+ : NULL;
const intptr_t true_result = (kind() == Token::kIS) ? 1 : 0;
const ZoneGrowableArray<intptr_t>& data = cid_results();
@@ -688,7 +705,7 @@ void TestCidsInstr::EmitBranchCode(FlowGraphCompiler* compiler,
void TestCidsInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
const Register result_reg = locs()->out(0).reg();
Label is_true, is_false, done;
- BranchLabels labels = { &is_true, &is_false, &is_false };
+ BranchLabels labels = {&is_true, &is_false, &is_false};
EmitComparisonCode(compiler, labels);
// TODO(zra): instead of branching, use the csel instruction to get
// True or False into result.
@@ -706,16 +723,16 @@ LocationSummary* RelationalOpInstr::MakeLocationSummary(Zone* zone,
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
if (operation_cid() == kDoubleCid) {
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_in(1, Location::RequiresFpuRegister());
summary->set_out(0, Location::RequiresRegister());
return summary;
}
ASSERT(operation_cid() == kSmiCid);
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RegisterOrConstant(left()));
// Only one input can be a constant operand. The case of two constant
// operands should be handled by constant propagation.
@@ -740,7 +757,7 @@ Condition RelationalOpInstr::EmitComparisonCode(FlowGraphCompiler* compiler,
void RelationalOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
Label is_true, is_false;
- BranchLabels labels = { &is_true, &is_false, &is_false };
+ BranchLabels labels = {&is_true, &is_false, &is_false};
Condition true_condition = EmitComparisonCode(compiler, labels);
if ((operation_cid() == kDoubleCid) && (true_condition != NE)) {
// Special case for NaN comparison. Result is always false unless
@@ -788,8 +805,8 @@ void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ PushObject(Object::null_object());
// Pass a pointer to the first argument in R2.
if (!function().HasOptionalParameters()) {
- __ AddImmediate(R2, FP, (kParamEndSlotFromFp +
- function().NumParameters()) * kWordSize);
+ __ AddImmediate(
+ R2, FP, (kParamEndSlotFromFp + function().NumParameters()) * kWordSize);
} else {
__ AddImmediate(R2, FP, kFirstLocalSlotFromFp * kWordSize);
}
@@ -820,21 +837,18 @@ void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ LoadImmediate(R1, argc_tag);
ExternalLabel label(entry);
__ LoadNativeEntry(R5, &label);
- compiler->GenerateCall(token_pos(),
- *stub_entry,
- RawPcDescriptors::kOther,
+ compiler->GenerateCall(token_pos(), *stub_entry, RawPcDescriptors::kOther,
locs());
__ Pop(result);
}
LocationSummary* OneByteStringFromCharCodeInstr::MakeLocationSummary(
- Zone* zone, bool opt) const {
+ Zone* zone,
+ bool opt) const {
const intptr_t kNumInputs = 1;
// TODO(fschneider): Allow immediate operands for the char code.
- return LocationSummary::Make(zone,
- kNumInputs,
- Location::RequiresRegister(),
+ return LocationSummary::Make(zone, kNumInputs, Location::RequiresRegister(),
LocationSummary::kNoCall);
}
@@ -846,8 +860,8 @@ void OneByteStringFromCharCodeInstr::EmitNativeCode(
const Register result = locs()->out(0).reg();
__ ldr(result, Address(THR, Thread::predefined_symbols_address_offset()));
- __ AddImmediate(
- result, result, Symbols::kNullCharCodeSymbolOffset * kWordSize);
+ __ AddImmediate(result, result,
+ Symbols::kNullCharCodeSymbolOffset * kWordSize);
__ SmiUntag(TMP, char_code); // Untag to use scaled adress mode.
__ ldr(result, Address(result, TMP, UXTX, Address::Scaled));
}
@@ -856,9 +870,7 @@ void OneByteStringFromCharCodeInstr::EmitNativeCode(
LocationSummary* StringToCharCodeInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
- return LocationSummary::Make(zone,
- kNumInputs,
- Location::RequiresRegister(),
+ return LocationSummary::Make(zone, kNumInputs, Location::RequiresRegister(),
LocationSummary::kNoCall);
}
@@ -880,8 +892,8 @@ LocationSummary* StringInterpolateInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
summary->set_in(0, Location::RegisterLocation(R0));
summary->set_out(0, Location::RegisterLocation(R0));
return summary;
@@ -893,12 +905,8 @@ void StringInterpolateInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ Push(array);
const int kNumberOfArguments = 1;
const Array& kNoArgumentNames = Object::null_array();
- compiler->GenerateStaticCall(deopt_id(),
- token_pos(),
- CallFunction(),
- kNumberOfArguments,
- kNoArgumentNames,
- locs(),
+ compiler->GenerateStaticCall(deopt_id(), token_pos(), CallFunction(),
+ kNumberOfArguments, kNoArgumentNames, locs(),
ICData::Handle());
ASSERT(locs()->out(0).reg() == R0);
}
@@ -907,9 +915,7 @@ void StringInterpolateInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
- return LocationSummary::Make(zone,
- kNumInputs,
- Location::RequiresRegister(),
+ return LocationSummary::Make(zone, kNumInputs, Location::RequiresRegister(),
LocationSummary::kNoCall);
}
@@ -929,9 +935,7 @@ void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
LocationSummary* LoadClassIdInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
- return LocationSummary::Make(zone,
- kNumInputs,
- Location::RequiresRegister(),
+ return LocationSummary::Make(zone, kNumInputs, Location::RequiresRegister(),
LocationSummary::kNoCall);
}
@@ -1031,13 +1035,13 @@ static bool CanBeImmediateIndex(Value* value, intptr_t cid, bool is_external) {
}
const int64_t index = Smi::Cast(constant->value()).AsInt64Value();
const intptr_t scale = Instance::ElementSizeFor(cid);
- const int64_t offset = index * scale +
+ const int64_t offset =
+ index * scale +
(is_external ? 0 : (Instance::DataOffsetFor(cid) - kHeapObjectTag));
if (!Utils::IsInt(32, offset)) {
return false;
}
- return Address::CanHoldOffset(static_cast<int32_t>(offset),
- Address::Offset,
+ return Address::CanHoldOffset(static_cast<int32_t>(offset), Address::Offset,
Address::OperandSizeFor(cid));
}
@@ -1046,17 +1050,17 @@ LocationSummary* LoadIndexedInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = aligned() ? 0 : 1;
- LocationSummary* locs = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* locs = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
locs->set_in(0, Location::RequiresRegister());
if (CanBeImmediateIndex(index(), class_id(), IsExternal())) {
locs->set_in(1, Location::Constant(index()->definition()->AsConstant()));
} else {
locs->set_in(1, Location::RequiresRegister());
}
- if ((representation() == kUnboxedDouble) ||
+ if ((representation() == kUnboxedDouble) ||
(representation() == kUnboxedFloat32x4) ||
- (representation() == kUnboxedInt32x4) ||
+ (representation() == kUnboxedInt32x4) ||
(representation() == kUnboxedFloat64x2)) {
locs->set_out(0, Location::RequiresFpuRegister());
} else {
@@ -1077,13 +1081,14 @@ void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
Address element_address(TMP); // Bad address.
if (aligned()) {
- element_address = index.IsRegister()
- ? __ ElementAddressForRegIndex(true, // Load.
- IsExternal(), class_id(), index_scale(),
- array, index.reg())
- : __ ElementAddressForIntIndex(
- IsExternal(), class_id(), index_scale(),
- array, Smi::Cast(index.constant()).Value());
+ element_address =
+ index.IsRegister()
+ ? __ ElementAddressForRegIndex(true, // Load.
+ IsExternal(), class_id(),
+ index_scale(), array, index.reg())
+ : __ ElementAddressForIntIndex(IsExternal(), class_id(),
+ index_scale(), array,
+ Smi::Cast(index.constant()).Value());
// Warning: element_address may use register TMP as base.
} else {
if (index.IsRegister()) {
@@ -1092,16 +1097,15 @@ void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
IsExternal(), class_id(), index_scale(),
array, index.reg());
} else {
- __ LoadElementAddressForIntIndex(address,
- IsExternal(), class_id(), index_scale(),
- array,
+ __ LoadElementAddressForIntIndex(address, IsExternal(), class_id(),
+ index_scale(), array,
Smi::Cast(index.constant()).Value());
}
}
- if ((representation() == kUnboxedDouble) ||
+ if ((representation() == kUnboxedDouble) ||
(representation() == kUnboxedFloat32x4) ||
- (representation() == kUnboxedInt32x4) ||
+ (representation() == kUnboxedInt32x4) ||
(representation() == kUnboxedFloat64x2)) {
const VRegister result = locs()->out(0).fpu_reg();
switch (class_id()) {
@@ -1147,7 +1151,7 @@ void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
break;
default:
UNREACHABLE();
- }
+ }
return;
}
@@ -1200,8 +1204,8 @@ LocationSummary* LoadCodeUnitsInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresRegister());
summary->set_in(1, Location::RequiresRegister());
summary->set_out(0, Location::RequiresRegister());
@@ -1215,7 +1219,7 @@ void LoadCodeUnitsInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
const Location index = locs()->in(1);
Address element_address = __ ElementAddressForRegIndex(
- true, IsExternal(), class_id(), index_scale(), str, index.reg());
+ true, IsExternal(), class_id(), index_scale(), str, index.reg());
// Warning: element_address may use register TMP as base.
Register result = locs()->out(0).reg();
@@ -1223,19 +1227,31 @@ void LoadCodeUnitsInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
case kOneByteStringCid:
case kExternalOneByteStringCid:
switch (element_count()) {
- case 1: __ ldr(result, element_address, kUnsignedByte); break;
- case 2: __ ldr(result, element_address, kUnsignedHalfword); break;
- case 4: __ ldr(result, element_address, kUnsignedWord); break;
- default: UNREACHABLE();
+ case 1:
+ __ ldr(result, element_address, kUnsignedByte);
+ break;
+ case 2:
+ __ ldr(result, element_address, kUnsignedHalfword);
+ break;
+ case 4:
+ __ ldr(result, element_address, kUnsignedWord);
+ break;
+ default:
+ UNREACHABLE();
}
__ SmiTag(result);
break;
case kTwoByteStringCid:
case kExternalTwoByteStringCid:
switch (element_count()) {
- case 1: __ ldr(result, element_address, kUnsignedHalfword); break;
- case 2: __ ldr(result, element_address, kUnsignedWord); break;
- default: UNREACHABLE();
+ case 1:
+ __ ldr(result, element_address, kUnsignedHalfword);
+ break;
+ case 2:
+ __ ldr(result, element_address, kUnsignedWord);
+ break;
+ default:
+ UNREACHABLE();
}
__ SmiTag(result);
break;
@@ -1249,8 +1265,8 @@ void LoadCodeUnitsInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
Representation StoreIndexedInstr::RequiredInputRepresentation(
intptr_t idx) const {
// Array can be a Dart object or a pointer to external data.
- if (idx == 0) return kNoRepresentation; // Flexible input representation.
- if (idx == 1) return kTagged; // Index is a smi.
+ if (idx == 0) return kNoRepresentation; // Flexible input representation.
+ if (idx == 1) return kTagged; // Index is a smi.
ASSERT(idx == 2);
switch (class_id_) {
case kArrayCid:
@@ -1287,8 +1303,8 @@ LocationSummary* StoreIndexedInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 3;
const intptr_t kNumTemps = aligned() ? 0 : 2;
- LocationSummary* locs = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* locs = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
locs->set_in(0, Location::RequiresRegister());
if (CanBeImmediateIndex(index(), class_id(), IsExternal())) {
locs->set_in(1, Location::Constant(index()->definition()->AsConstant()));
@@ -1298,8 +1314,8 @@ LocationSummary* StoreIndexedInstr::MakeLocationSummary(Zone* zone,
switch (class_id()) {
case kArrayCid:
locs->set_in(2, ShouldEmitStoreBarrier()
- ? Location::WritableRegister()
- : Location::RegisterOrConstant(value()));
+ ? Location::WritableRegister()
+ : Location::RegisterOrConstant(value()));
break;
case kExternalTypedDataUint8ArrayCid:
case kExternalTypedDataUint8ClampedArrayCid:
@@ -1343,13 +1359,14 @@ void StoreIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
Address element_address(TMP); // Bad address.
if (aligned()) {
- element_address = index.IsRegister()
- ? __ ElementAddressForRegIndex(false, // Store.
- IsExternal(), class_id(), index_scale(),
- array, index.reg())
- : __ ElementAddressForIntIndex(
- IsExternal(), class_id(), index_scale(),
- array, Smi::Cast(index.constant()).Value());
+ element_address =
+ index.IsRegister()
+ ? __ ElementAddressForRegIndex(false, // Store.
+ IsExternal(), class_id(),
+ index_scale(), array, index.reg())
+ : __ ElementAddressForIntIndex(IsExternal(), class_id(),
+ index_scale(), array,
+ Smi::Cast(index.constant()).Value());
} else {
if (index.IsRegister()) {
__ LoadElementAddressForRegIndex(address,
@@ -1357,9 +1374,8 @@ void StoreIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
IsExternal(), class_id(), index_scale(),
array, index.reg());
} else {
- __ LoadElementAddressForIntIndex(address,
- IsExternal(), class_id(), index_scale(),
- array,
+ __ LoadElementAddressForIntIndex(address, IsExternal(), class_id(),
+ index_scale(), array,
Smi::Cast(index.constant()).Value());
}
}
@@ -1412,7 +1428,7 @@ void StoreIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
const Register value = locs()->in(2).reg();
__ CompareImmediate(value, 0x1FE); // Smi value and smi 0xFF.
// Clamp to 0x00 or 0xFF respectively.
- __ csetm(TMP, GT); // TMP = value > 0x1FE ? -1 : 0.
+ __ csetm(TMP, GT); // TMP = value > 0x1FE ? -1 : 0.
__ csel(TMP, value, TMP, LS); // TMP = value in range ? value : TMP.
__ SmiUntag(TMP);
__ str(TMP, element_address, kUnsignedByte);
@@ -1492,11 +1508,10 @@ LocationSummary* GuardFieldClassInstr::MakeLocationSummary(Zone* zone,
const intptr_t value_cid = value()->Type()->ToCid();
const intptr_t field_cid = field().guarded_cid();
- const bool emit_full_guard =
- !opt || (field_cid == kIllegalCid);
+ const bool emit_full_guard = !opt || (field_cid == kIllegalCid);
- const bool needs_value_cid_temp_reg = emit_full_guard ||
- ((value_cid == kDynamicCid) && (field_cid != kSmiCid));
+ const bool needs_value_cid_temp_reg =
+ emit_full_guard || ((value_cid == kDynamicCid) && (field_cid != kSmiCid));
const bool needs_field_temp_reg = emit_full_guard;
@@ -1508,8 +1523,8 @@ LocationSummary* GuardFieldClassInstr::MakeLocationSummary(Zone* zone,
num_temps++;
}
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, num_temps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, num_temps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresRegister());
for (intptr_t i = 0; i < num_temps; i++) {
@@ -1529,7 +1544,8 @@ void GuardFieldClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
if (field_cid == kDynamicCid) {
if (Compiler::IsBackgroundCompilation()) {
// Field state changed while compiling.
- Compiler::AbortBackgroundCompilation(deopt_id(),
+ Compiler::AbortBackgroundCompilation(
+ deopt_id(),
"GuardFieldClassInstr: field state changed while compiling");
}
ASSERT(!compiler->is_optimizing());
@@ -1539,31 +1555,34 @@ void GuardFieldClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
const bool emit_full_guard =
!compiler->is_optimizing() || (field_cid == kIllegalCid);
- const bool needs_value_cid_temp_reg = emit_full_guard ||
- ((value_cid == kDynamicCid) && (field_cid != kSmiCid));
+ const bool needs_value_cid_temp_reg =
+ emit_full_guard || ((value_cid == kDynamicCid) && (field_cid != kSmiCid));
const bool needs_field_temp_reg = emit_full_guard;
const Register value_reg = locs()->in(0).reg();
- const Register value_cid_reg = needs_value_cid_temp_reg ?
- locs()->temp(0).reg() : kNoRegister;
+ const Register value_cid_reg =
+ needs_value_cid_temp_reg ? locs()->temp(0).reg() : kNoRegister;
- const Register field_reg = needs_field_temp_reg ?
- locs()->temp(locs()->temp_count() - 1).reg() : kNoRegister;
+ const Register field_reg = needs_field_temp_reg
+ ? locs()->temp(locs()->temp_count() - 1).reg()
+ : kNoRegister;
Label ok, fail_label;
- Label* deopt = compiler->is_optimizing() ?
- compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL;
+ Label* deopt =
+ compiler->is_optimizing()
+ ? compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField)
+ : NULL;
Label* fail = (deopt != NULL) ? deopt : &fail_label;
if (emit_full_guard) {
__ LoadObject(field_reg, Field::ZoneHandle(field().Original()));
- FieldAddress field_cid_operand(
- field_reg, Field::guarded_cid_offset(), kUnsignedWord);
+ FieldAddress field_cid_operand(field_reg, Field::guarded_cid_offset(),
+ kUnsignedWord);
FieldAddress field_nullability_operand(
field_reg, Field::is_nullable_offset(), kUnsignedWord);
@@ -1617,8 +1636,8 @@ void GuardFieldClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
ASSERT(!compiler->is_optimizing());
__ Bind(fail);
- __ LoadFieldFromOffset(
- TMP, field_reg, Field::guarded_cid_offset(), kUnsignedWord);
+ __ LoadFieldFromOffset(TMP, field_reg, Field::guarded_cid_offset(),
+ kUnsignedWord);
__ CompareImmediate(TMP, kDynamicCid);
__ b(&ok, EQ);
@@ -1663,8 +1682,8 @@ LocationSummary* GuardFieldLengthInstr::MakeLocationSummary(Zone* zone,
const intptr_t kNumInputs = 1;
if (!opt || (field().guarded_list_length() == Field::kUnknownFixedLength)) {
const intptr_t kNumTemps = 3;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresRegister());
// We need temporaries for field object, length offset and expected length.
summary->set_temp(0, Location::RequiresRegister());
@@ -1672,8 +1691,8 @@ LocationSummary* GuardFieldLengthInstr::MakeLocationSummary(Zone* zone,
summary->set_temp(2, Location::RequiresRegister());
return summary;
} else {
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, 0, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, 0, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresRegister());
return summary;
}
@@ -1685,15 +1704,18 @@ void GuardFieldLengthInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
if (field().guarded_list_length() == Field::kNoFixedLength) {
if (Compiler::IsBackgroundCompilation()) {
// Field state changed while compiling.
- Compiler::AbortBackgroundCompilation(deopt_id(),
+ Compiler::AbortBackgroundCompilation(
+ deopt_id(),
"GuardFieldLengthInstr: field state changed while compiling");
}
ASSERT(!compiler->is_optimizing());
return; // Nothing to emit.
}
- Label* deopt = compiler->is_optimizing() ?
- compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL;
+ Label* deopt =
+ compiler->is_optimizing()
+ ? compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField)
+ : NULL;
const Register value_reg = locs()->in(0).reg();
@@ -1711,8 +1733,8 @@ void GuardFieldLengthInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
FieldAddress(field_reg,
Field::guarded_list_length_in_object_offset_offset()),
kByte);
- __ ldr(length_reg, FieldAddress(field_reg,
- Field::guarded_list_length_offset()));
+ __ ldr(length_reg,
+ FieldAddress(field_reg, Field::guarded_list_length_offset()));
__ tst(offset_reg, Operand(offset_reg));
__ b(&ok, MI);
@@ -1740,10 +1762,10 @@ void GuardFieldLengthInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
ASSERT(compiler->is_optimizing());
ASSERT(field().guarded_list_length() >= 0);
ASSERT(field().guarded_list_length_in_object_offset() !=
- Field::kUnknownLengthOffset);
+ Field::kUnknownLengthOffset);
__ ldr(TMP, FieldAddress(value_reg,
- field().guarded_list_length_in_object_offset()));
+ field().guarded_list_length_in_object_offset()));
__ CompareImmediate(TMP, Smi::RawValue(field().guarded_list_length()));
__ b(deopt, NE);
}
@@ -1755,19 +1777,16 @@ class BoxAllocationSlowPath : public SlowPathCode {
BoxAllocationSlowPath(Instruction* instruction,
const Class& cls,
Register result)
- : instruction_(instruction),
- cls_(cls),
- result_(result) { }
+ : instruction_(instruction), cls_(cls), result_(result) {}
virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
if (Assembler::EmittingComments()) {
- __ Comment("%s slow path allocation of %s",
- instruction_->DebugName(),
+ __ Comment("%s slow path allocation of %s", instruction_->DebugName(),
String::Handle(cls_.ScrubbedName()).ToCString());
}
__ Bind(entry_label());
- const Code& stub = Code::ZoneHandle(compiler->zone(),
- StubCode::GetAllocationStubForClass(cls_));
+ const Code& stub = Code::ZoneHandle(
+ compiler->zone(), StubCode::GetAllocationStubForClass(cls_));
const StubEntry stub_entry(stub);
LocationSummary* locs = instruction_->locs();
@@ -1776,9 +1795,7 @@ class BoxAllocationSlowPath : public SlowPathCode {
compiler->SaveLiveRegisters(locs);
compiler->GenerateCall(TokenPosition::kNoSource, // No token position.
- stub_entry,
- RawPcDescriptors::kOther,
- locs);
+ stub_entry, RawPcDescriptors::kOther, locs);
compiler->AddStubCallTarget(stub);
__ mov(result_, R0);
compiler->RestoreLiveRegisters(locs);
@@ -1820,8 +1837,7 @@ static void EnsureMutableBox(FlowGraphCompiler* compiler,
__ LoadFieldFromOffset(box_reg, instance_reg, offset);
__ CompareObject(box_reg, Object::null_object());
__ b(&done, NE);
- BoxAllocationSlowPath::Allocate(
- compiler, instruction, cls, box_reg, temp);
+ BoxAllocationSlowPath::Allocate(compiler, instruction, cls, box_reg, temp);
__ mov(temp, box_reg);
__ StoreIntoObjectOffset(instance_reg, offset, temp);
__ Bind(&done);
@@ -1832,14 +1848,13 @@ LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps =
- (IsUnboxedStore() && opt) ? 2 :
- ((IsPotentialUnboxedStore()) ? 2 : 0);
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps,
- ((IsUnboxedStore() && opt && is_initialization()) ||
- IsPotentialUnboxedStore())
- ? LocationSummary::kCallOnSlowPath
- : LocationSummary::kNoCall);
+ (IsUnboxedStore() && opt) ? 2 : ((IsPotentialUnboxedStore()) ? 2 : 0);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps,
+ ((IsUnboxedStore() && opt && is_initialization()) ||
+ IsPotentialUnboxedStore())
+ ? LocationSummary::kCallOnSlowPath
+ : LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresRegister());
if (IsUnboxedStore() && opt) {
@@ -1847,15 +1862,14 @@ LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary(Zone* zone,
summary->set_temp(0, Location::RequiresRegister());
summary->set_temp(1, Location::RequiresRegister());
} else if (IsPotentialUnboxedStore()) {
- summary->set_in(1, ShouldEmitStoreBarrier()
- ? Location::WritableRegister()
- : Location::RequiresRegister());
- summary->set_temp(0, Location::RequiresRegister());
- summary->set_temp(1, Location::RequiresRegister());
+ summary->set_in(1, ShouldEmitStoreBarrier() ? Location::WritableRegister()
+ : Location::RequiresRegister());
+ summary->set_temp(0, Location::RequiresRegister());
+ summary->set_temp(1, Location::RequiresRegister());
} else {
summary->set_in(1, ShouldEmitStoreBarrier()
- ? Location::WritableRegister()
- : Location::RegisterOrConstant(value()));
+ ? Location::WritableRegister()
+ : Location::RegisterOrConstant(value()));
}
return summary;
}
@@ -1938,9 +1952,8 @@ void StoreInstanceFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ CompareImmediate(temp2, kNullCid);
__ b(&store_pointer, EQ);
- __ LoadFromOffset(
- temp2, temp, Field::kind_bits_offset() - kHeapObjectTag,
- kUnsignedByte);
+ __ LoadFromOffset(temp2, temp, Field::kind_bits_offset() - kHeapObjectTag,
+ kUnsignedByte);
__ tsti(temp2, Immediate(1 << Field::kUnboxingCandidateBit));
__ b(&store_pointer, EQ);
@@ -1963,19 +1976,14 @@ void StoreInstanceFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ b(&store_pointer);
if (!compiler->is_optimizing()) {
- locs()->live_registers()->Add(locs()->in(0));
- locs()->live_registers()->Add(locs()->in(1));
+ locs()->live_registers()->Add(locs()->in(0));
+ locs()->live_registers()->Add(locs()->in(1));
}
{
__ Bind(&store_double);
- EnsureMutableBox(compiler,
- this,
- temp,
- compiler->double_class(),
- instance_reg,
- offset_in_bytes_,
- temp2);
+ EnsureMutableBox(compiler, this, temp, compiler->double_class(),
+ instance_reg, offset_in_bytes_, temp2);
__ LoadDFieldFromOffset(VTMP, value_reg, Double::value_offset());
__ StoreDFieldToOffset(VTMP, temp, Double::value_offset());
__ b(&skip_store);
@@ -1983,13 +1991,8 @@ void StoreInstanceFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
{
__ Bind(&store_float32x4);
- EnsureMutableBox(compiler,
- this,
- temp,
- compiler->float32x4_class(),
- instance_reg,
- offset_in_bytes_,
- temp2);
+ EnsureMutableBox(compiler, this, temp, compiler->float32x4_class(),
+ instance_reg, offset_in_bytes_, temp2);
__ LoadQFieldFromOffset(VTMP, value_reg, Float32x4::value_offset());
__ StoreQFieldToOffset(VTMP, temp, Float32x4::value_offset());
__ b(&skip_store);
@@ -1997,13 +2000,8 @@ void StoreInstanceFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
{
__ Bind(&store_float64x2);
- EnsureMutableBox(compiler,
- this,
- temp,
- compiler->float64x2_class(),
- instance_reg,
- offset_in_bytes_,
- temp2);
+ EnsureMutableBox(compiler, this, temp, compiler->float64x2_class(),
+ instance_reg, offset_in_bytes_, temp2);
__ LoadQFieldFromOffset(VTMP, value_reg, Float64x2::value_offset());
__ StoreQFieldToOffset(VTMP, temp, Float64x2::value_offset());
__ b(&skip_store);
@@ -2014,16 +2012,16 @@ void StoreInstanceFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
if (ShouldEmitStoreBarrier()) {
const Register value_reg = locs()->in(1).reg();
- __ StoreIntoObjectOffset(
- instance_reg, offset_in_bytes_, value_reg, CanValueBeSmi());
+ __ StoreIntoObjectOffset(instance_reg, offset_in_bytes_, value_reg,
+ CanValueBeSmi());
} else {
if (locs()->in(1).IsConstant()) {
- __ StoreIntoObjectOffsetNoBarrier(
- instance_reg, offset_in_bytes_, locs()->in(1).constant());
+ __ StoreIntoObjectOffsetNoBarrier(instance_reg, offset_in_bytes_,
+ locs()->in(1).constant());
} else {
const Register value_reg = locs()->in(1).reg();
- __ StoreIntoObjectOffsetNoBarrier(
- instance_reg, offset_in_bytes_, value_reg);
+ __ StoreIntoObjectOffsetNoBarrier(instance_reg, offset_in_bytes_,
+ value_reg);
}
}
__ Bind(&skip_store);
@@ -2034,8 +2032,8 @@ LocationSummary* LoadStaticFieldInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresRegister());
summary->set_out(0, Location::RequiresRegister());
return summary;
@@ -2056,8 +2054,8 @@ void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
- LocationSummary* locs = new(zone) LocationSummary(
- zone, 1, 1, LocationSummary::kNoCall);
+ LocationSummary* locs =
+ new (zone) LocationSummary(zone, 1, 1, LocationSummary::kNoCall);
locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister()
: Location::RequiresRegister());
locs->set_temp(0, Location::RequiresRegister());
@@ -2071,11 +2069,10 @@ void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ LoadObject(temp, Field::ZoneHandle(Z, field().Original()));
if (this->value()->NeedsStoreBuffer()) {
- __ StoreIntoObjectOffset(
- temp, Field::static_value_offset(), value, CanValueBeSmi());
+ __ StoreIntoObjectOffset(temp, Field::static_value_offset(), value,
+ CanValueBeSmi());
} else {
- __ StoreIntoObjectOffsetNoBarrier(temp,
- Field::static_value_offset(),
+ __ StoreIntoObjectOffsetNoBarrier(temp, Field::static_value_offset(),
value);
}
}
@@ -2085,8 +2082,8 @@ LocationSummary* InstanceOfInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
summary->set_in(0, Location::RegisterLocation(R0));
summary->set_in(1, Location::RegisterLocation(R1));
summary->set_out(0, Location::RegisterLocation(R0));
@@ -2098,10 +2095,7 @@ void InstanceOfInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
ASSERT(locs()->in(0).reg() == R0); // Value.
ASSERT(locs()->in(1).reg() == R1); // Instantiator type arguments.
- compiler->GenerateInstanceOf(token_pos(),
- deopt_id(),
- type(),
- negate_result(),
+ compiler->GenerateInstanceOf(token_pos(), deopt_id(), type(), negate_result(),
locs());
ASSERT(locs()->out(0).reg() == R0);
}
@@ -2111,8 +2105,8 @@ LocationSummary* CreateArrayInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
- LocationSummary* locs = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+ LocationSummary* locs = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
locs->set_in(kElementTypePos, Location::RegisterLocation(R1));
locs->set_in(kLengthPos, Location::RegisterLocation(R2));
locs->set_out(0, Location::RegisterLocation(R0));
@@ -2122,9 +2116,9 @@ LocationSummary* CreateArrayInstr::MakeLocationSummary(Zone* zone,
// Inlines array allocation for known constant values.
static void InlineArrayAllocation(FlowGraphCompiler* compiler,
- intptr_t num_elements,
- Label* slow_path,
- Label* done) {
+ intptr_t num_elements,
+ Label* slow_path,
+ Label* done) {
const int kInlineArraySize = 12; // Same as kInlineInstanceSize.
const Register kLengthReg = R2;
const Register kElemTypeReg = R1;
@@ -2133,19 +2127,16 @@ static void InlineArrayAllocation(FlowGraphCompiler* compiler,
__ TryAllocateArray(kArrayCid, instance_size, slow_path,
R0, // instance
R3, // end address
- R6,
- R8);
+ R6, R8);
// R0: new object start as a tagged pointer.
// R3: new object end address.
// Store the type argument field.
- __ StoreIntoObjectNoBarrier(R0,
- FieldAddress(R0, Array::type_arguments_offset()),
- kElemTypeReg);
+ __ StoreIntoObjectNoBarrier(
+ R0, FieldAddress(R0, Array::type_arguments_offset()), kElemTypeReg);
// Set the length field.
- __ StoreIntoObjectNoBarrier(R0,
- FieldAddress(R0, Array::length_offset()),
+ __ StoreIntoObjectNoBarrier(R0, FieldAddress(R0, Array::length_offset()),
kLengthReg);
// TODO(zra): Use stp once added.
@@ -2188,8 +2179,7 @@ void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
ASSERT(locs()->in(kElementTypePos).reg() == kElemTypeReg);
ASSERT(locs()->in(kLengthPos).reg() == kLengthReg);
- if (compiler->is_optimizing() &&
- !FLAG_precompiled_mode &&
+ if (compiler->is_optimizing() && !FLAG_precompiled_mode &&
num_elements()->BindsToConstant() &&
num_elements()->BoundConstant().IsSmi()) {
const intptr_t length = Smi::Cast(num_elements()->BoundConstant()).Value();
@@ -2198,13 +2188,10 @@ void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
InlineArrayAllocation(compiler, length, &slow_path, &done);
__ Bind(&slow_path);
__ PushObject(Object::null_object()); // Make room for the result.
- __ Push(kLengthReg); // length.
+ __ Push(kLengthReg); // length.
__ Push(kElemTypeReg);
- compiler->GenerateRuntimeCall(token_pos(),
- deopt_id(),
- kAllocateArrayRuntimeEntry,
- 2,
- locs());
+ compiler->GenerateRuntimeCall(token_pos(), deopt_id(),
+ kAllocateArrayRuntimeEntry, 2, locs());
__ Drop(2);
__ Pop(kResultReg);
__ Bind(&done);
@@ -2214,10 +2201,8 @@ void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
const Code& stub = Code::ZoneHandle(compiler->zone(),
StubCode::AllocateArray_entry()->code());
compiler->AddStubCallTarget(stub);
- compiler->GenerateCall(token_pos(),
- *StubCode::AllocateArray_entry(),
- RawPcDescriptors::kOther,
- locs());
+ compiler->GenerateCall(token_pos(), *StubCode::AllocateArray_entry(),
+ RawPcDescriptors::kOther, locs());
ASSERT(locs()->out(0).reg() == kResultReg);
}
@@ -2226,13 +2211,11 @@ LocationSummary* LoadFieldInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps =
- (IsUnboxedLoad() && opt) ? 1 :
- ((IsPotentialUnboxedLoad()) ? 1 : 0);
- LocationSummary* locs = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps,
- (opt && !IsPotentialUnboxedLoad())
- ? LocationSummary::kNoCall
- : LocationSummary::kCallOnSlowPath);
+ (IsUnboxedLoad() && opt) ? 1 : ((IsPotentialUnboxedLoad()) ? 1 : 0);
+ LocationSummary* locs = new (zone) LocationSummary(
+ zone, kNumInputs, kNumTemps, (opt && !IsPotentialUnboxedLoad())
+ ? LocationSummary::kNoCall
+ : LocationSummary::kCallOnSlowPath);
locs->set_in(0, Location::RequiresRegister());
@@ -2283,8 +2266,8 @@ void LoadFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ LoadObject(result_reg, Field::ZoneHandle(field()->Original()));
- FieldAddress field_cid_operand(
- result_reg, Field::guarded_cid_offset(), kUnsignedWord);
+ FieldAddress field_cid_operand(result_reg, Field::guarded_cid_offset(),
+ kUnsignedWord);
FieldAddress field_nullability_operand(
result_reg, Field::is_nullable_offset(), kUnsignedWord);
@@ -2313,11 +2296,8 @@ void LoadFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
{
__ Bind(&load_double);
- BoxAllocationSlowPath::Allocate(compiler,
- this,
- compiler->double_class(),
- result_reg,
- temp);
+ BoxAllocationSlowPath::Allocate(compiler, this, compiler->double_class(),
+ result_reg, temp);
__ LoadFieldFromOffset(temp, instance_reg, offset_in_bytes());
__ LoadDFieldFromOffset(VTMP, temp, Double::value_offset());
__ StoreDFieldToOffset(VTMP, result_reg, Double::value_offset());
@@ -2326,11 +2306,8 @@ void LoadFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
{
__ Bind(&load_float32x4);
- BoxAllocationSlowPath::Allocate(compiler,
- this,
- compiler->float32x4_class(),
- result_reg,
- temp);
+ BoxAllocationSlowPath::Allocate(
+ compiler, this, compiler->float32x4_class(), result_reg, temp);
__ LoadFieldFromOffset(temp, instance_reg, offset_in_bytes());
__ LoadQFieldFromOffset(VTMP, temp, Float32x4::value_offset());
__ StoreQFieldToOffset(VTMP, result_reg, Float32x4::value_offset());
@@ -2339,11 +2316,8 @@ void LoadFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
{
__ Bind(&load_float64x2);
- BoxAllocationSlowPath::Allocate(compiler,
- this,
- compiler->float64x2_class(),
- result_reg,
- temp);
+ BoxAllocationSlowPath::Allocate(
+ compiler, this, compiler->float64x2_class(), result_reg, temp);
__ LoadFieldFromOffset(temp, instance_reg, offset_in_bytes());
__ LoadQFieldFromOffset(VTMP, temp, Float64x2::value_offset());
__ StoreQFieldToOffset(VTMP, result_reg, Float64x2::value_offset());
@@ -2361,8 +2335,8 @@ LocationSummary* InstantiateTypeInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* locs = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+ LocationSummary* locs = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
locs->set_in(0, Location::RegisterLocation(R0));
locs->set_out(0, Location::RegisterLocation(R0));
return locs;
@@ -2378,23 +2352,21 @@ void InstantiateTypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ PushObject(Object::null_object()); // Make room for the result.
__ PushObject(type());
__ Push(instantiator_reg); // Push instantiator type arguments.
- compiler->GenerateRuntimeCall(token_pos(),
- deopt_id(),
- kInstantiateTypeRuntimeEntry,
- 2,
- locs());
- __ Drop(2); // Drop instantiator and uninstantiated type.
+ compiler->GenerateRuntimeCall(token_pos(), deopt_id(),
+ kInstantiateTypeRuntimeEntry, 2, locs());
+ __ Drop(2); // Drop instantiator and uninstantiated type.
__ Pop(result_reg); // Pop instantiated type.
ASSERT(instantiator_reg == result_reg);
}
LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary(
- Zone* zone, bool opt) const {
+ Zone* zone,
+ bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* locs = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+ LocationSummary* locs = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
locs->set_in(0, Location::RegisterLocation(R0));
locs->set_out(0, Location::RegisterLocation(R0));
return locs;
@@ -2446,12 +2418,10 @@ void InstantiateTypeArgumentsInstr::EmitNativeCode(
__ PushObject(Object::null_object()); // Make room for the result.
__ PushObject(type_arguments());
__ Push(instantiator_reg); // Push instantiator type arguments.
- compiler->GenerateRuntimeCall(token_pos(),
- deopt_id(),
- kInstantiateTypeArgumentsRuntimeEntry,
- 2,
+ compiler->GenerateRuntimeCall(token_pos(), deopt_id(),
+ kInstantiateTypeArgumentsRuntimeEntry, 2,
locs());
- __ Drop(2); // Drop instantiator and uninstantiated type arguments.
+ __ Drop(2); // Drop instantiator and uninstantiated type arguments.
__ Pop(result_reg); // Pop instantiated type arguments.
__ Bind(&type_arguments_instantiated);
}
@@ -2463,7 +2433,7 @@ LocationSummary* AllocateUninitializedContextInstr::MakeLocationSummary(
ASSERT(opt);
const intptr_t kNumInputs = 0;
const intptr_t kNumTemps = 3;
- LocationSummary* locs = new(zone) LocationSummary(
+ LocationSummary* locs = new (zone) LocationSummary(
zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
locs->set_temp(0, Location::RegisterLocation(R1));
locs->set_temp(1, Location::RegisterLocation(R2));
@@ -2477,7 +2447,7 @@ class AllocateContextSlowPath : public SlowPathCode {
public:
explicit AllocateContextSlowPath(
AllocateUninitializedContextInstr* instruction)
- : instruction_(instruction) { }
+ : instruction_(instruction) {}
virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
__ Comment("AllocateContextSlowPath");
@@ -2494,8 +2464,7 @@ class AllocateContextSlowPath : public SlowPathCode {
compiler->AddStubCallTarget(stub);
compiler->GenerateCall(instruction_->token_pos(),
*StubCode::AllocateContext_entry(),
- RawPcDescriptors::kOther,
- locs);
+ RawPcDescriptors::kOther, locs);
ASSERT(instruction_->locs()->out(0).reg() == R0);
compiler->RestoreLiveRegisters(instruction_->locs());
__ b(exit_label());
@@ -2506,7 +2475,6 @@ class AllocateContextSlowPath : public SlowPathCode {
};
-
void AllocateUninitializedContextInstr::EmitNativeCode(
FlowGraphCompiler* compiler) {
Register temp0 = locs()->temp(0).reg();
@@ -2520,9 +2488,7 @@ void AllocateUninitializedContextInstr::EmitNativeCode(
__ TryAllocateArray(kContextCid, instance_size, slow_path->entry_label(),
result, // instance
- temp0,
- temp1,
- temp2);
+ temp0, temp1, temp2);
// Setup up number of context variables field.
__ LoadImmediate(temp0, num_context_variables());
@@ -2536,8 +2502,8 @@ LocationSummary* AllocateContextInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 0;
const intptr_t kNumTemps = 1;
- LocationSummary* locs = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+ LocationSummary* locs = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
locs->set_temp(0, Location::RegisterLocation(R1));
locs->set_out(0, Location::RegisterLocation(R0));
return locs;
@@ -2549,18 +2515,16 @@ void AllocateContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
ASSERT(locs()->out(0).reg() == R0);
__ LoadImmediate(R1, num_context_variables());
- compiler->GenerateCall(token_pos(),
- *StubCode::AllocateContext_entry(),
- RawPcDescriptors::kOther,
- locs());
+ compiler->GenerateCall(token_pos(), *StubCode::AllocateContext_entry(),
+ RawPcDescriptors::kOther, locs());
}
LocationSummary* InitStaticFieldInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 1;
- LocationSummary* locs = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+ LocationSummary* locs = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
locs->set_in(0, Location::RegisterLocation(R0));
locs->set_temp(0, Location::RegisterLocation(R1));
return locs;
@@ -2582,11 +2546,8 @@ void InitStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ Bind(&call_runtime);
__ PushObject(Object::null_object()); // Make room for (unused) result.
__ Push(field);
- compiler->GenerateRuntimeCall(token_pos(),
- deopt_id(),
- kInitStaticFieldRuntimeEntry,
- 1,
- locs());
+ compiler->GenerateRuntimeCall(token_pos(), deopt_id(),
+ kInitStaticFieldRuntimeEntry, 1, locs());
__ Drop(2); // Remove argument and result placeholder.
__ Bind(&no_call);
}
@@ -2596,8 +2557,8 @@ LocationSummary* CloneContextInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* locs = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+ LocationSummary* locs = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
locs->set_in(0, Location::RegisterLocation(R0));
locs->set_out(0, Location::RegisterLocation(R0));
return locs;
@@ -2610,12 +2571,9 @@ void CloneContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ PushObject(Object::null_object()); // Make room for the result.
__ Push(context_value);
- compiler->GenerateRuntimeCall(token_pos(),
- deopt_id(),
- kCloneContextRuntimeEntry,
- 1,
- locs());
- __ Drop(1); // Remove argument.
+ compiler->GenerateRuntimeCall(token_pos(), deopt_id(),
+ kCloneContextRuntimeEntry, 1, locs());
+ __ Drop(1); // Remove argument.
__ Pop(result); // Get result (cloned context).
}
@@ -2629,19 +2587,16 @@ LocationSummary* CatchBlockEntryInstr::MakeLocationSummary(Zone* zone,
void CatchBlockEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ Bind(compiler->GetJumpLabel(this));
- compiler->AddExceptionHandler(catch_try_index(),
- try_index(),
+ compiler->AddExceptionHandler(catch_try_index(), try_index(),
compiler->assembler()->CodeSize(),
- catch_handler_types_,
- needs_stacktrace());
+ catch_handler_types_, needs_stacktrace());
// On lazy deoptimization we patch the optimized code here to enter the
// deoptimization stub.
const intptr_t deopt_id = Thread::ToDeoptAfter(GetDeoptId());
if (compiler->is_optimizing()) {
compiler->AddDeoptIndexAtCall(deopt_id);
} else {
- compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
- deopt_id,
+ compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id,
TokenPosition::kNoSource);
}
if (HasParallelMove()) {
@@ -2657,10 +2612,10 @@ void CatchBlockEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
// Restore stack and initialize the two exception variables:
// exception and stack trace variables.
- __ StoreToOffset(kExceptionObjectReg,
- FP, exception_var().index() * kWordSize);
- __ StoreToOffset(kStackTraceObjectReg,
- FP, stacktrace_var().index() * kWordSize);
+ __ StoreToOffset(kExceptionObjectReg, FP,
+ exception_var().index() * kWordSize);
+ __ StoreToOffset(kStackTraceObjectReg, FP,
+ stacktrace_var().index() * kWordSize);
}
@@ -2668,7 +2623,7 @@ LocationSummary* CheckStackOverflowInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 0;
const intptr_t kNumTemps = 1;
- LocationSummary* summary = new(zone) LocationSummary(
+ LocationSummary* summary = new (zone) LocationSummary(
zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
summary->set_temp(0, Location::RequiresRegister());
return summary;
@@ -2678,7 +2633,7 @@ LocationSummary* CheckStackOverflowInstr::MakeLocationSummary(Zone* zone,
class CheckStackOverflowSlowPath : public SlowPathCode {
public:
explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction)
- : instruction_(instruction) { }
+ : instruction_(instruction) {}
virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
if (FLAG_use_osr && osr_entry_label()->IsLinked()) {
@@ -2696,11 +2651,9 @@ class CheckStackOverflowSlowPath : public SlowPathCode {
ASSERT(compiler->pending_deoptimization_env_ == NULL);
Environment* env = compiler->SlowPathEnvironmentFor(instruction_);
compiler->pending_deoptimization_env_ = env;
- compiler->GenerateRuntimeCall(instruction_->token_pos(),
- instruction_->deopt_id(),
- kStackOverflowRuntimeEntry,
- 0,
- instruction_->locs());
+ compiler->GenerateRuntimeCall(
+ instruction_->token_pos(), instruction_->deopt_id(),
+ kStackOverflowRuntimeEntry, 0, instruction_->locs());
if (FLAG_use_osr && !compiler->is_optimizing() && instruction_->in_loop()) {
// In unoptimized code, record loop stack checks as possible OSR entries.
@@ -2741,8 +2694,7 @@ void CheckStackOverflowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ LoadObject(temp, compiler->parsed_function().function());
intptr_t threshold =
FLAG_optimization_counter_threshold * (loop_depth() + 1);
- __ LoadFieldFromOffset(
- temp, temp, Function::usage_counter_offset(), kWord);
+ __ LoadFieldFromOffset(temp, temp, Function::usage_counter_offset(), kWord);
__ CompareImmediate(temp, threshold);
__ b(slow_path->osr_entry_label(), GE);
}
@@ -2758,9 +2710,10 @@ static void EmitSmiShiftLeft(FlowGraphCompiler* compiler,
const LocationSummary& locs = *shift_left->locs();
const Register left = locs.in(0).reg();
const Register result = locs.out(0).reg();
- Label* deopt = shift_left->CanDeoptimize() ?
- compiler->AddDeoptStub(shift_left->deopt_id(), ICData::kDeoptBinarySmiOp)
- : NULL;
+ Label* deopt = shift_left->CanDeoptimize()
+ ? compiler->AddDeoptStub(shift_left->deopt_id(),
+ ICData::kDeoptBinarySmiOp)
+ : NULL;
if (locs.in(1).IsConstant()) {
const Object& constant = locs.in(1).constant();
ASSERT(constant.IsSmi());
@@ -2799,7 +2752,7 @@ static void EmitSmiShiftLeft(FlowGraphCompiler* compiler,
!RangeUtils::IsWithin(right_range, 0, max_right - 1);
if (right_needs_check) {
__ CompareImmediate(right,
- reinterpret_cast<int64_t>(Smi::New(max_right)));
+ reinterpret_cast<int64_t>(Smi::New(max_right)));
__ b(deopt, CS);
}
__ SmiUntag(TMP, right);
@@ -2820,8 +2773,8 @@ static void EmitSmiShiftLeft(FlowGraphCompiler* compiler,
__ b(deopt, MI);
}
- __ CompareImmediate(
- right, reinterpret_cast<int64_t>(Smi::New(Smi::kBits)));
+ __ CompareImmediate(right,
+ reinterpret_cast<int64_t>(Smi::New(Smi::kBits)));
__ csel(result, ZR, result, CS);
__ SmiUntag(TMP, right);
__ lslv(TMP, left, TMP);
@@ -2833,8 +2786,8 @@ static void EmitSmiShiftLeft(FlowGraphCompiler* compiler,
} else {
if (right_needs_check) {
ASSERT(shift_left->CanDeoptimize());
- __ CompareImmediate(
- right, reinterpret_cast<int64_t>(Smi::New(Smi::kBits)));
+ __ CompareImmediate(right,
+ reinterpret_cast<int64_t>(Smi::New(Smi::kBits)));
__ b(deopt, CS);
}
// Left is not a constant.
@@ -2855,7 +2808,7 @@ static void EmitSmiShiftLeft(FlowGraphCompiler* compiler,
class CheckedSmiSlowPath : public SlowPathCode {
public:
CheckedSmiSlowPath(CheckedSmiOpInstr* instruction, intptr_t try_index)
- : instruction_(instruction), try_index_(try_index) { }
+ : instruction_(instruction), try_index_(try_index) {}
virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
if (Assembler::EmittingComments()) {
@@ -2870,12 +2823,9 @@ class CheckedSmiSlowPath : public SlowPathCode {
__ Push(locs->in(0).reg());
__ Push(locs->in(1).reg());
compiler->EmitMegamorphicInstanceCall(
- *instruction_->call()->ic_data(),
- instruction_->call()->ArgumentCount(),
- instruction_->call()->deopt_id(),
- instruction_->call()->token_pos(),
- locs,
- try_index_,
+ *instruction_->call()->ic_data(), instruction_->call()->ArgumentCount(),
+ instruction_->call()->deopt_id(), instruction_->call()->token_pos(),
+ locs, try_index_,
/* slow_path_argument_count = */ 2);
__ mov(result, R0);
compiler->RestoreLiveRegisters(locs);
@@ -2892,7 +2842,7 @@ LocationSummary* CheckedSmiOpInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
+ LocationSummary* summary = new (zone) LocationSummary(
zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
summary->set_in(0, Location::RequiresRegister());
summary->set_in(1, Location::RequiresRegister());
@@ -2970,7 +2920,7 @@ class CheckedSmiComparisonSlowPath : public SlowPathCode {
: instruction_(instruction),
try_index_(try_index),
labels_(labels),
- merged_(merged) { }
+ merged_(merged) {}
virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
if (Assembler::EmittingComments()) {
@@ -2985,21 +2935,19 @@ class CheckedSmiComparisonSlowPath : public SlowPathCode {
__ Push(locs->in(0).reg());
__ Push(locs->in(1).reg());
compiler->EmitMegamorphicInstanceCall(
- *instruction_->call()->ic_data(),
- instruction_->call()->ArgumentCount(),
- instruction_->call()->deopt_id(),
- instruction_->call()->token_pos(),
- locs,
- try_index_,
+ *instruction_->call()->ic_data(), instruction_->call()->ArgumentCount(),
+ instruction_->call()->deopt_id(), instruction_->call()->token_pos(),
+ locs, try_index_,
/* slow_path_argument_count = */ 2);
__ mov(result, R0);
compiler->RestoreLiveRegisters(locs);
if (merged_) {
__ CompareObject(result, Bool::True());
- __ b(instruction_->is_negated()
- ? labels_.false_label : labels_.true_label, EQ);
- __ b(instruction_->is_negated()
- ? labels_.true_label : labels_.false_label);
+ __ b(
+ instruction_->is_negated() ? labels_.false_label : labels_.true_label,
+ EQ);
+ __ b(instruction_->is_negated() ? labels_.true_label
+ : labels_.false_label);
} else {
__ b(exit_label());
}
@@ -3014,10 +2962,11 @@ class CheckedSmiComparisonSlowPath : public SlowPathCode {
LocationSummary* CheckedSmiComparisonInstr::MakeLocationSummary(
- Zone* zone, bool opt) const {
+ Zone* zone,
+ bool opt) const {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 1;
- LocationSummary* summary = new(zone) LocationSummary(
+ LocationSummary* summary = new (zone) LocationSummary(
zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
summary->set_in(0, Location::RequiresRegister());
summary->set_in(1, Location::RequiresRegister());
@@ -3028,7 +2977,8 @@ LocationSummary* CheckedSmiComparisonInstr::MakeLocationSummary(
Condition CheckedSmiComparisonInstr::EmitComparisonCode(
- FlowGraphCompiler* compiler, BranchLabels labels) {
+ FlowGraphCompiler* compiler,
+ BranchLabels labels) {
return EmitSmiComparisonOp(compiler, locs(), kind());
}
@@ -3055,11 +3005,9 @@ Condition CheckedSmiComparisonInstr::EmitComparisonCode(
void CheckedSmiComparisonInstr::EmitBranchCode(FlowGraphCompiler* compiler,
BranchInstr* branch) {
BranchLabels labels = compiler->CreateBranchLabels(branch);
- CheckedSmiComparisonSlowPath* slow_path =
- new CheckedSmiComparisonSlowPath(this,
- compiler->CurrentTryIndex(),
- labels,
- /* merged = */ true);
+ CheckedSmiComparisonSlowPath* slow_path = new CheckedSmiComparisonSlowPath(
+ this, compiler->CurrentTryIndex(), labels,
+ /* merged = */ true);
compiler->AddSlowPathCode(slow_path);
EMIT_SMI_CHECK;
Condition true_condition = EmitComparisonCode(compiler, labels);
@@ -3070,16 +3018,13 @@ void CheckedSmiComparisonInstr::EmitBranchCode(FlowGraphCompiler* compiler,
void CheckedSmiComparisonInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
Label true_label, false_label, done;
- BranchLabels labels = { &true_label, &false_label, &false_label };
- CheckedSmiComparisonSlowPath* slow_path =
- new CheckedSmiComparisonSlowPath(this,
- compiler->CurrentTryIndex(),
- labels,
- /* merged = */ false);
+ BranchLabels labels = {&true_label, &false_label, &false_label};
+ CheckedSmiComparisonSlowPath* slow_path = new CheckedSmiComparisonSlowPath(
+ this, compiler->CurrentTryIndex(), labels,
+ /* merged = */ false);
compiler->AddSlowPathCode(slow_path);
EMIT_SMI_CHECK;
- Condition true_condition =
- EmitComparisonCode(compiler, labels);
+ Condition true_condition = EmitComparisonCode(compiler, labels);
EmitBranchOnCondition(compiler, true_condition, labels);
Register result = locs()->out(0).reg();
__ Bind(&false_label);
@@ -3095,11 +3040,12 @@ void CheckedSmiComparisonInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
LocationSummary* BinarySmiOpInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 2;
- const intptr_t kNumTemps =
- (((op_kind() == Token::kSHL) && can_overflow()) ||
- (op_kind() == Token::kSHR)) ? 1 : 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ const intptr_t kNumTemps = (((op_kind() == Token::kSHL) && can_overflow()) ||
+ (op_kind() == Token::kSHR))
+ ? 1
+ : 0;
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
if (op_kind() == Token::kTRUNCDIV) {
summary->set_in(0, Location::RequiresRegister());
if (RightIsPowerOfTwoConstant()) {
@@ -3215,8 +3161,8 @@ void BinarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
// Asr operation masks the count to 6 bits.
const intptr_t kCountLimit = 0x3F;
intptr_t value = Smi::Cast(constant).Value();
- __ AsrImmediate(
- result, left, Utils::Minimum(value + kSmiTagSize, kCountLimit));
+ __ AsrImmediate(result, left,
+ Utils::Minimum(value + kSmiTagSize, kCountLimit));
__ SmiTag(result);
break;
}
@@ -3253,11 +3199,11 @@ void BinarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
if (deopt == NULL) {
__ mul(result, TMP, right);
} else {
- __ mul(result, TMP, right);
- __ smulh(TMP, TMP, right);
- // TMP: result bits 64..127.
- __ cmp(TMP, Operand(result, ASR, 63));
- __ b(deopt, NE);
+ __ mul(result, TMP, right);
+ __ smulh(TMP, TMP, right);
+ // TMP: result bits 64..127.
+ __ cmp(TMP, Operand(result, ASR, 63));
+ __ b(deopt, NE);
}
break;
}
@@ -3376,8 +3322,8 @@ LocationSummary* CheckEitherNonSmiInstr::MakeLocationSummary(Zone* zone,
ASSERT((left_cid != kDoubleCid) && (right_cid != kDoubleCid));
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresRegister());
summary->set_in(1, Location::RequiresRegister());
return summary;
@@ -3385,9 +3331,9 @@ LocationSummary* CheckEitherNonSmiInstr::MakeLocationSummary(Zone* zone,
void CheckEitherNonSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
- Label* deopt = compiler->AddDeoptStub(deopt_id(),
- ICData::kDeoptBinaryDoubleOp,
- licm_hoisted_ ? ICData::kHoisted : 0);
+ Label* deopt =
+ compiler->AddDeoptStub(deopt_id(), ICData::kDeoptBinaryDoubleOp,
+ licm_hoisted_ ? ICData::kHoisted : 0);
intptr_t left_cid = left()->Type()->ToCid();
intptr_t right_cid = right()->Type()->ToCid();
const Register left = locs()->in(0).reg();
@@ -3406,11 +3352,10 @@ void CheckEitherNonSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* BoxInstr::MakeLocationSummary(Zone* zone,
- bool opt) const {
+LocationSummary* BoxInstr::MakeLocationSummary(Zone* zone, bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 1;
- LocationSummary* summary = new(zone) LocationSummary(
+ LocationSummary* summary = new (zone) LocationSummary(
zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_temp(0, Location::RequiresRegister());
@@ -3424,12 +3369,9 @@ void BoxInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
const Register temp_reg = locs()->temp(0).reg();
const VRegister value = locs()->in(0).fpu_reg();
- BoxAllocationSlowPath::Allocate(
- compiler,
- this,
- compiler->BoxClassFor(from_representation()),
- out_reg,
- temp_reg);
+ BoxAllocationSlowPath::Allocate(compiler, this,
+ compiler->BoxClassFor(from_representation()),
+ out_reg, temp_reg);
switch (from_representation()) {
case kUnboxedDouble:
@@ -3447,12 +3389,11 @@ void BoxInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* UnboxInstr::MakeLocationSummary(Zone* zone,
- bool opt) const {
+LocationSummary* UnboxInstr::MakeLocationSummary(Zone* zone, bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresRegister());
summary->set_out(0, Location::RequiresFpuRegister());
return summary;
@@ -3522,8 +3463,8 @@ void UnboxInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
EmitSmiConversion(compiler);
} else {
const Register box = locs()->in(0).reg();
- Label* deopt = compiler->AddDeoptStub(GetDeoptId(),
- ICData::kDeoptCheckClass);
+ Label* deopt =
+ compiler->AddDeoptStub(GetDeoptId(), ICData::kDeoptCheckClass);
Label is_smi;
if ((value()->Type()->ToNullableCid() == box_cid) &&
@@ -3556,11 +3497,8 @@ LocationSummary* BoxInteger32Instr::MakeLocationSummary(Zone* zone,
(from_representation() == kUnboxedUint32));
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone,
- kNumInputs,
- kNumTemps,
- LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresRegister());
summary->set_out(0, Location::RequiresRegister());
return summary;
@@ -3591,8 +3529,8 @@ LocationSummary* UnboxInteger32Instr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresRegister());
summary->set_out(0, Location::RequiresRegister());
return summary;
@@ -3603,8 +3541,10 @@ void UnboxInteger32Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
const intptr_t value_cid = value()->Type()->ToCid();
const Register out = locs()->out(0).reg();
const Register value = locs()->in(0).reg();
- Label* deopt = CanDeoptimize() ?
- compiler->AddDeoptStub(GetDeoptId(), ICData::kDeoptUnboxInteger) : NULL;
+ Label* deopt =
+ CanDeoptimize()
+ ? compiler->AddDeoptStub(GetDeoptId(), ICData::kDeoptUnboxInteger)
+ : NULL;
if (value_cid == kSmiCid) {
__ SmiUntag(out, value);
@@ -3646,8 +3586,8 @@ LocationSummary* BinaryDoubleOpInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_in(1, Location::RequiresFpuRegister());
summary->set_out(0, Location::RequiresFpuRegister());
@@ -3660,11 +3600,20 @@ void BinaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
const VRegister right = locs()->in(1).fpu_reg();
const VRegister result = locs()->out(0).fpu_reg();
switch (op_kind()) {
- case Token::kADD: __ faddd(result, left, right); break;
- case Token::kSUB: __ fsubd(result, left, right); break;
- case Token::kMUL: __ fmuld(result, left, right); break;
- case Token::kDIV: __ fdivd(result, left, right); break;
- default: UNREACHABLE();
+ case Token::kADD:
+ __ faddd(result, left, right);
+ break;
+ case Token::kSUB:
+ __ fsubd(result, left, right);
+ break;
+ case Token::kMUL:
+ __ fmuld(result, left, right);
+ break;
+ case Token::kDIV:
+ __ fdivd(result, left, right);
+ break;
+ default:
+ UNREACHABLE();
}
}
@@ -3674,8 +3623,8 @@ LocationSummary* DoubleTestOpInstr::MakeLocationSummary(Zone* zone,
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps =
op_kind() == MethodRecognizer::kDouble_getIsInfinite ? 1 : 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
if (op_kind() == MethodRecognizer::kDouble_getIsInfinite) {
summary->set_temp(0, Location::RequiresRegister());
@@ -3718,7 +3667,7 @@ void DoubleTestOpInstr::EmitBranchCode(FlowGraphCompiler* compiler,
void DoubleTestOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
ASSERT(compiler->is_optimizing());
Label is_true, is_false;
- BranchLabels labels = { &is_true, &is_false, &is_false };
+ BranchLabels labels = {&is_true, &is_false, &is_false};
Condition true_condition = EmitComparisonCode(compiler, labels);
const Register result = locs()->out(0).reg();
if (op_kind() == MethodRecognizer::kDouble_getIsNaN) {
@@ -3737,8 +3686,8 @@ LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_in(1, Location::RequiresFpuRegister());
summary->set_out(0, Location::RequiresFpuRegister());
@@ -3752,11 +3701,20 @@ void BinaryFloat32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
const VRegister result = locs()->out(0).fpu_reg();
switch (op_kind()) {
- case Token::kADD: __ vadds(result, left, right); break;
- case Token::kSUB: __ vsubs(result, left, right); break;
- case Token::kMUL: __ vmuls(result, left, right); break;
- case Token::kDIV: __ vdivs(result, left, right); break;
- default: UNREACHABLE();
+ case Token::kADD:
+ __ vadds(result, left, right);
+ break;
+ case Token::kSUB:
+ __ vsubs(result, left, right);
+ break;
+ case Token::kMUL:
+ __ vmuls(result, left, right);
+ break;
+ case Token::kDIV:
+ __ vdivs(result, left, right);
+ break;
+ default:
+ UNREACHABLE();
}
}
@@ -3765,8 +3723,8 @@ LocationSummary* BinaryFloat64x2OpInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_in(1, Location::RequiresFpuRegister());
summary->set_out(0, Location::RequiresFpuRegister());
@@ -3780,11 +3738,20 @@ void BinaryFloat64x2OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
const VRegister result = locs()->out(0).fpu_reg();
switch (op_kind()) {
- case Token::kADD: __ vaddd(result, left, right); break;
- case Token::kSUB: __ vsubd(result, left, right); break;
- case Token::kMUL: __ vmuld(result, left, right); break;
- case Token::kDIV: __ vdivd(result, left, right); break;
- default: UNREACHABLE();
+ case Token::kADD:
+ __ vaddd(result, left, right);
+ break;
+ case Token::kSUB:
+ __ vsubd(result, left, right);
+ break;
+ case Token::kMUL:
+ __ vmuld(result, left, right);
+ break;
+ case Token::kDIV:
+ __ vdivd(result, left, right);
+ break;
+ default:
+ UNREACHABLE();
}
}
@@ -3793,8 +3760,8 @@ LocationSummary* Simd32x4ShuffleInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new LocationSummary(zone, kNumInputs, kNumTemps,
+ LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_out(0, Location::RequiresFpuRegister());
return summary;
@@ -3830,7 +3797,7 @@ void Simd32x4ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ vdups(result, value, 1);
} else if (mask_ == 0xAA) {
__ vdups(result, value, 2);
- } else if (mask_ == 0xFF) {
+ } else if (mask_ == 0xFF) {
__ vdups(result, value, 3);
} else {
__ vinss(result, 0, value, mask_ & 0x3);
@@ -3839,7 +3806,8 @@ void Simd32x4ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ vinss(result, 3, value, (mask_ >> 6) & 0x3);
}
break;
- default: UNREACHABLE();
+ default:
+ UNREACHABLE();
}
}
@@ -3848,8 +3816,8 @@ LocationSummary* Simd32x4ShuffleMixInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new LocationSummary(zone, kNumInputs, kNumTemps,
+ LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_in(1, Location::RequiresFpuRegister());
summary->set_out(0, Location::RequiresFpuRegister());
@@ -3870,7 +3838,8 @@ void Simd32x4ShuffleMixInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ vinss(result, 2, right, (mask_ >> 4) & 0x3);
__ vinss(result, 3, right, (mask_ >> 6) & 0x3);
break;
- default: UNREACHABLE();
+ default:
+ UNREACHABLE();
}
}
@@ -3879,8 +3848,8 @@ LocationSummary* Simd32x4GetSignMaskInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 1;
- LocationSummary* summary = new LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new LocationSummary(zone, kNumInputs, kNumTemps,
+ LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_temp(0, Location::RequiresRegister());
summary->set_out(0, Location::RequiresRegister());
@@ -3914,11 +3883,12 @@ void Simd32x4GetSignMaskInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
LocationSummary* Float32x4ConstructorInstr::MakeLocationSummary(
- Zone* zone, bool opt) const {
+ Zone* zone,
+ bool opt) const {
const intptr_t kNumInputs = 4;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_in(1, Location::RequiresFpuRegister());
summary->set_in(2, Location::RequiresFpuRegister());
@@ -3950,8 +3920,8 @@ LocationSummary* Float32x4ZeroInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 0;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_out(0, Location::RequiresFpuRegister());
return summary;
}
@@ -3967,8 +3937,8 @@ LocationSummary* Float32x4SplatInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_out(0, Location::RequiresFpuRegister());
return summary;
@@ -3991,8 +3961,8 @@ LocationSummary* Float32x4ComparisonInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_in(1, Location::RequiresFpuRegister());
summary->set_out(0, Location::RequiresFpuRegister());
@@ -4027,7 +3997,8 @@ void Float32x4ComparisonInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ vcges(result, right, left);
break;
- default: UNREACHABLE();
+ default:
+ UNREACHABLE();
}
}
@@ -4036,8 +4007,8 @@ LocationSummary* Float32x4MinMaxInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_in(1, Location::RequiresFpuRegister());
summary->set_out(0, Location::RequiresFpuRegister());
@@ -4057,7 +4028,8 @@ void Float32x4MinMaxInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
case MethodRecognizer::kFloat32x4Max:
__ vmaxs(result, left, right);
break;
- default: UNREACHABLE();
+ default:
+ UNREACHABLE();
}
}
@@ -4066,8 +4038,8 @@ LocationSummary* Float32x4SqrtInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_out(0, Location::RequiresFpuRegister());
return summary;
@@ -4088,7 +4060,8 @@ void Float32x4SqrtInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
case MethodRecognizer::kFloat32x4ReciprocalSqrt:
__ VRSqrts(result, left);
break;
- default: UNREACHABLE();
+ default:
+ UNREACHABLE();
}
}
@@ -4097,8 +4070,8 @@ LocationSummary* Float32x4ScaleInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_in(1, Location::RequiresFpuRegister());
summary->set_out(0, Location::RequiresFpuRegister());
@@ -4117,7 +4090,8 @@ void Float32x4ScaleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ vdups(result, VTMP, 0);
__ vmuls(result, result, right);
break;
- default: UNREACHABLE();
+ default:
+ UNREACHABLE();
}
}
@@ -4126,8 +4100,8 @@ LocationSummary* Float32x4ZeroArgInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new LocationSummary(zone, kNumInputs, kNumTemps,
+ LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_out(0, Location::RequiresFpuRegister());
return summary;
@@ -4145,7 +4119,8 @@ void Float32x4ZeroArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
case MethodRecognizer::kFloat32x4Absolute:
__ vabss(result, left);
break;
- default: UNREACHABLE();
+ default:
+ UNREACHABLE();
}
}
@@ -4154,8 +4129,8 @@ LocationSummary* Float32x4ClampInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 3;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_in(1, Location::RequiresFpuRegister());
summary->set_in(2, Location::RequiresFpuRegister());
@@ -4178,8 +4153,8 @@ LocationSummary* Float32x4WithInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new LocationSummary(zone, kNumInputs, kNumTemps,
+ LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_in(1, Location::RequiresFpuRegister());
summary->set_out(0, Location::RequiresFpuRegister());
@@ -4210,7 +4185,8 @@ void Float32x4WithInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
case MethodRecognizer::kFloat32x4WithW:
__ vinss(result, 3, VTMP, 0);
break;
- default: UNREACHABLE();
+ default:
+ UNREACHABLE();
}
}
@@ -4219,8 +4195,8 @@ LocationSummary* Float32x4ToInt32x4Instr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new LocationSummary(zone, kNumInputs, kNumTemps,
+ LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_out(0, Location::RequiresFpuRegister());
return summary;
@@ -4241,8 +4217,8 @@ LocationSummary* Simd64x2ShuffleInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_out(0, Location::RequiresFpuRegister());
return summary;
@@ -4260,7 +4236,8 @@ void Simd64x2ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
case MethodRecognizer::kFloat64x2GetY:
__ vinsd(result, 0, value, 1);
break;
- default: UNREACHABLE();
+ default:
+ UNREACHABLE();
}
}
@@ -4269,8 +4246,8 @@ LocationSummary* Float64x2ZeroInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 0;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_out(0, Location::RequiresFpuRegister());
return summary;
}
@@ -4286,8 +4263,8 @@ LocationSummary* Float64x2SplatInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_out(0, Location::RequiresFpuRegister());
return summary;
@@ -4302,11 +4279,12 @@ void Float64x2SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
LocationSummary* Float64x2ConstructorInstr::MakeLocationSummary(
- Zone* zone, bool opt) const {
+ Zone* zone,
+ bool opt) const {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_in(1, Location::RequiresFpuRegister());
summary->set_out(0, Location::RequiresFpuRegister());
@@ -4324,11 +4302,12 @@ void Float64x2ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
LocationSummary* Float64x2ToFloat32x4Instr::MakeLocationSummary(
- Zone* zone, bool opt) const {
+ Zone* zone,
+ bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new LocationSummary(zone, kNumInputs, kNumTemps,
+ LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_out(0, Location::RequiresFpuRegister());
return summary;
@@ -4353,11 +4332,12 @@ void Float64x2ToFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
LocationSummary* Float32x4ToFloat64x2Instr::MakeLocationSummary(
- Zone* zone, bool opt) const {
+ Zone* zone,
+ bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new LocationSummary(zone, kNumInputs, kNumTemps,
+ LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_out(0, Location::RequiresFpuRegister());
return summary;
@@ -4383,8 +4363,8 @@ LocationSummary* Float64x2ZeroArgInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
if (representation() == kTagged) {
ASSERT(op_kind() == MethodRecognizer::kFloat64x2GetSignMask);
@@ -4428,7 +4408,8 @@ void Float64x2ZeroArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
case MethodRecognizer::kFloat64x2Sqrt:
__ vsqrtd(result, value);
break;
- default: UNREACHABLE();
+ default:
+ UNREACHABLE();
}
}
@@ -4437,8 +4418,8 @@ LocationSummary* Float64x2OneArgInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new LocationSummary(zone, kNumInputs, kNumTemps,
+ LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_in(1, Location::RequiresFpuRegister());
summary->set_out(0, Location::SameAsFirstInput());
@@ -4469,17 +4450,18 @@ void Float64x2OneArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
case MethodRecognizer::kFloat64x2Max:
__ vmaxd(out, left, right);
break;
- default: UNREACHABLE();
+ default:
+ UNREACHABLE();
}
}
-LocationSummary* Int32x4ConstructorInstr::MakeLocationSummary(
- Zone* zone, bool opt) const {
+LocationSummary* Int32x4ConstructorInstr::MakeLocationSummary(Zone* zone,
+ bool opt) const {
const intptr_t kNumInputs = 4;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresRegister());
summary->set_in(1, Location::RequiresRegister());
summary->set_in(2, Location::RequiresRegister());
@@ -4504,11 +4486,12 @@ void Int32x4ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
LocationSummary* Int32x4BoolConstructorInstr::MakeLocationSummary(
- Zone* zone, bool opt) const {
+ Zone* zone,
+ bool opt) const {
const intptr_t kNumInputs = 4;
const intptr_t kNumTemps = 1;
- LocationSummary* summary = new LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new LocationSummary(zone, kNumInputs, kNumTemps,
+ LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresRegister());
summary->set_in(1, Location::RequiresRegister());
summary->set_in(2, Location::RequiresRegister());
@@ -4557,8 +4540,8 @@ LocationSummary* Int32x4GetFlagInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new LocationSummary(zone, kNumInputs, kNumTemps,
+ LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_out(0, Location::RequiresRegister());
return summary;
@@ -4582,7 +4565,8 @@ void Int32x4GetFlagInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
case MethodRecognizer::kInt32x4GetFlagW:
__ vmovrs(result, value, 3);
break;
- default: UNREACHABLE();
+ default:
+ UNREACHABLE();
}
__ tst(result, Operand(result));
@@ -4596,8 +4580,8 @@ LocationSummary* Int32x4SelectInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 3;
const intptr_t kNumTemps = 1;
- LocationSummary* summary = new LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new LocationSummary(zone, kNumInputs, kNumTemps,
+ LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_in(1, Location::RequiresFpuRegister());
summary->set_in(2, Location::RequiresFpuRegister());
@@ -4631,8 +4615,8 @@ LocationSummary* Int32x4SetFlagInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new LocationSummary(zone, kNumInputs, kNumTemps,
+ LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_in(1, Location::RequiresRegister());
summary->set_out(0, Location::RequiresFpuRegister());
@@ -4665,7 +4649,8 @@ void Int32x4SetFlagInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
case MethodRecognizer::kInt32x4WithFlagW:
__ vinsw(result, 3, TMP);
break;
- default: UNREACHABLE();
+ default:
+ UNREACHABLE();
}
}
@@ -4674,8 +4659,8 @@ LocationSummary* Int32x4ToFloat32x4Instr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new LocationSummary(zone, kNumInputs, kNumTemps,
+ LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_out(0, Location::RequiresFpuRegister());
return summary;
@@ -4696,8 +4681,8 @@ LocationSummary* BinaryInt32x4OpInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new LocationSummary(zone, kNumInputs, kNumTemps,
+ LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_in(1, Location::RequiresFpuRegister());
summary->set_out(0, Location::RequiresFpuRegister());
@@ -4710,12 +4695,23 @@ void BinaryInt32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
const VRegister right = locs()->in(1).fpu_reg();
const VRegister result = locs()->out(0).fpu_reg();
switch (op_kind()) {
- case Token::kBIT_AND: __ vand(result, left, right); break;
- case Token::kBIT_OR: __ vorr(result, left, right); break;
- case Token::kBIT_XOR: __ veor(result, left, right); break;
- case Token::kADD: __ vaddw(result, left, right); break;
- case Token::kSUB: __ vsubw(result, left, right); break;
- default: UNREACHABLE();
+ case Token::kBIT_AND:
+ __ vand(result, left, right);
+ break;
+ case Token::kBIT_OR:
+ __ vorr(result, left, right);
+ break;
+ case Token::kBIT_XOR:
+ __ veor(result, left, right);
+ break;
+ case Token::kADD:
+ __ vaddw(result, left, right);
+ break;
+ case Token::kSUB:
+ __ vsubw(result, left, right);
+ break;
+ default:
+ UNREACHABLE();
}
}
@@ -4726,8 +4722,8 @@ LocationSummary* MathUnaryInstr::MakeLocationSummary(Zone* zone,
(kind() == MathUnaryInstr::kDoubleSquare));
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_out(0, Location::RequiresFpuRegister());
return summary;
@@ -4750,10 +4746,11 @@ void MathUnaryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
LocationSummary* CaseInsensitiveCompareUC16Instr::MakeLocationSummary(
- Zone* zone, bool opt) const {
+ Zone* zone,
+ bool opt) const {
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, InputCount(), kNumTemps, LocationSummary::kCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, InputCount(), kNumTemps, LocationSummary::kCall);
summary->set_in(0, Location::RegisterLocation(R0));
summary->set_in(1, Location::RegisterLocation(R1));
summary->set_in(2, Location::RegisterLocation(R2));
@@ -4765,7 +4762,6 @@ LocationSummary* CaseInsensitiveCompareUC16Instr::MakeLocationSummary(
void CaseInsensitiveCompareUC16Instr::EmitNativeCode(
FlowGraphCompiler* compiler) {
-
// Call the function.
__ CallRuntime(TargetFunction(), TargetFunction().argument_count());
}
@@ -4776,8 +4772,8 @@ LocationSummary* MathMinMaxInstr::MakeLocationSummary(Zone* zone,
if (result_cid() == kDoubleCid) {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_in(1, Location::RequiresFpuRegister());
// Reuse the left register so that code can be made shorter.
@@ -4787,8 +4783,8 @@ LocationSummary* MathMinMaxInstr::MakeLocationSummary(Zone* zone,
ASSERT(result_cid() == kSmiCid);
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresRegister());
summary->set_in(1, Location::RequiresRegister());
// Reuse the left register so that code can be made shorter.
@@ -4861,8 +4857,8 @@ LocationSummary* UnarySmiOpInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresRegister());
// We make use of 3-operand instructions by not requiring result register
// to be identical to first input register as on Intel.
@@ -4896,8 +4892,8 @@ LocationSummary* UnaryDoubleOpInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresFpuRegister());
summary->set_out(0, Location::RequiresFpuRegister());
return summary;
@@ -4912,11 +4908,11 @@ void UnaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
LocationSummary* Int32ToDoubleInstr::MakeLocationSummary(Zone* zone,
- bool opt) const {
+ bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* result = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* result = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
result->set_in(0, Location::RequiresRegister());
result->set_out(0, Location::RequiresFpuRegister());
return result;
@@ -4934,8 +4930,8 @@ LocationSummary* SmiToDoubleInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* result = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* result = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
result->set_in(0, Location::RequiresRegister());
result->set_out(0, Location::RequiresFpuRegister());
return result;
@@ -4966,8 +4962,8 @@ LocationSummary* DoubleToIntegerInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* result = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+ LocationSummary* result = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
result->set_in(0, Location::RegisterLocation(R1));
result->set_out(0, Location::RegisterLocation(R0));
return result;
@@ -5003,13 +4999,10 @@ void DoubleToIntegerInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(0));
const intptr_t kNumberOfArguments = 1;
- compiler->GenerateStaticCall(deopt_id(),
- instance_call()->token_pos(),
- target,
+ compiler->GenerateStaticCall(deopt_id(), instance_call()->token_pos(), target,
kNumberOfArguments,
Object::null_array(), // No argument names.,
- locs(),
- ICData::Handle());
+ locs(), ICData::Handle());
__ Bind(&done);
}
@@ -5018,8 +5011,8 @@ LocationSummary* DoubleToSmiInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* result = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* result = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
result->set_in(0, Location::RequiresFpuRegister());
result->set_out(0, Location::RequiresRegister());
return result;
@@ -5060,8 +5053,8 @@ LocationSummary* DoubleToFloatInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* result = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* result = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
result->set_in(0, Location::RequiresFpuRegister());
result->set_out(0, Location::RequiresFpuRegister());
return result;
@@ -5079,8 +5072,8 @@ LocationSummary* FloatToDoubleInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* result = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* result = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
result->set_in(0, Location::RequiresFpuRegister());
result->set_out(0, Location::RequiresFpuRegister());
return result;
@@ -5099,8 +5092,8 @@ LocationSummary* InvokeMathCFunctionInstr::MakeLocationSummary(Zone* zone,
ASSERT((InputCount() == 1) || (InputCount() == 2));
const intptr_t kNumTemps =
(recognized_kind() == MethodRecognizer::kMathDoublePow) ? 1 : 0;
- LocationSummary* result = new(zone) LocationSummary(
- zone, InputCount(), kNumTemps, LocationSummary::kCall);
+ LocationSummary* result = new (zone)
+ LocationSummary(zone, InputCount(), kNumTemps, LocationSummary::kCall);
result->set_in(0, Location::FpuRegisterLocation(V0));
if (InputCount() == 2) {
result->set_in(1, Location::FpuRegisterLocation(V1));
@@ -5147,7 +5140,7 @@ static void InvokeDoublePow(FlowGraphCompiler* compiler,
// exponent == 0.0 -> return 1.0;
__ fcmpdz(exp);
__ b(&check_base, VS); // NaN -> check base.
- __ b(&skip_call, EQ); // exp is 0.0, result is 1.0.
+ __ b(&skip_call, EQ); // exp is 0.0, result is 1.0.
// exponent == 1.0 ?
__ fcmpd(exp, result);
@@ -5240,27 +5233,27 @@ LocationSummary* ExtractNthOutputInstr::MakeLocationSummary(Zone* zone,
// Only use this instruction in optimized code.
ASSERT(opt);
const intptr_t kNumInputs = 1;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, 0, LocationSummary::kNoCall);
+ LocationSummary* summary =
+ new (zone) LocationSummary(zone, kNumInputs, 0, LocationSummary::kNoCall);
if (representation() == kUnboxedDouble) {
if (index() == 0) {
- summary->set_in(0, Location::Pair(Location::RequiresFpuRegister(),
- Location::Any()));
+ summary->set_in(
+ 0, Location::Pair(Location::RequiresFpuRegister(), Location::Any()));
} else {
ASSERT(index() == 1);
- summary->set_in(0, Location::Pair(Location::Any(),
- Location::RequiresFpuRegister()));
+ summary->set_in(
+ 0, Location::Pair(Location::Any(), Location::RequiresFpuRegister()));
}
summary->set_out(0, Location::RequiresFpuRegister());
} else {
ASSERT(representation() == kTagged);
if (index() == 0) {
- summary->set_in(0, Location::Pair(Location::RequiresRegister(),
- Location::Any()));
+ summary->set_in(
+ 0, Location::Pair(Location::RequiresRegister(), Location::Any()));
} else {
ASSERT(index() == 1);
- summary->set_in(0, Location::Pair(Location::Any(),
- Location::RequiresRegister()));
+ summary->set_in(
+ 0, Location::Pair(Location::Any(), Location::RequiresRegister()));
}
summary->set_out(0, Location::RequiresRegister());
}
@@ -5290,8 +5283,8 @@ LocationSummary* MergedMathInstr::MakeLocationSummary(Zone* zone,
if (kind() == MergedMathInstr::kTruncDivMod) {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresRegister());
summary->set_in(1, Location::RequiresRegister());
// Output is a pair of registers.
@@ -5364,13 +5357,13 @@ void MergedMathInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary(
- Zone* zone, bool opt) const {
+ Zone* zone,
+ bool opt) const {
return MakeCallSummary(zone);
}
-LocationSummary* BranchInstr::MakeLocationSummary(Zone* zone,
- bool opt) const {
+LocationSummary* BranchInstr::MakeLocationSummary(Zone* zone, bool opt) const {
comparison()->InitializeLocationSummary(zone, opt);
// Branches don't produce a result.
comparison()->locs()->set_out(0, Location::NoLocation());
@@ -5388,8 +5381,8 @@ LocationSummary* CheckClassInstr::MakeLocationSummary(Zone* zone,
const intptr_t kNumInputs = 1;
const bool need_mask_temp = IsDenseSwitch() && !IsDenseMask(ComputeCidMask());
const intptr_t kNumTemps = !IsNullCheck() ? (need_mask_temp ? 2 : 1) : 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresRegister());
if (!IsNullCheck()) {
summary->set_temp(0, Location::RequiresRegister());
@@ -5402,8 +5395,7 @@ LocationSummary* CheckClassInstr::MakeLocationSummary(Zone* zone,
void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
- Label* deopt = compiler->AddDeoptStub(deopt_id(),
- ICData::kDeoptCheckClass,
+ Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckClass,
licm_hoisted_ ? ICData::kHoisted : 0);
if (IsNullCheck()) {
__ CompareObject(locs()->in(0).reg(), Object::null_object());
@@ -5446,8 +5438,7 @@ void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
} else {
GrowableArray<CidTarget> sorted_ic_data;
- FlowGraphCompiler::SortICDataByCount(unary_checks(),
- &sorted_ic_data,
+ FlowGraphCompiler::SortICDataByCount(unary_checks(), &sorted_ic_data,
/* drop_smi = */ true);
const intptr_t num_checks = sorted_ic_data.length();
for (intptr_t i = 0; i < num_checks; i++) {
@@ -5469,8 +5460,8 @@ LocationSummary* CheckClassIdInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresRegister());
return summary;
}
@@ -5488,8 +5479,8 @@ LocationSummary* CheckSmiInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresRegister());
return summary;
}
@@ -5497,19 +5488,17 @@ LocationSummary* CheckSmiInstr::MakeLocationSummary(Zone* zone,
void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
const Register value = locs()->in(0).reg();
- Label* deopt = compiler->AddDeoptStub(deopt_id(),
- ICData::kDeoptCheckSmi,
+ Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckSmi,
licm_hoisted_ ? ICData::kHoisted : 0);
__ BranchIfNotSmi(value, deopt);
}
-
LocationSummary* GenericCheckBoundInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
- LocationSummary* locs = new(zone) LocationSummary(
+ LocationSummary* locs = new (zone) LocationSummary(
zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
locs->set_in(kLengthPos, Location::RequiresRegister());
locs->set_in(kIndexPos, Location::RequiresRegister());
@@ -5520,7 +5509,7 @@ LocationSummary* GenericCheckBoundInstr::MakeLocationSummary(Zone* zone,
class RangeErrorSlowPath : public SlowPathCode {
public:
RangeErrorSlowPath(GenericCheckBoundInstr* instruction, intptr_t try_index)
- : instruction_(instruction), try_index_(try_index) { }
+ : instruction_(instruction), try_index_(try_index) {}
virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
if (Assembler::EmittingComments()) {
@@ -5532,11 +5521,8 @@ class RangeErrorSlowPath : public SlowPathCode {
__ Push(locs->in(1).reg());
__ CallRuntime(kRangeErrorRuntimeEntry, 2);
compiler->pc_descriptors_list()->AddDescriptor(
- RawPcDescriptors::kOther,
- compiler->assembler()->CodeSize(),
- instruction_->deopt_id(),
- instruction_->token_pos(),
- try_index_);
+ RawPcDescriptors::kOther, compiler->assembler()->CodeSize(),
+ instruction_->deopt_id(), instruction_->token_pos(), try_index_);
compiler->RecordSafepoint(locs, 2);
__ brk(0);
}
@@ -5569,8 +5555,8 @@ LocationSummary* CheckArrayBoundInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
- LocationSummary* locs = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* locs = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length()));
locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index()));
return locs;
@@ -5580,10 +5566,8 @@ LocationSummary* CheckArrayBoundInstr::MakeLocationSummary(Zone* zone,
void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
uint32_t flags = generalized_ ? ICData::kGeneralized : 0;
flags |= licm_hoisted_ ? ICData::kHoisted : 0;
- Label* deopt = compiler->AddDeoptStub(
- deopt_id(),
- ICData::kDeoptCheckArrayBound,
- flags);
+ Label* deopt =
+ compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckArrayBound, flags);
Location length_loc = locs()->in(kLengthPos);
Location index_loc = locs()->in(kIndexPos);
@@ -5703,8 +5687,8 @@ LocationSummary* UnboxedIntConverterInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
if (from() == kUnboxedMint) {
UNREACHABLE();
} else if (to() == kUnboxedMint) {
@@ -5756,42 +5740,33 @@ void UnboxedIntConverterInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* ThrowInstr::MakeLocationSummary(Zone* zone,
- bool opt) const {
- return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
+LocationSummary* ThrowInstr::MakeLocationSummary(Zone* zone, bool opt) const {
+ return new (zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
}
void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
- compiler->GenerateRuntimeCall(token_pos(),
- deopt_id(),
- kThrowRuntimeEntry,
- 1,
+ compiler->GenerateRuntimeCall(token_pos(), deopt_id(), kThrowRuntimeEntry, 1,
locs());
__ brk(0);
}
-LocationSummary* ReThrowInstr::MakeLocationSummary(Zone* zone,
- bool opt) const {
- return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
+LocationSummary* ReThrowInstr::MakeLocationSummary(Zone* zone, bool opt) const {
+ return new (zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
}
void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
compiler->SetNeedsStacktrace(catch_try_index());
- compiler->GenerateRuntimeCall(token_pos(),
- deopt_id(),
- kReThrowRuntimeEntry,
- 2,
- locs());
+ compiler->GenerateRuntimeCall(token_pos(), deopt_id(), kReThrowRuntimeEntry,
+ 2, locs());
__ brk(0);
}
-LocationSummary* StopInstr::MakeLocationSummary(Zone* zone,
- bool opt) const {
- return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
+LocationSummary* StopInstr::MakeLocationSummary(Zone* zone, bool opt) const {
+ return new (zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
}
@@ -5807,9 +5782,8 @@ void GraphEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* GotoInstr::MakeLocationSummary(Zone* zone,
- bool opt) const {
- return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
+LocationSummary* GotoInstr::MakeLocationSummary(Zone* zone, bool opt) const {
+ return new (zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
}
@@ -5820,8 +5794,7 @@ void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
// Add a deoptimization descriptor for deoptimizing instructions that
// may be inserted before this instruction.
- compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
- GetDeoptId(),
+ compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, GetDeoptId(),
TokenPosition::kNoSource);
}
if (HasParallelMove()) {
@@ -5841,8 +5814,8 @@ LocationSummary* IndirectGotoInstr::MakeLocationSummary(Zone* zone,
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 1;
- LocationSummary* summary = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresRegister());
summary->set_temp(0, Location::RequiresRegister());
@@ -5865,10 +5838,9 @@ void IndirectGotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
// Add the offset.
Register offset_reg = locs()->in(0).reg();
- Operand offset_opr =
- (offset()->definition()->representation() == kTagged) ?
- Operand(offset_reg, ASR, kSmiTagSize) :
- Operand(offset_reg);
+ Operand offset_opr = (offset()->definition()->representation() == kTagged)
+ ? Operand(offset_reg, ASR, kSmiTagSize)
+ : Operand(offset_reg);
__ add(target_address_reg, target_address_reg, offset_opr);
// Jump to the absolute address.
@@ -5881,15 +5853,15 @@ LocationSummary* StrictCompareInstr::MakeLocationSummary(Zone* zone,
const intptr_t kNumInputs = 2;
const intptr_t kNumTemps = 0;
if (needs_number_check()) {
- LocationSummary* locs = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+ LocationSummary* locs = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
locs->set_in(0, Location::RegisterLocation(R0));
locs->set_in(1, Location::RegisterLocation(R1));
locs->set_out(0, Location::RegisterLocation(R0));
return locs;
}
- LocationSummary* locs = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ LocationSummary* locs = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
locs->set_in(0, Location::RegisterOrConstant(left()));
// Only one of the inputs can be a constant. Choose register if the first one
// is a constant.
@@ -5908,20 +5880,14 @@ Condition StrictCompareInstr::EmitComparisonCode(FlowGraphCompiler* compiler,
ASSERT(!left.IsConstant() || !right.IsConstant());
Condition true_condition;
if (left.IsConstant()) {
- true_condition = compiler->EmitEqualityRegConstCompare(right.reg(),
- left.constant(),
- needs_number_check(),
- token_pos());
+ true_condition = compiler->EmitEqualityRegConstCompare(
+ right.reg(), left.constant(), needs_number_check(), token_pos());
} else if (right.IsConstant()) {
- true_condition = compiler->EmitEqualityRegConstCompare(left.reg(),
- right.constant(),
- needs_number_check(),
- token_pos());
+ true_condition = compiler->EmitEqualityRegConstCompare(
+ left.reg(), right.constant(), needs_number_check(), token_pos());
} else {
- true_condition = compiler->EmitEqualityRegRegCompare(left.reg(),
- right.reg(),
- needs_number_check(),
- token_pos());
+ true_condition = compiler->EmitEqualityRegRegCompare(
+ left.reg(), right.reg(), needs_number_check(), token_pos());
}
if (kind() != Token::kEQ_STRICT) {
ASSERT(kind() == Token::kNE_STRICT);
@@ -5936,7 +5902,7 @@ void StrictCompareInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT);
Label is_true, is_false;
- BranchLabels labels = { &is_true, &is_false, &is_false };
+ BranchLabels labels = {&is_true, &is_false, &is_false};
Condition true_condition = EmitComparisonCode(compiler, labels);
EmitBranchOnCondition(compiler, true_condition, labels);
@@ -5963,9 +5929,7 @@ void StrictCompareInstr::EmitBranchCode(FlowGraphCompiler* compiler,
LocationSummary* BooleanNegateInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
- return LocationSummary::Make(zone,
- 1,
- Location::RequiresRegister(),
+ return LocationSummary::Make(zone, 1, Location::RequiresRegister(),
LocationSummary::kNoCall);
}
@@ -5991,9 +5955,7 @@ void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
const Code& stub = Code::ZoneHandle(
compiler->zone(), StubCode::GetAllocationStubForClass(cls()));
const StubEntry stub_entry(stub);
- compiler->GenerateCall(token_pos(),
- stub_entry,
- RawPcDescriptors::kOther,
+ compiler->GenerateCall(token_pos(), stub_entry, RawPcDescriptors::kOther,
locs());
compiler->AddStubCallTarget(stub);
__ Drop(ArgumentCount()); // Discard arguments.
@@ -6008,12 +5970,12 @@ void DebugStepCheckInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
-LocationSummary* GrowRegExpStackInstr::MakeLocationSummary(
- Zone* zone, bool opt) const {
+LocationSummary* GrowRegExpStackInstr::MakeLocationSummary(Zone* zone,
+ bool opt) const {
const intptr_t kNumInputs = 1;
const intptr_t kNumTemps = 0;
- LocationSummary* locs = new(zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kCall);
+ LocationSummary* locs = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
locs->set_in(0, Location::RegisterLocation(R0));
locs->set_out(0, Location::RegisterLocation(R0));
return locs;
@@ -6025,11 +5987,8 @@ void GrowRegExpStackInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
const Register result = locs()->out(0).reg();
__ PushObject(Object::null_object());
__ Push(typed_data);
- compiler->GenerateRuntimeCall(TokenPosition::kNoSource,
- deopt_id(),
- kGrowRegExpStackRuntimeEntry,
- 1,
- locs());
+ compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(),
+ kGrowRegExpStackRuntimeEntry, 1, locs());
__ Drop(1);
__ Pop(result);
}
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_dbc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698