| Index: runtime/vm/flow_graph_compiler_ia32.cc
|
| diff --git a/runtime/vm/flow_graph_compiler_ia32.cc b/runtime/vm/flow_graph_compiler_ia32.cc
|
| index e6f13b0e22beef1b4501fbea4c112c62f9e77033..65331b3cf1420a2c846b3bf02cd36f78d1373e5e 100644
|
| --- a/runtime/vm/flow_graph_compiler_ia32.cc
|
| +++ b/runtime/vm/flow_graph_compiler_ia32.cc
|
| @@ -30,7 +30,6 @@ DEFINE_FLAG(bool, unbox_mints, true, "Optimize 64-bit integer arithmetic.");
|
|
|
| DECLARE_FLAG(bool, enable_simd_inline);
|
|
|
| -
|
| FlowGraphCompiler::~FlowGraphCompiler() {
|
| // BlockInfos are zone-allocated, so their destructors are not called.
|
| // Verify the labels explicitly here.
|
| @@ -40,44 +39,36 @@ FlowGraphCompiler::~FlowGraphCompiler() {
|
| }
|
| }
|
|
|
| -
|
| bool FlowGraphCompiler::SupportsUnboxedDoubles() {
|
| return true;
|
| }
|
|
|
| -
|
| bool FlowGraphCompiler::SupportsUnboxedMints() {
|
| return FLAG_unbox_mints;
|
| }
|
|
|
| -
|
| bool FlowGraphCompiler::SupportsUnboxedSimd128() {
|
| return FLAG_enable_simd_inline;
|
| }
|
|
|
| -
|
| bool FlowGraphCompiler::SupportsHardwareDivision() {
|
| return true;
|
| }
|
|
|
| -
|
| bool FlowGraphCompiler::CanConvertUnboxedMintToDouble() {
|
| return true;
|
| }
|
|
|
| -
|
| void FlowGraphCompiler::EnterIntrinsicMode() {
|
| ASSERT(!intrinsic_mode());
|
| intrinsic_mode_ = true;
|
| }
|
|
|
| -
|
| void FlowGraphCompiler::ExitIntrinsicMode() {
|
| ASSERT(intrinsic_mode());
|
| intrinsic_mode_ = false;
|
| }
|
|
|
| -
|
| RawTypedData* CompilerDeoptInfo::CreateDeoptInfo(FlowGraphCompiler* compiler,
|
| DeoptInfoBuilder* builder,
|
| const Array& deopt_table) {
|
| @@ -162,7 +153,6 @@ RawTypedData* CompilerDeoptInfo::CreateDeoptInfo(FlowGraphCompiler* compiler,
|
| return builder->CreateDeoptInfo(deopt_table);
|
| }
|
|
|
| -
|
| void CompilerDeoptInfoWithStub::GenerateCode(FlowGraphCompiler* compiler,
|
| intptr_t stub_ix) {
|
| // Calls do not need stubs, they share a deoptimization trampoline.
|
| @@ -183,10 +173,8 @@ void CompilerDeoptInfoWithStub::GenerateCode(FlowGraphCompiler* compiler,
|
| #undef __
|
| }
|
|
|
| -
|
| #define __ assembler()->
|
|
|
| -
|
| // Fall through if bool_register contains null.
|
| void FlowGraphCompiler::GenerateBoolToJump(Register bool_register,
|
| Label* is_true,
|
| @@ -202,7 +190,6 @@ void FlowGraphCompiler::GenerateBoolToJump(Register bool_register,
|
| __ Bind(&fall_through);
|
| }
|
|
|
| -
|
| // Clobbers ECX.
|
| RawSubtypeTestCache* FlowGraphCompiler::GenerateCallSubtypeTestStub(
|
| TypeTestStubKind test_kind,
|
| @@ -248,7 +235,6 @@ RawSubtypeTestCache* FlowGraphCompiler::GenerateCallSubtypeTestStub(
|
| return type_test_cache.raw();
|
| }
|
|
|
| -
|
| // Jumps to labels 'is_instance' or 'is_not_instance' respectively, if
|
| // type test is conclusive, otherwise fallthrough if a type test could not
|
| // be completed.
|
| @@ -326,7 +312,6 @@ FlowGraphCompiler::GenerateInstantiatedTypeWithArgumentsTest(
|
| is_instance_lbl, is_not_instance_lbl);
|
| }
|
|
|
| -
|
| void FlowGraphCompiler::CheckClassIds(Register class_id_reg,
|
| const GrowableArray<intptr_t>& class_ids,
|
| Label* is_equal_lbl,
|
| @@ -338,7 +323,6 @@ void FlowGraphCompiler::CheckClassIds(Register class_id_reg,
|
| __ jmp(is_not_equal_lbl);
|
| }
|
|
|
| -
|
| // Testing against an instantiated type with no arguments, without
|
| // SubtypeTestCache.
|
| // EAX: instance to test against (preserved).
|
| @@ -406,7 +390,6 @@ bool FlowGraphCompiler::GenerateInstantiatedTypeNoArgumentsTest(
|
| return true;
|
| }
|
|
|
| -
|
| // Uses SubtypeTestCache to store instance class and result.
|
| // EAX: instance to test.
|
| // Clobbers EDI, ECX.
|
| @@ -438,7 +421,6 @@ RawSubtypeTestCache* FlowGraphCompiler::GenerateSubtype1TestCacheLookup(
|
| is_instance_lbl, is_not_instance_lbl);
|
| }
|
|
|
| -
|
| // Generates inlined check if 'type' is a type parameter or type itself
|
| // EAX: instance (preserved).
|
| // Clobbers EDX, EDI, ECX.
|
| @@ -520,7 +502,6 @@ RawSubtypeTestCache* FlowGraphCompiler::GenerateUninstantiatedTypeTest(
|
| return SubtypeTestCache::null();
|
| }
|
|
|
| -
|
| // Inputs:
|
| // - EAX: instance to test against (preserved).
|
| // - EDX: optional instantiator type arguments (preserved).
|
| @@ -563,7 +544,6 @@ RawSubtypeTestCache* FlowGraphCompiler::GenerateInlineInstanceof(
|
| is_not_instance_lbl);
|
| }
|
|
|
| -
|
| // If instanceof type test cannot be performed successfully at compile time and
|
| // therefore eliminated, optimize it by adding inlined tests for:
|
| // - NULL -> return type == Null (type is not Object or dynamic).
|
| @@ -613,11 +593,11 @@ void FlowGraphCompiler::GenerateInstanceOf(TokenPosition token_pos,
|
| // Generate runtime call.
|
| __ movl(EDX, Address(ESP, 1 * kWordSize)); // Get instantiator type args.
|
| __ movl(ECX, Address(ESP, 0 * kWordSize)); // Get function type args.
|
| - __ PushObject(Object::null_object()); // Make room for the result.
|
| - __ pushl(EAX); // Push the instance.
|
| - __ PushObject(type); // Push the type.
|
| - __ pushl(EDX); // Instantiator type arguments.
|
| - __ pushl(ECX); // Function type arguments.
|
| + __ PushObject(Object::null_object()); // Make room for the result.
|
| + __ pushl(EAX); // Push the instance.
|
| + __ PushObject(type); // Push the type.
|
| + __ pushl(EDX); // Instantiator type arguments.
|
| + __ pushl(ECX); // Function type arguments.
|
| __ LoadObject(EAX, test_cache);
|
| __ pushl(EAX);
|
| GenerateRuntimeCall(token_pos, deopt_id, kInstanceofRuntimeEntry, 5, locs);
|
| @@ -638,7 +618,6 @@ void FlowGraphCompiler::GenerateInstanceOf(TokenPosition token_pos,
|
| __ popl(EDX); // Remove pushed instantiator type arguments.
|
| }
|
|
|
| -
|
| // Optimize assignable type check by adding inlined tests for:
|
| // - NULL -> return NULL.
|
| // - Smi -> compile time subtype check (only if dst class is not parameterized).
|
| @@ -697,12 +676,12 @@ void FlowGraphCompiler::GenerateAssertAssignable(TokenPosition token_pos,
|
| __ Bind(&runtime_call);
|
| __ movl(EDX, Address(ESP, 1 * kWordSize)); // Get instantiator type args.
|
| __ movl(ECX, Address(ESP, 0 * kWordSize)); // Get function type args.
|
| - __ PushObject(Object::null_object()); // Make room for the result.
|
| - __ pushl(EAX); // Push the source object.
|
| - __ PushObject(dst_type); // Push the type of the destination.
|
| - __ pushl(EDX); // Instantiator type arguments.
|
| - __ pushl(ECX); // Function type arguments.
|
| - __ PushObject(dst_name); // Push the name of the destination.
|
| + __ PushObject(Object::null_object()); // Make room for the result.
|
| + __ pushl(EAX); // Push the source object.
|
| + __ PushObject(dst_type); // Push the type of the destination.
|
| + __ pushl(EDX); // Instantiator type arguments.
|
| + __ pushl(ECX); // Function type arguments.
|
| + __ PushObject(dst_name); // Push the name of the destination.
|
| __ LoadObject(EAX, test_cache);
|
| __ pushl(EAX);
|
| GenerateRuntimeCall(token_pos, deopt_id, kTypeCheckRuntimeEntry, 6, locs);
|
| @@ -716,7 +695,6 @@ void FlowGraphCompiler::GenerateAssertAssignable(TokenPosition token_pos,
|
| __ popl(EDX); // Remove pushed instantiator type arguments.
|
| }
|
|
|
| -
|
| void FlowGraphCompiler::EmitInstructionEpilogue(Instruction* instr) {
|
| if (is_optimizing()) {
|
| return;
|
| @@ -735,7 +713,6 @@ void FlowGraphCompiler::EmitInstructionEpilogue(Instruction* instr) {
|
| }
|
| }
|
|
|
| -
|
| void FlowGraphCompiler::CopyParameters() {
|
| __ Comment("Copy parameters");
|
| const Function& function = parsed_function().function();
|
| @@ -936,7 +913,6 @@ void FlowGraphCompiler::CopyParameters() {
|
| __ j(POSITIVE, &null_args_loop, Assembler::kNearJump);
|
| }
|
|
|
| -
|
| void FlowGraphCompiler::GenerateInlinedGetter(intptr_t offset) {
|
| // TOS: return address.
|
| // +1 : receiver.
|
| @@ -947,7 +923,6 @@ void FlowGraphCompiler::GenerateInlinedGetter(intptr_t offset) {
|
| __ ret();
|
| }
|
|
|
| -
|
| void FlowGraphCompiler::GenerateInlinedSetter(intptr_t offset) {
|
| // TOS: return address.
|
| // +1 : value
|
| @@ -963,7 +938,6 @@ void FlowGraphCompiler::GenerateInlinedSetter(intptr_t offset) {
|
| __ ret();
|
| }
|
|
|
| -
|
| // NOTE: If the entry code shape changes, ReturnAddressLocator in profiler.cc
|
| // needs to be updated to match.
|
| void FlowGraphCompiler::EmitFrameEntry() {
|
| @@ -996,7 +970,6 @@ void FlowGraphCompiler::EmitFrameEntry() {
|
| }
|
| }
|
|
|
| -
|
| void FlowGraphCompiler::CompileGraph() {
|
| InitCompiler();
|
|
|
| @@ -1132,7 +1105,6 @@ void FlowGraphCompiler::CompileGraph() {
|
| GenerateDeferredCode();
|
| }
|
|
|
| -
|
| void FlowGraphCompiler::GenerateCall(TokenPosition token_pos,
|
| const StubEntry& stub_entry,
|
| RawPcDescriptors::Kind kind,
|
| @@ -1141,7 +1113,6 @@ void FlowGraphCompiler::GenerateCall(TokenPosition token_pos,
|
| EmitCallsiteMetaData(token_pos, Thread::kNoDeoptId, kind, locs);
|
| }
|
|
|
| -
|
| void FlowGraphCompiler::GenerateDartCall(intptr_t deopt_id,
|
| TokenPosition token_pos,
|
| const StubEntry& stub_entry,
|
| @@ -1161,7 +1132,6 @@ void FlowGraphCompiler::GenerateDartCall(intptr_t deopt_id,
|
| }
|
| }
|
|
|
| -
|
| void FlowGraphCompiler::GenerateStaticDartCall(intptr_t deopt_id,
|
| TokenPosition token_pos,
|
| const StubEntry& stub_entry,
|
| @@ -1172,7 +1142,6 @@ void FlowGraphCompiler::GenerateStaticDartCall(intptr_t deopt_id,
|
| AddStaticCallTarget(target);
|
| }
|
|
|
| -
|
| void FlowGraphCompiler::GenerateRuntimeCall(TokenPosition token_pos,
|
| intptr_t deopt_id,
|
| const RuntimeEntry& entry,
|
| @@ -1194,7 +1163,6 @@ void FlowGraphCompiler::GenerateRuntimeCall(TokenPosition token_pos,
|
| }
|
| }
|
|
|
| -
|
| void FlowGraphCompiler::EmitUnoptimizedStaticCall(intptr_t argument_count,
|
| intptr_t deopt_id,
|
| TokenPosition token_pos,
|
| @@ -1208,7 +1176,6 @@ void FlowGraphCompiler::EmitUnoptimizedStaticCall(intptr_t argument_count,
|
| __ Drop(argument_count);
|
| }
|
|
|
| -
|
| void FlowGraphCompiler::EmitEdgeCounter(intptr_t edge_id) {
|
| // We do not check for overflow when incrementing the edge counter. The
|
| // function should normally be optimized long before the counter can
|
| @@ -1221,7 +1188,6 @@ void FlowGraphCompiler::EmitEdgeCounter(intptr_t edge_id) {
|
| __ IncrementSmiField(FieldAddress(EAX, Array::element_offset(edge_id)), 1);
|
| }
|
|
|
| -
|
| void FlowGraphCompiler::EmitOptimizedInstanceCall(const StubEntry& stub_entry,
|
| const ICData& ic_data,
|
| intptr_t argument_count,
|
| @@ -1242,7 +1208,6 @@ void FlowGraphCompiler::EmitOptimizedInstanceCall(const StubEntry& stub_entry,
|
| __ Drop(argument_count);
|
| }
|
|
|
| -
|
| void FlowGraphCompiler::EmitInstanceCall(const StubEntry& stub_entry,
|
| const ICData& ic_data,
|
| intptr_t argument_count,
|
| @@ -1256,7 +1221,6 @@ void FlowGraphCompiler::EmitInstanceCall(const StubEntry& stub_entry,
|
| __ Drop(argument_count);
|
| }
|
|
|
| -
|
| void FlowGraphCompiler::EmitMegamorphicInstanceCall(
|
| const String& name,
|
| const Array& arguments_descriptor,
|
| @@ -1294,7 +1258,6 @@ void FlowGraphCompiler::EmitMegamorphicInstanceCall(
|
| __ Drop(argument_count);
|
| }
|
|
|
| -
|
| void FlowGraphCompiler::EmitSwitchableInstanceCall(const ICData& ic_data,
|
| intptr_t argument_count,
|
| intptr_t deopt_id,
|
| @@ -1304,7 +1267,6 @@ void FlowGraphCompiler::EmitSwitchableInstanceCall(const ICData& ic_data,
|
| UNREACHABLE();
|
| }
|
|
|
| -
|
| void FlowGraphCompiler::EmitOptimizedStaticCall(
|
| const Function& function,
|
| const Array& arguments_descriptor,
|
| @@ -1326,7 +1288,6 @@ void FlowGraphCompiler::EmitOptimizedStaticCall(
|
| __ Drop(argument_count);
|
| }
|
|
|
| -
|
| Condition FlowGraphCompiler::EmitEqualityRegConstCompare(
|
| Register reg,
|
| const Object& obj,
|
| @@ -1360,7 +1321,6 @@ Condition FlowGraphCompiler::EmitEqualityRegConstCompare(
|
| return EQUAL;
|
| }
|
|
|
| -
|
| Condition FlowGraphCompiler::EmitEqualityRegRegCompare(Register left,
|
| Register right,
|
| bool needs_number_check,
|
| @@ -1384,7 +1344,6 @@ Condition FlowGraphCompiler::EmitEqualityRegRegCompare(Register left,
|
| return EQUAL;
|
| }
|
|
|
| -
|
| // This function must be in sync with FlowGraphCompiler::RecordSafepoint and
|
| // FlowGraphCompiler::SlowPathEnvironmentFor.
|
| void FlowGraphCompiler::SaveLiveRegisters(LocationSummary* locs) {
|
| @@ -1420,7 +1379,6 @@ void FlowGraphCompiler::SaveLiveRegisters(LocationSummary* locs) {
|
| }
|
| }
|
|
|
| -
|
| void FlowGraphCompiler::RestoreLiveRegisters(LocationSummary* locs) {
|
| for (intptr_t i = 0; i < kNumberOfCpuRegisters; ++i) {
|
| Register reg = static_cast<Register>(i);
|
| @@ -1445,7 +1403,6 @@ void FlowGraphCompiler::RestoreLiveRegisters(LocationSummary* locs) {
|
| }
|
| }
|
|
|
| -
|
| #if defined(DEBUG)
|
| void FlowGraphCompiler::ClobberDeadTempRegisters(LocationSummary* locs) {
|
| // Clobber temporaries that have not been manually preserved.
|
| @@ -1460,7 +1417,6 @@ void FlowGraphCompiler::ClobberDeadTempRegisters(LocationSummary* locs) {
|
| }
|
| #endif
|
|
|
| -
|
| void FlowGraphCompiler::EmitTestAndCallLoadReceiver(
|
| intptr_t argument_count,
|
| const Array& arguments_descriptor) {
|
| @@ -1470,19 +1426,16 @@ void FlowGraphCompiler::EmitTestAndCallLoadReceiver(
|
| __ LoadObject(EDX, arguments_descriptor);
|
| }
|
|
|
| -
|
| void FlowGraphCompiler::EmitTestAndCallSmiBranch(Label* label, bool if_smi) {
|
| __ testl(EAX, Immediate(kSmiTagMask));
|
| // Jump if receiver is (not) Smi.
|
| __ j(if_smi ? ZERO : NOT_ZERO, label);
|
| }
|
|
|
| -
|
| void FlowGraphCompiler::EmitTestAndCallLoadCid() {
|
| __ LoadClassId(EDI, EAX);
|
| }
|
|
|
| -
|
| int FlowGraphCompiler::EmitTestAndCallCheckCid(Label* next_label,
|
| const CidRange& range,
|
| int bias) {
|
| @@ -1499,11 +1452,9 @@ int FlowGraphCompiler::EmitTestAndCallCheckCid(Label* next_label,
|
| return bias;
|
| }
|
|
|
| -
|
| #undef __
|
| #define __ compiler_->assembler()->
|
|
|
| -
|
| void ParallelMoveResolver::EmitMove(int index) {
|
| MoveOperands* move = moves_[index];
|
| const Location source = move->src();
|
| @@ -1610,7 +1561,6 @@ void ParallelMoveResolver::EmitMove(int index) {
|
| move->Eliminate();
|
| }
|
|
|
| -
|
| void ParallelMoveResolver::EmitSwap(int index) {
|
| MoveOperands* move = moves_[index];
|
| const Location source = move->src();
|
| @@ -1686,7 +1636,6 @@ void ParallelMoveResolver::EmitSwap(int index) {
|
| }
|
| }
|
|
|
| -
|
| void ParallelMoveResolver::MoveMemoryToMemory(const Address& dst,
|
| const Address& src) {
|
| ScratchRegisterScope ensure_scratch(this, kNoRegister);
|
| @@ -1694,7 +1643,6 @@ void ParallelMoveResolver::MoveMemoryToMemory(const Address& dst,
|
| __ movl(dst, ensure_scratch.reg());
|
| }
|
|
|
| -
|
| void ParallelMoveResolver::StoreObject(const Address& dst, const Object& obj) {
|
| if (Assembler::IsSafeSmi(obj) || obj.IsNull()) {
|
| __ movl(dst, Immediate(reinterpret_cast<int32_t>(obj.raw())));
|
| @@ -1705,7 +1653,6 @@ void ParallelMoveResolver::StoreObject(const Address& dst, const Object& obj) {
|
| }
|
| }
|
|
|
| -
|
| void ParallelMoveResolver::Exchange(Register reg, const Address& mem) {
|
| ScratchRegisterScope ensure_scratch(this, reg);
|
| __ movl(ensure_scratch.reg(), mem);
|
| @@ -1713,7 +1660,6 @@ void ParallelMoveResolver::Exchange(Register reg, const Address& mem) {
|
| __ movl(reg, ensure_scratch.reg());
|
| }
|
|
|
| -
|
| void ParallelMoveResolver::Exchange(const Address& mem1, const Address& mem2) {
|
| ScratchRegisterScope ensure_scratch1(this, kNoRegister);
|
| ScratchRegisterScope ensure_scratch2(this, ensure_scratch1.reg());
|
| @@ -1723,14 +1669,12 @@ void ParallelMoveResolver::Exchange(const Address& mem1, const Address& mem2) {
|
| __ movl(mem1, ensure_scratch2.reg());
|
| }
|
|
|
| -
|
| void ParallelMoveResolver::Exchange(Register reg,
|
| Register base_reg,
|
| intptr_t stack_offset) {
|
| UNREACHABLE();
|
| }
|
|
|
| -
|
| void ParallelMoveResolver::Exchange(Register base_reg1,
|
| intptr_t stack_offset1,
|
| Register base_reg2,
|
| @@ -1738,29 +1682,24 @@ void ParallelMoveResolver::Exchange(Register base_reg1,
|
| UNREACHABLE();
|
| }
|
|
|
| -
|
| void ParallelMoveResolver::SpillScratch(Register reg) {
|
| __ pushl(reg);
|
| }
|
|
|
| -
|
| void ParallelMoveResolver::RestoreScratch(Register reg) {
|
| __ popl(reg);
|
| }
|
|
|
| -
|
| void ParallelMoveResolver::SpillFpuScratch(FpuRegister reg) {
|
| __ subl(ESP, Immediate(kFpuRegisterSize));
|
| __ movups(Address(ESP, 0), reg);
|
| }
|
|
|
| -
|
| void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) {
|
| __ movups(reg, Address(ESP, 0));
|
| __ addl(ESP, Immediate(kFpuRegisterSize));
|
| }
|
|
|
| -
|
| #undef __
|
|
|
| } // namespace dart
|
|
|