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

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

Issue 306483005: - Use isolate where it is appropriate. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 | Annotate | Revision Log
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_XXX. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX.
6 6
7 #include "vm/flow_graph_compiler.h" 7 #include "vm/flow_graph_compiler.h"
8 8
9 #include "vm/cha.h" 9 #include "vm/cha.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 const Array& argument_names, 817 const Array& argument_names,
818 LocationSummary* locs, 818 LocationSummary* locs,
819 const ICData& ic_data) { 819 const ICData& ic_data) {
820 ASSERT(!ic_data.IsNull()); 820 ASSERT(!ic_data.IsNull());
821 ASSERT(FLAG_propagate_ic_data || (ic_data.NumberOfChecks() == 0)); 821 ASSERT(FLAG_propagate_ic_data || (ic_data.NumberOfChecks() == 0));
822 uword label_address = 0; 822 uword label_address = 0;
823 if (is_optimizing() && (ic_data.NumberOfChecks() == 0)) { 823 if (is_optimizing() && (ic_data.NumberOfChecks() == 0)) {
824 if (ic_data.IsClosureCall()) { 824 if (ic_data.IsClosureCall()) {
825 // This IC call may be closure call only. 825 // This IC call may be closure call only.
826 label_address = StubCode::ClosureCallInlineCacheEntryPoint(); 826 label_address = StubCode::ClosureCallInlineCacheEntryPoint();
827 ExternalLabel target_label("InlineCache", label_address); 827 ExternalLabel target_label(label_address);
828 EmitInstanceCall(&target_label, 828 EmitInstanceCall(&target_label,
829 ICData::ZoneHandle(ic_data.AsUnaryClassChecks()), 829 ICData::ZoneHandle(ic_data.AsUnaryClassChecks()),
830 argument_count, deopt_id, token_pos, locs); 830 argument_count, deopt_id, token_pos, locs);
831 return; 831 return;
832 } 832 }
833 // Emit IC call that will count and thus may need reoptimization at 833 // Emit IC call that will count and thus may need reoptimization at
834 // function entry. 834 // function entry.
835 ASSERT(!is_optimizing() 835 ASSERT(!is_optimizing()
836 || may_reoptimize() 836 || may_reoptimize()
837 || flow_graph().IsCompiledForOsr()); 837 || flow_graph().IsCompiledForOsr());
838 switch (ic_data.NumArgsTested()) { 838 switch (ic_data.NumArgsTested()) {
839 case 1: 839 case 1:
840 label_address = StubCode::OneArgOptimizedCheckInlineCacheEntryPoint(); 840 label_address = StubCode::OneArgOptimizedCheckInlineCacheEntryPoint();
841 break; 841 break;
842 case 2: 842 case 2:
843 label_address = StubCode::TwoArgsOptimizedCheckInlineCacheEntryPoint(); 843 label_address = StubCode::TwoArgsOptimizedCheckInlineCacheEntryPoint();
844 break; 844 break;
845 case 3: 845 case 3:
846 label_address = 846 label_address =
847 StubCode::ThreeArgsOptimizedCheckInlineCacheEntryPoint(); 847 StubCode::ThreeArgsOptimizedCheckInlineCacheEntryPoint();
848 break; 848 break;
849 default: 849 default:
850 UNIMPLEMENTED(); 850 UNIMPLEMENTED();
851 } 851 }
852 ExternalLabel target_label("InlineCache", label_address); 852 ExternalLabel target_label(label_address);
853 EmitOptimizedInstanceCall(&target_label, ic_data, 853 EmitOptimizedInstanceCall(&target_label, ic_data,
854 argument_count, deopt_id, token_pos, locs); 854 argument_count, deopt_id, token_pos, locs);
855 return; 855 return;
856 } 856 }
857 857
858 if (is_optimizing() && 858 if (is_optimizing() &&
859 // Do not make the instance call megamorphic if the callee needs to decode 859 // Do not make the instance call megamorphic if the callee needs to decode
860 // the calling code sequence to lookup the ic data and verify if a JS 860 // the calling code sequence to lookup the ic data and verify if a JS
861 // warning has already been issued or not. 861 // warning has already been issued or not.
862 (!FLAG_warn_on_javascript_compatibility || 862 (!FLAG_warn_on_javascript_compatibility ||
863 !ic_data.MayCheckForJSWarning())) { 863 !ic_data.MayCheckForJSWarning())) {
864 EmitMegamorphicInstanceCall(ic_data, argument_count, 864 EmitMegamorphicInstanceCall(ic_data, argument_count,
865 deopt_id, token_pos, locs); 865 deopt_id, token_pos, locs);
866 return; 866 return;
867 } 867 }
868 868
869 switch (ic_data.NumArgsTested()) { 869 switch (ic_data.NumArgsTested()) {
870 case 1: 870 case 1:
871 label_address = StubCode::OneArgCheckInlineCacheEntryPoint(); 871 label_address = StubCode::OneArgCheckInlineCacheEntryPoint();
872 break; 872 break;
873 case 2: 873 case 2:
874 label_address = StubCode::TwoArgsCheckInlineCacheEntryPoint(); 874 label_address = StubCode::TwoArgsCheckInlineCacheEntryPoint();
875 break; 875 break;
876 case 3: 876 case 3:
877 label_address = StubCode::ThreeArgsCheckInlineCacheEntryPoint(); 877 label_address = StubCode::ThreeArgsCheckInlineCacheEntryPoint();
878 break; 878 break;
879 default: 879 default:
880 UNIMPLEMENTED(); 880 UNIMPLEMENTED();
881 } 881 }
882 ExternalLabel target_label("InlineCache", label_address); 882 ExternalLabel target_label(label_address);
883 EmitInstanceCall(&target_label, ic_data, argument_count, 883 EmitInstanceCall(&target_label, ic_data, argument_count,
884 deopt_id, token_pos, locs); 884 deopt_id, token_pos, locs);
885 } 885 }
886 886
887 887
888 void FlowGraphCompiler::GenerateStaticCall(intptr_t deopt_id, 888 void FlowGraphCompiler::GenerateStaticCall(intptr_t deopt_id,
889 intptr_t token_pos, 889 intptr_t token_pos,
890 const Function& function, 890 const Function& function,
891 intptr_t argument_count, 891 intptr_t argument_count,
892 const Array& argument_names, 892 const Array& argument_names,
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
1305 1305
1306 for (int i = 0; i < len; i++) { 1306 for (int i = 0; i < len; i++) {
1307 sorted->Add(CidTarget(ic_data.GetReceiverClassIdAt(i), 1307 sorted->Add(CidTarget(ic_data.GetReceiverClassIdAt(i),
1308 &Function::ZoneHandle(ic_data.GetTargetAt(i)), 1308 &Function::ZoneHandle(ic_data.GetTargetAt(i)),
1309 ic_data.GetCountAt(i))); 1309 ic_data.GetCountAt(i)));
1310 } 1310 }
1311 sorted->Sort(HighestCountFirst); 1311 sorted->Sort(HighestCountFirst);
1312 } 1312 }
1313 1313
1314 } // namespace dart 1314 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698