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

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

Issue 2751103003: VM: Propagate non-nullness from instance calls. (Closed)
Patch Set: canonicalize redundant redefinitions Created 3 years, 9 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') | no next file » | 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/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 1920 matching lines...) Expand 10 before | Expand all | Expand 10 after
1931 Instruction* Instruction::Canonicalize(FlowGraph* flow_graph) { 1931 Instruction* Instruction::Canonicalize(FlowGraph* flow_graph) {
1932 return this; 1932 return this;
1933 } 1933 }
1934 1934
1935 1935
1936 Definition* Definition::Canonicalize(FlowGraph* flow_graph) { 1936 Definition* Definition::Canonicalize(FlowGraph* flow_graph) {
1937 return this; 1937 return this;
1938 } 1938 }
1939 1939
1940 1940
1941 Definition* RedefinitionInstr::Canonicalize(FlowGraph* flow_graph) {
1942 if (!HasUses()) {
1943 return NULL;
1944 }
1945 if ((constrained_type() != NULL) &&
1946 Type()->IsEqualTo(value()->definition()->Type())) {
1947 return value()->definition();
1948 }
1949 return this;
1950 }
1951
1952
1941 bool LoadFieldInstr::IsImmutableLengthLoad() const { 1953 bool LoadFieldInstr::IsImmutableLengthLoad() const {
1942 switch (recognized_kind()) { 1954 switch (recognized_kind()) {
1943 case MethodRecognizer::kObjectArrayLength: 1955 case MethodRecognizer::kObjectArrayLength:
1944 case MethodRecognizer::kImmutableArrayLength: 1956 case MethodRecognizer::kImmutableArrayLength:
1945 case MethodRecognizer::kTypedDataLength: 1957 case MethodRecognizer::kTypedDataLength:
1946 case MethodRecognizer::kStringBaseLength: 1958 case MethodRecognizer::kStringBaseLength:
1947 return true; 1959 return true;
1948 default: 1960 default:
1949 return false; 1961 return false;
1950 } 1962 }
(...skipping 2018 matching lines...) Expand 10 before | Expand all | Expand 10 after
3969 set_native_c_function(native_function); 3981 set_native_c_function(native_function);
3970 function().SetIsNativeAutoSetupScope(auto_setup_scope); 3982 function().SetIsNativeAutoSetupScope(auto_setup_scope);
3971 Dart_NativeEntryResolver resolver = library.native_entry_resolver(); 3983 Dart_NativeEntryResolver resolver = library.native_entry_resolver();
3972 bool is_bootstrap_native = Bootstrap::IsBootstapResolver(resolver); 3984 bool is_bootstrap_native = Bootstrap::IsBootstapResolver(resolver);
3973 set_is_bootstrap_native(is_bootstrap_native); 3985 set_is_bootstrap_native(is_bootstrap_native);
3974 } 3986 }
3975 3987
3976 #undef __ 3988 #undef __
3977 3989
3978 } // namespace dart 3990 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698