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

Side by Side Diff: runtime/vm/redundancy_elimination.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/kernel_to_il.cc ('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) 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 "vm/redundancy_elimination.h" 5 #include "vm/redundancy_elimination.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/flow_graph.h" 8 #include "vm/flow_graph.h"
9 #include "vm/hash_map.h" 9 #include "vm/hash_map.h"
10 #include "vm/il_printer.h" 10 #include "vm/il_printer.h"
(...skipping 3063 matching lines...) Expand 10 before | Expand all | Expand 10 after
3074 // IR follows the following pattern: loads, materializations, deoptimizing 3074 // IR follows the following pattern: loads, materializations, deoptimizing
3075 // instruction. 3075 // instruction.
3076 Instruction* load_point = FirstMaterializationAt(exit); 3076 Instruction* load_point = FirstMaterializationAt(exit);
3077 3077
3078 // Insert load instruction for every field. 3078 // Insert load instruction for every field.
3079 for (intptr_t i = 0; i < slots.length(); i++) { 3079 for (intptr_t i = 0; i < slots.length(); i++) {
3080 LoadFieldInstr* load = 3080 LoadFieldInstr* load =
3081 slots[i]->IsField() 3081 slots[i]->IsField()
3082 ? new (Z) LoadFieldInstr( 3082 ? new (Z) LoadFieldInstr(
3083 new (Z) Value(alloc), &Field::Cast(*slots[i]), 3083 new (Z) Value(alloc), &Field::Cast(*slots[i]),
3084 AbstractType::ZoneHandle(Z), alloc->token_pos()) 3084 AbstractType::ZoneHandle(Z), alloc->token_pos(), NULL)
3085 : new (Z) LoadFieldInstr( 3085 : new (Z) LoadFieldInstr(
3086 new (Z) Value(alloc), Smi::Cast(*slots[i]).Value(), 3086 new (Z) Value(alloc), Smi::Cast(*slots[i]).Value(),
3087 AbstractType::ZoneHandle(Z), alloc->token_pos()); 3087 AbstractType::ZoneHandle(Z), alloc->token_pos());
3088 flow_graph_->InsertBefore(load_point, load, NULL, FlowGraph::kValue); 3088 flow_graph_->InsertBefore(load_point, load, NULL, FlowGraph::kValue);
3089 values->Add(new (Z) Value(load)); 3089 values->Add(new (Z) Value(load));
3090 } 3090 }
3091 3091
3092 MaterializeObjectInstr* mat = NULL; 3092 MaterializeObjectInstr* mat = NULL;
3093 if (alloc->IsAllocateObject()) { 3093 if (alloc->IsAllocateObject()) {
3094 mat = new (Z) 3094 mat = new (Z)
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
3374 join->phis_ = NULL; 3374 join->phis_ = NULL;
3375 } else { 3375 } else {
3376 join->phis_->TruncateTo(to_index); 3376 join->phis_->TruncateTo(to_index);
3377 } 3377 }
3378 } 3378 }
3379 } 3379 }
3380 } 3380 }
3381 3381
3382 3382
3383 } // namespace dart 3383 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/kernel_to_il.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698