Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/globals.h" // Needed here to get TARGET_ARCH_XXX. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX. |
| 6 | 6 |
| 7 #include "vm/flow_graph_compiler.h" | 7 #include "vm/flow_graph_compiler.h" |
| 8 | 8 |
| 9 #include "vm/bit_vector.h" | 9 #include "vm/bit_vector.h" |
| 10 #include "vm/cha.h" | 10 #include "vm/cha.h" |
| (...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1089 ASSERT(sequence_node.length() == 1); | 1089 ASSERT(sequence_node.length() == 1); |
| 1090 ASSERT(sequence_node.NodeAt(0)->IsReturnNode()); | 1090 ASSERT(sequence_node.NodeAt(0)->IsReturnNode()); |
| 1091 const ReturnNode& return_node = *sequence_node.NodeAt(0)->AsReturnNode(); | 1091 const ReturnNode& return_node = *sequence_node.NodeAt(0)->AsReturnNode(); |
| 1092 ASSERT(return_node.value()->IsLoadInstanceFieldNode()); | 1092 ASSERT(return_node.value()->IsLoadInstanceFieldNode()); |
| 1093 const LoadInstanceFieldNode& load_node = | 1093 const LoadInstanceFieldNode& load_node = |
| 1094 *return_node.value()->AsLoadInstanceFieldNode(); | 1094 *return_node.value()->AsLoadInstanceFieldNode(); |
| 1095 // Only intrinsify getter if the field cannot contain a mutable double. | 1095 // Only intrinsify getter if the field cannot contain a mutable double. |
| 1096 // Reading from a mutable double box requires allocating a fresh double. | 1096 // Reading from a mutable double box requires allocating a fresh double. |
| 1097 if (load_node.field().guarded_cid() == kDynamicCid) { | 1097 if (load_node.field().guarded_cid() == kDynamicCid) { |
| 1098 GenerateInlinedGetter(load_node.field().Offset()); | 1098 GenerateInlinedGetter(load_node.field().Offset()); |
| 1099 return true; | 1099 return !FLAG_use_field_guards; |
|
srdjan
2016/02/12 17:03:50
It would have been helpful to add comment why it d
| |
| 1100 } | 1100 } |
| 1101 return false; | 1101 return false; |
| 1102 } | 1102 } |
| 1103 if (parsed_function().function().kind() == RawFunction::kImplicitSetter) { | 1103 if (parsed_function().function().kind() == RawFunction::kImplicitSetter) { |
| 1104 // An implicit setter must have a specific AST structure. | 1104 // An implicit setter must have a specific AST structure. |
| 1105 // Sequence node has one store node and one return NULL node. | 1105 // Sequence node has one store node and one return NULL node. |
| 1106 const SequenceNode& sequence_node = *parsed_function().node_sequence(); | 1106 const SequenceNode& sequence_node = *parsed_function().node_sequence(); |
| 1107 ASSERT(sequence_node.length() == 2); | 1107 ASSERT(sequence_node.length() == 2); |
| 1108 ASSERT(sequence_node.NodeAt(0)->IsStoreInstanceFieldNode()); | 1108 ASSERT(sequence_node.NodeAt(0)->IsStoreInstanceFieldNode()); |
| 1109 ASSERT(sequence_node.NodeAt(1)->IsReturnNode()); | 1109 ASSERT(sequence_node.NodeAt(1)->IsReturnNode()); |
| 1110 const StoreInstanceFieldNode& store_node = | 1110 const StoreInstanceFieldNode& store_node = |
| 1111 *sequence_node.NodeAt(0)->AsStoreInstanceFieldNode(); | 1111 *sequence_node.NodeAt(0)->AsStoreInstanceFieldNode(); |
| 1112 if (store_node.field().guarded_cid() == kDynamicCid) { | 1112 if (store_node.field().guarded_cid() == kDynamicCid) { |
| 1113 GenerateInlinedSetter(store_node.field().Offset()); | 1113 GenerateInlinedSetter(store_node.field().Offset()); |
| 1114 return true; | 1114 return !FLAG_use_field_guards; |
| 1115 } | 1115 } |
| 1116 } | 1116 } |
| 1117 } | 1117 } |
| 1118 | 1118 |
| 1119 EnterIntrinsicMode(); | 1119 EnterIntrinsicMode(); |
| 1120 | 1120 |
| 1121 Intrinsifier::Intrinsify(parsed_function(), this); | 1121 Intrinsifier::Intrinsify(parsed_function(), this); |
| 1122 | 1122 |
| 1123 ExitIntrinsicMode(); | 1123 ExitIntrinsicMode(); |
| 1124 // "Deoptimization" from intrinsic continues here. All deoptimization | 1124 // "Deoptimization" from intrinsic continues here. All deoptimization |
| (...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1872 | 1872 |
| 1873 | 1873 |
| 1874 void FlowGraphCompiler::FrameStateClear() { | 1874 void FlowGraphCompiler::FrameStateClear() { |
| 1875 ASSERT(!is_optimizing()); | 1875 ASSERT(!is_optimizing()); |
| 1876 frame_state_.TruncateTo(0); | 1876 frame_state_.TruncateTo(0); |
| 1877 } | 1877 } |
| 1878 #endif | 1878 #endif |
| 1879 | 1879 |
| 1880 | 1880 |
| 1881 } // namespace dart | 1881 } // namespace dart |
| OLD | NEW |