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

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: m 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
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2932 matching lines...) Expand 10 before | Expand all | Expand 10 after
2943 case Token::kSUB: return stub_code->SmiSubInlineCacheEntryPoint(); 2943 case Token::kSUB: return stub_code->SmiSubInlineCacheEntryPoint();
2944 case Token::kEQ: return stub_code->SmiEqualInlineCacheEntryPoint(); 2944 case Token::kEQ: return stub_code->SmiEqualInlineCacheEntryPoint();
2945 default: return 0; 2945 default: return 0;
2946 } 2946 }
2947 } 2947 }
2948 2948
2949 2949
2950 void InstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2950 void InstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2951 Zone* zone = compiler->zone(); 2951 Zone* zone = compiler->zone();
2952 const ICData* call_ic_data = NULL; 2952 const ICData* call_ic_data = NULL;
2953 if (!FLAG_propagate_ic_data || !compiler->is_optimizing()) { 2953 if (!FLAG_propagate_ic_data || !compiler->is_optimizing() ||
2954 (ic_data() == NULL)) {
2954 const Array& arguments_descriptor = 2955 const Array& arguments_descriptor =
2955 Array::Handle(zone, ArgumentsDescriptor::New(ArgumentCount(), 2956 Array::Handle(zone, ArgumentsDescriptor::New(ArgumentCount(),
2956 argument_names())); 2957 argument_names()));
2957 call_ic_data = compiler->GetOrAddInstanceCallICData( 2958 call_ic_data = compiler->GetOrAddInstanceCallICData(
2958 deopt_id(), function_name(), arguments_descriptor, 2959 deopt_id(), function_name(), arguments_descriptor,
2959 checked_argument_count()); 2960 checked_argument_count());
2960 } else { 2961 } else {
2961 call_ic_data = &ICData::ZoneHandle(zone, ic_data()->raw()); 2962 call_ic_data = &ICData::ZoneHandle(zone, ic_data()->raw());
2962 } 2963 }
2963 if (compiler->is_optimizing()) { 2964 if (compiler->is_optimizing() && HasICData()) {
2964 ASSERT(HasICData()); 2965 ASSERT(HasICData());
2965 if (ic_data()->NumberOfUsedChecks() > 0) { 2966 if (ic_data()->NumberOfUsedChecks() > 0) {
2966 const ICData& unary_ic_data = 2967 const ICData& unary_ic_data =
2967 ICData::ZoneHandle(zone, ic_data()->AsUnaryClassChecks()); 2968 ICData::ZoneHandle(zone, ic_data()->AsUnaryClassChecks());
2968 compiler->GenerateInstanceCall(deopt_id(), 2969 compiler->GenerateInstanceCall(deopt_id(),
2969 token_pos(), 2970 token_pos(),
2970 ArgumentCount(), 2971 ArgumentCount(),
2971 locs(), 2972 locs(),
2972 unary_ic_data); 2973 unary_ic_data);
2973 } else { 2974 } else {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
3059 3060
3060 3061
3061 LocationSummary* StaticCallInstr::MakeLocationSummary(Zone* zone, 3062 LocationSummary* StaticCallInstr::MakeLocationSummary(Zone* zone,
3062 bool optimizing) const { 3063 bool optimizing) const {
3063 return MakeCallSummary(zone); 3064 return MakeCallSummary(zone);
3064 } 3065 }
3065 3066
3066 3067
3067 void StaticCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3068 void StaticCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3068 const ICData* call_ic_data = NULL; 3069 const ICData* call_ic_data = NULL;
3069 if (!FLAG_propagate_ic_data || !compiler->is_optimizing()) { 3070 if (!FLAG_propagate_ic_data || !compiler->is_optimizing() ||
3071 (ic_data() == NULL)) {
3070 const Array& arguments_descriptor = 3072 const Array& arguments_descriptor =
3071 Array::Handle(ArgumentsDescriptor::New(ArgumentCount(), 3073 Array::Handle(ArgumentsDescriptor::New(ArgumentCount(),
3072 argument_names())); 3074 argument_names()));
3073 MethodRecognizer::Kind recognized_kind = 3075 MethodRecognizer::Kind recognized_kind =
3074 MethodRecognizer::RecognizeKind(function()); 3076 MethodRecognizer::RecognizeKind(function());
3075 int num_args_checked = 0; 3077 int num_args_checked = 0;
3076 switch (recognized_kind) { 3078 switch (recognized_kind) {
3077 case MethodRecognizer::kDoubleFromInteger: 3079 case MethodRecognizer::kDoubleFromInteger:
3078 case MethodRecognizer::kMathMin: 3080 case MethodRecognizer::kMathMin:
3079 case MethodRecognizer::kMathMax: 3081 case MethodRecognizer::kMathMax:
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
3611 case Token::kTRUNCDIV: return 0; 3613 case Token::kTRUNCDIV: return 0;
3612 case Token::kMOD: return 1; 3614 case Token::kMOD: return 1;
3613 default: UNIMPLEMENTED(); return -1; 3615 default: UNIMPLEMENTED(); return -1;
3614 } 3616 }
3615 } 3617 }
3616 3618
3617 3619
3618 #undef __ 3620 #undef __
3619 3621
3620 } // namespace dart 3622 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698