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

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

Issue 2704623003: VM: [Kernel] Ensure we record [FieldLoadInstr]s in the ParsedFunction when using field guards (Closed)
Patch Set: Moved the AddToGuardedFields call to the LoadFieldInstr constructor Created 3 years, 10 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/kernel_to_il.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 #ifndef DART_PRECOMPILED_RUNTIME 4 #ifndef DART_PRECOMPILED_RUNTIME
5 #include "vm/jit_optimizer.h" 5 #include "vm/jit_optimizer.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/branch_optimizer.h" 8 #include "vm/branch_optimizer.h"
9 #include "vm/cha.h" 9 #include "vm/cha.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after
964 // Inline implicit instance getter. 964 // Inline implicit instance getter.
965 const String& field_name = 965 const String& field_name =
966 String::Handle(Z, Field::NameFromGetter(call->function_name())); 966 String::Handle(Z, Field::NameFromGetter(call->function_name()));
967 const Field& field = Field::ZoneHandle(Z, GetField(class_ids[0], field_name)); 967 const Field& field = Field::ZoneHandle(Z, GetField(class_ids[0], field_name));
968 ASSERT(!field.IsNull()); 968 ASSERT(!field.IsNull());
969 969
970 if (flow_graph()->InstanceCallNeedsClassCheck(call, 970 if (flow_graph()->InstanceCallNeedsClassCheck(call,
971 RawFunction::kImplicitGetter)) { 971 RawFunction::kImplicitGetter)) {
972 AddReceiverCheck(call); 972 AddReceiverCheck(call);
973 } 973 }
974 LoadFieldInstr* load = new (Z) LoadFieldInstr( 974 LoadFieldInstr* load = new (Z)
975 new (Z) Value(call->ArgumentAt(0)), &field, 975 LoadFieldInstr(new (Z) Value(call->ArgumentAt(0)), &field,
976 AbstractType::ZoneHandle(Z, field.type()), call->token_pos()); 976 AbstractType::ZoneHandle(Z, field.type()),
977 call->token_pos(), &flow_graph()->parsed_function());
977 load->set_is_immutable(field.is_final()); 978 load->set_is_immutable(field.is_final());
978 if (field.guarded_cid() != kIllegalCid) {
979 if (!field.is_nullable() || (field.guarded_cid() == kNullCid)) {
980 load->set_result_cid(field.guarded_cid());
981 }
982 flow_graph()->parsed_function().AddToGuardedFields(&field);
983 }
984 979
985 // Discard the environment from the original instruction because the load 980 // Discard the environment from the original instruction because the load
986 // can't deoptimize. 981 // can't deoptimize.
987 call->RemoveEnvironment(); 982 call->RemoveEnvironment();
988 ReplaceCall(call, load); 983 ReplaceCall(call, load);
989 984
990 if (load->result_cid() != kDynamicCid) { 985 if (load->result_cid() != kDynamicCid) {
991 // Reset value types if guarded_cid was used. 986 // Reset value types if guarded_cid was used.
992 for (Value::Iterator it(load->input_use_list()); !it.Done(); it.Advance()) { 987 for (Value::Iterator it(load->input_use_list()); !it.Done(); it.Advance()) {
993 it.Current()->SetReachingType(NULL); 988 it.Current()->SetReachingType(NULL);
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after
1864 // Discard the environment from the original instruction because the store 1859 // Discard the environment from the original instruction because the store
1865 // can't deoptimize. 1860 // can't deoptimize.
1866 instr->RemoveEnvironment(); 1861 instr->RemoveEnvironment();
1867 ReplaceCall(instr, store); 1862 ReplaceCall(instr, store);
1868 return true; 1863 return true;
1869 } 1864 }
1870 1865
1871 1866
1872 } // namespace dart 1867 } // namespace dart
1873 #endif // DART_PRECOMPILED_RUNTIME 1868 #endif // DART_PRECOMPILED_RUNTIME
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/kernel_to_il.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698