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

Side by Side Diff: runtime/vm/intermediate_language_arm.cc

Issue 1190473004: Add flag polymorphic_with_deopt (default true) and handle case when false: use megamorphic instead … (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: r Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 5845 matching lines...) Expand 10 before | Expand all | Expand 10 after
5856 UNIMPLEMENTED(); 5856 UNIMPLEMENTED();
5857 } 5857 }
5858 5858
5859 5859
5860 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary( 5860 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary(
5861 Zone* zone, bool opt) const { 5861 Zone* zone, bool opt) const {
5862 return MakeCallSummary(zone); 5862 return MakeCallSummary(zone);
5863 } 5863 }
5864 5864
5865 5865
5866 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5867 ASSERT(ic_data().NumArgsTested() == 1);
5868 if (!with_checks()) {
5869 ASSERT(ic_data().HasOneTarget());
5870 const Function& target = Function::ZoneHandle(ic_data().GetTargetAt(0));
5871 compiler->GenerateStaticCall(deopt_id(),
5872 instance_call()->token_pos(),
5873 target,
5874 instance_call()->ArgumentCount(),
5875 instance_call()->argument_names(),
5876 locs(),
5877 ICData::Handle());
5878 return;
5879 }
5880
5881 Label* deopt = compiler->AddDeoptStub(
5882 deopt_id(), ICData::kDeoptPolymorphicInstanceCallTestFail);
5883 Label ok;
5884 compiler->EmitTestAndCall(ic_data(),
5885 instance_call()->ArgumentCount(),
5886 instance_call()->argument_names(),
5887 deopt,
5888 &ok,
5889 deopt_id(),
5890 instance_call()->token_pos(),
5891 locs());
5892 __ Bind(&ok);
5893 }
5894
5895
5896 LocationSummary* BranchInstr::MakeLocationSummary(Zone* zone, 5866 LocationSummary* BranchInstr::MakeLocationSummary(Zone* zone,
5897 bool opt) const { 5867 bool opt) const {
5898 comparison()->InitializeLocationSummary(zone, opt); 5868 comparison()->InitializeLocationSummary(zone, opt);
5899 // Branches don't produce a result. 5869 // Branches don't produce a result.
5900 comparison()->locs()->set_out(0, Location::NoLocation()); 5870 comparison()->locs()->set_out(0, Location::NoLocation());
5901 return comparison()->locs(); 5871 return comparison()->locs();
5902 } 5872 }
5903 5873
5904 5874
5905 void BranchInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 5875 void BranchInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after
6880 1, 6850 1,
6881 locs()); 6851 locs());
6882 __ Drop(1); 6852 __ Drop(1);
6883 __ Pop(result); 6853 __ Pop(result);
6884 } 6854 }
6885 6855
6886 6856
6887 } // namespace dart 6857 } // namespace dart
6888 6858
6889 #endif // defined TARGET_ARCH_ARM 6859 #endif // defined TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698