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

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

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/flow_graph_builder.cc ('k') | runtime/vm/jit_optimizer.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 #ifndef RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ 5 #ifndef RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_
6 #define RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ 6 #define RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/ast.h" 9 #include "vm/ast.h"
10 #include "vm/growable_array.h" 10 #include "vm/growable_array.h"
(...skipping 4271 matching lines...) Expand 10 before | Expand all | Expand 10 after
4282 token_pos_(token_pos) { 4282 token_pos_(token_pos) {
4283 ASSERT(offset_in_bytes >= 0); 4283 ASSERT(offset_in_bytes >= 0);
4284 // May be null if field is not an instance. 4284 // May be null if field is not an instance.
4285 ASSERT(type.IsZoneHandle() || type.IsReadOnlyHandle()); 4285 ASSERT(type.IsZoneHandle() || type.IsReadOnlyHandle());
4286 SetInputAt(0, instance); 4286 SetInputAt(0, instance);
4287 } 4287 }
4288 4288
4289 LoadFieldInstr(Value* instance, 4289 LoadFieldInstr(Value* instance,
4290 const Field* field, 4290 const Field* field,
4291 const AbstractType& type, 4291 const AbstractType& type,
4292 TokenPosition token_pos) 4292 TokenPosition token_pos,
4293 const ParsedFunction* parsed_function)
4293 : offset_in_bytes_(field->Offset()), 4294 : offset_in_bytes_(field->Offset()),
4294 type_(type), 4295 type_(type),
4295 result_cid_(kDynamicCid), 4296 result_cid_(kDynamicCid),
4296 immutable_(false), 4297 immutable_(false),
4297 recognized_kind_(MethodRecognizer::kUnknown), 4298 recognized_kind_(MethodRecognizer::kUnknown),
4298 field_(field), 4299 field_(field),
4299 token_pos_(token_pos) { 4300 token_pos_(token_pos) {
4300 ASSERT(field->IsZoneHandle()); 4301 ASSERT(field->IsZoneHandle());
4301 // May be null if field is not an instance. 4302 // May be null if field is not an instance.
4302 ASSERT(type.IsZoneHandle() || type.IsReadOnlyHandle()); 4303 ASSERT(type.IsZoneHandle() || type.IsReadOnlyHandle());
4303 SetInputAt(0, instance); 4304 SetInputAt(0, instance);
4305
4306 if (parsed_function != NULL && field->guarded_cid() != kIllegalCid) {
4307 if (!field->is_nullable() || (field->guarded_cid() == kNullCid)) {
4308 set_result_cid(field->guarded_cid());
4309 }
4310 parsed_function->AddToGuardedFields(field);
4311 }
4304 } 4312 }
4305 4313
4306 void set_is_immutable(bool value) { immutable_ = value; } 4314 void set_is_immutable(bool value) { immutable_ = value; }
4307 4315
4308 Value* instance() const { return inputs_[0]; } 4316 Value* instance() const { return inputs_[0]; }
4309 intptr_t offset_in_bytes() const { return offset_in_bytes_; } 4317 intptr_t offset_in_bytes() const { return offset_in_bytes_; }
4310 const AbstractType& type() const { return type_; } 4318 const AbstractType& type() const { return type_; }
4311 void set_result_cid(intptr_t value) { result_cid_ = value; } 4319 void set_result_cid(intptr_t value) { result_cid_ = value; }
4312 intptr_t result_cid() const { return result_cid_; } 4320 intptr_t result_cid() const { return result_cid_; }
4313 virtual TokenPosition token_pos() const { return token_pos_; } 4321 virtual TokenPosition token_pos() const { return token_pos_; }
(...skipping 3710 matching lines...) Expand 10 before | Expand all | Expand 10 after
8024 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \ 8032 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \
8025 UNIMPLEMENTED(); \ 8033 UNIMPLEMENTED(); \
8026 return NULL; \ 8034 return NULL; \
8027 } \ 8035 } \
8028 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } 8036 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); }
8029 8037
8030 8038
8031 } // namespace dart 8039 } // namespace dart
8032 8040
8033 #endif // RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ 8041 #endif // RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/jit_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698