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

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

Issue 1149713002: With --noopt run unoptimized code through optimizer, more optimizations can be done later. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Cleanup Created 5 years, 7 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/intermediate_language.h" 5 #include "vm/intermediate_language.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/constant_propagator.h" 8 #include "vm/constant_propagator.h"
9 #include "vm/cpu.h" 9 #include "vm/cpu.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 2920 matching lines...) Expand 10 before | Expand all | Expand 10 after
2931 case Token::kSUB: return stub_code->SmiSubInlineCacheEntryPoint(); 2931 case Token::kSUB: return stub_code->SmiSubInlineCacheEntryPoint();
2932 case Token::kEQ: return stub_code->SmiEqualInlineCacheEntryPoint(); 2932 case Token::kEQ: return stub_code->SmiEqualInlineCacheEntryPoint();
2933 default: return 0; 2933 default: return 0;
2934 } 2934 }
2935 } 2935 }
2936 2936
2937 2937
2938 void InstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2938 void InstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2939 Zone* zone = compiler->zone(); 2939 Zone* zone = compiler->zone();
2940 const ICData* call_ic_data = NULL; 2940 const ICData* call_ic_data = NULL;
2941 if (!FLAG_propagate_ic_data || !compiler->is_optimizing()) { 2941 if (!FLAG_propagate_ic_data || !compiler->is_optimizing() ||
2942 (ic_data() == NULL)) {
2942 const Array& arguments_descriptor = 2943 const Array& arguments_descriptor =
2943 Array::Handle(zone, ArgumentsDescriptor::New(ArgumentCount(), 2944 Array::Handle(zone, ArgumentsDescriptor::New(ArgumentCount(),
2944 argument_names())); 2945 argument_names()));
2945 call_ic_data = compiler->GetOrAddInstanceCallICData( 2946 call_ic_data = compiler->GetOrAddInstanceCallICData(
2946 deopt_id(), function_name(), arguments_descriptor, 2947 deopt_id(), function_name(), arguments_descriptor,
2947 checked_argument_count()); 2948 checked_argument_count());
2948 } else { 2949 } else {
2949 call_ic_data = &ICData::ZoneHandle(zone, ic_data()->raw()); 2950 call_ic_data = &ICData::ZoneHandle(zone, ic_data()->raw());
2950 } 2951 }
2951 if (compiler->is_optimizing()) { 2952 if (compiler->is_optimizing() && HasICData()) {
2952 ASSERT(HasICData()); 2953 ASSERT(HasICData());
2953 if (ic_data()->NumberOfUsedChecks() > 0) { 2954 if (ic_data()->NumberOfUsedChecks() > 0) {
2954 const ICData& unary_ic_data = 2955 const ICData& unary_ic_data =
2955 ICData::ZoneHandle(zone, ic_data()->AsUnaryClassChecks()); 2956 ICData::ZoneHandle(zone, ic_data()->AsUnaryClassChecks());
2956 compiler->GenerateInstanceCall(deopt_id(), 2957 compiler->GenerateInstanceCall(deopt_id(),
2957 token_pos(), 2958 token_pos(),
2958 ArgumentCount(), 2959 ArgumentCount(),
2959 locs(), 2960 locs(),
2960 unary_ic_data); 2961 unary_ic_data);
2961 } else { 2962 } else {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
3047 3048
3048 3049
3049 LocationSummary* StaticCallInstr::MakeLocationSummary(Zone* zone, 3050 LocationSummary* StaticCallInstr::MakeLocationSummary(Zone* zone,
3050 bool optimizing) const { 3051 bool optimizing) const {
3051 return MakeCallSummary(zone); 3052 return MakeCallSummary(zone);
3052 } 3053 }
3053 3054
3054 3055
3055 void StaticCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3056 void StaticCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3056 const ICData* call_ic_data = NULL; 3057 const ICData* call_ic_data = NULL;
3057 if (!FLAG_propagate_ic_data || !compiler->is_optimizing()) { 3058 if (!FLAG_propagate_ic_data || !compiler->is_optimizing() ||
3059 (ic_data() == NULL)) {
3058 const Array& arguments_descriptor = 3060 const Array& arguments_descriptor =
3059 Array::Handle(ArgumentsDescriptor::New(ArgumentCount(), 3061 Array::Handle(ArgumentsDescriptor::New(ArgumentCount(),
3060 argument_names())); 3062 argument_names()));
3061 MethodRecognizer::Kind recognized_kind = 3063 MethodRecognizer::Kind recognized_kind =
3062 MethodRecognizer::RecognizeKind(function()); 3064 MethodRecognizer::RecognizeKind(function());
3063 int num_args_checked = 0; 3065 int num_args_checked = 0;
3064 switch (recognized_kind) { 3066 switch (recognized_kind) {
3065 case MethodRecognizer::kDoubleFromInteger: 3067 case MethodRecognizer::kDoubleFromInteger:
3066 case MethodRecognizer::kMathMin: 3068 case MethodRecognizer::kMathMin:
3067 case MethodRecognizer::kMathMax: 3069 case MethodRecognizer::kMathMax:
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
3599 case Token::kTRUNCDIV: return 0; 3601 case Token::kTRUNCDIV: return 0;
3600 case Token::kMOD: return 1; 3602 case Token::kMOD: return 1;
3601 default: UNIMPLEMENTED(); return -1; 3603 default: UNIMPLEMENTED(); return -1;
3602 } 3604 }
3603 } 3605 }
3604 3606
3605 3607
3606 #undef __ 3608 #undef __
3607 3609
3608 } // namespace dart 3610 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698