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

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

Issue 2704623003: VM: [Kernel] Ensure we record [FieldLoadInstr]s in the ParsedFunction when using field guards (Closed)
Patch Set: 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 | « no previous file | 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 <map> 5 #include <map>
6 #include <set> 6 #include <set>
7 #include <string> 7 #include <string>
8 8
9 #include "vm/kernel_to_il.h" 9 #include "vm/kernel_to_il.h"
10 10
(...skipping 2437 matching lines...) Expand 10 before | Expand all | Expand 10 after
2448 ASSERT(field.IsZoneHandle()); 2448 ASSERT(field.IsZoneHandle());
2449 return field; 2449 return field;
2450 } 2450 }
2451 } 2451 }
2452 2452
2453 2453
2454 Fragment FlowGraphBuilder::LoadField(const dart::Field& field) { 2454 Fragment FlowGraphBuilder::LoadField(const dart::Field& field) {
2455 LoadFieldInstr* load = new (Z) LoadFieldInstr( 2455 LoadFieldInstr* load = new (Z) LoadFieldInstr(
2456 Pop(), &MayCloneField(Z, field), 2456 Pop(), &MayCloneField(Z, field),
2457 AbstractType::ZoneHandle(Z, field.type()), TokenPosition::kNoSource); 2457 AbstractType::ZoneHandle(Z, field.type()), TokenPosition::kNoSource);
2458 if (field.guarded_cid() != kIllegalCid) {
Vyacheslav Egorov (Google) 2017/02/17 10:24:31 I wonder if we should make a factory function on L
kustermann 2017/02/17 10:58:04 We have a number of places with this code, so I'll
2459 ASSERT(FLAG_use_field_guards);
2460 if (!field.is_nullable() || (field.guarded_cid() == kNullCid)) {
2461 load->set_result_cid(field.guarded_cid());
2462 }
2463 parsed_function_->AddToGuardedFields(&field);
2464 }
2458 Push(load); 2465 Push(load);
2459 return Fragment(load); 2466 return Fragment(load);
2460 } 2467 }
2461 2468
2462 2469
2463 Fragment FlowGraphBuilder::LoadField(intptr_t offset, intptr_t class_id) { 2470 Fragment FlowGraphBuilder::LoadField(intptr_t offset, intptr_t class_id) {
2464 LoadFieldInstr* load = new (Z) LoadFieldInstr( 2471 LoadFieldInstr* load = new (Z) LoadFieldInstr(
2465 Pop(), offset, AbstractType::ZoneHandle(Z), TokenPosition::kNoSource); 2472 Pop(), offset, AbstractType::ZoneHandle(Z), TokenPosition::kNoSource);
2466 load->set_result_cid(class_id); 2473 load->set_result_cid(class_id);
2467 Push(load); 2474 Push(load);
2468 return Fragment(load); 2475 return Fragment(load);
2469 } 2476 }
2470 2477
2471 2478
2472 Fragment FlowGraphBuilder::LoadNativeField(MethodRecognizer::Kind kind, 2479 Fragment FlowGraphBuilder::LoadNativeField(MethodRecognizer::Kind kind,
kustermann 2017/02/17 09:59:12 For LoadFields for context and native fields we do
Vyacheslav Egorov (Google) 2017/02/17 10:24:31 No.
2473 intptr_t offset, 2480 intptr_t offset,
2474 const Type& type, 2481 const Type& type,
2475 intptr_t class_id, 2482 intptr_t class_id,
2476 bool is_immutable) { 2483 bool is_immutable) {
2477 LoadFieldInstr* load = 2484 LoadFieldInstr* load =
2478 new (Z) LoadFieldInstr(Pop(), offset, type, TokenPosition::kNoSource); 2485 new (Z) LoadFieldInstr(Pop(), offset, type, TokenPosition::kNoSource);
2479 load->set_recognized_kind(kind); 2486 load->set_recognized_kind(kind);
2480 load->set_result_cid(class_id); 2487 load->set_result_cid(class_id);
2481 load->set_is_immutable(is_immutable); 2488 load->set_is_immutable(is_immutable);
2482 Push(load); 2489 Push(load);
(...skipping 3797 matching lines...) Expand 10 before | Expand all | Expand 10 after
6280 thread->clear_sticky_error(); 6287 thread->clear_sticky_error();
6281 return error.raw(); 6288 return error.raw();
6282 } 6289 }
6283 } 6290 }
6284 6291
6285 6292
6286 } // namespace kernel 6293 } // namespace kernel
6287 } // namespace dart 6294 } // namespace dart
6288 6295
6289 #endif // !defined(DART_PRECOMPILED_RUNTIME) 6296 #endif // !defined(DART_PRECOMPILED_RUNTIME)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698