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

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

Issue 2379733002: Recognize and optimize a.runtimeType == b.runtimeType pattern. (Closed)
Patch Set: Done Created 4 years, 2 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/bootstrap.h" 8 #include "vm/bootstrap.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/constant_propagator.h" 10 #include "vm/constant_propagator.h"
(...skipping 3208 matching lines...) Expand 10 before | Expand all | Expand 10 after
3219 instance_call()->ArgumentCount(), 3219 instance_call()->ArgumentCount(),
3220 instance_call()->argument_names(), 3220 instance_call()->argument_names(),
3221 deopt_id(), 3221 deopt_id(),
3222 instance_call()->token_pos(), 3222 instance_call()->token_pos(),
3223 locs(), 3223 locs(),
3224 complete()); 3224 complete());
3225 } 3225 }
3226 #endif 3226 #endif
3227 3227
3228 3228
3229 Definition* StaticCallInstr::Canonicalize(FlowGraph* flow_graph) {
3230 if (!FLAG_precompiled_mode) {
3231 return this;
3232 }
3233
3234 if (function().recognized_kind() == MethodRecognizer::kObjectRuntimeType) {
3235 if (input_use_list() == NULL) {
3236 // This function has only environment uses. In precompiled mode it is
3237 // fine to remove it - because we will never deoptimize.
3238 return flow_graph->constant_dead();
3239 }
3240 }
3241
3242 return this;
3243 }
3244
3245
3229 LocationSummary* StaticCallInstr::MakeLocationSummary(Zone* zone, 3246 LocationSummary* StaticCallInstr::MakeLocationSummary(Zone* zone,
3230 bool optimizing) const { 3247 bool optimizing) const {
3231 return MakeCallSummary(zone); 3248 return MakeCallSummary(zone);
3232 } 3249 }
3233 3250
3234 3251
3235 void StaticCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3252 void StaticCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3236 const ICData* call_ic_data = NULL; 3253 const ICData* call_ic_data = NULL;
3237 if (!FLAG_propagate_ic_data || !compiler->is_optimizing() || 3254 if (!FLAG_propagate_ic_data || !compiler->is_optimizing() ||
3238 (ic_data() == NULL)) { 3255 (ic_data() == NULL)) {
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
3861 set_native_c_function(native_function); 3878 set_native_c_function(native_function);
3862 function().SetIsNativeAutoSetupScope(auto_setup_scope); 3879 function().SetIsNativeAutoSetupScope(auto_setup_scope);
3863 Dart_NativeEntryResolver resolver = library.native_entry_resolver(); 3880 Dart_NativeEntryResolver resolver = library.native_entry_resolver();
3864 bool is_bootstrap_native = Bootstrap::IsBootstapResolver(resolver); 3881 bool is_bootstrap_native = Bootstrap::IsBootstapResolver(resolver);
3865 set_is_bootstrap_native(is_bootstrap_native); 3882 set_is_bootstrap_native(is_bootstrap_native);
3866 } 3883 }
3867 3884
3868 #undef __ 3885 #undef __
3869 3886
3870 } // namespace dart 3887 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698