| 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/flow_graph_optimizer.h" | 5 #include "vm/flow_graph_optimizer.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/cha.h" | 8 #include "vm/cha.h" |
| 9 #include "vm/flow_graph_builder.h" | 9 #include "vm/flow_graph_builder.h" |
| 10 #include "vm/flow_graph_compiler.h" | 10 #include "vm/flow_graph_compiler.h" |
| (...skipping 2093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2104 switch (view_cid) { | 2104 switch (view_cid) { |
| 2105 case kTypedDataInt8ArrayCid: | 2105 case kTypedDataInt8ArrayCid: |
| 2106 case kTypedDataUint8ArrayCid: | 2106 case kTypedDataUint8ArrayCid: |
| 2107 case kTypedDataUint8ClampedArrayCid: | 2107 case kTypedDataUint8ClampedArrayCid: |
| 2108 case kExternalTypedDataUint8ArrayCid: | 2108 case kExternalTypedDataUint8ArrayCid: |
| 2109 case kExternalTypedDataUint8ClampedArrayCid: | 2109 case kExternalTypedDataUint8ClampedArrayCid: |
| 2110 case kTypedDataInt16ArrayCid: | 2110 case kTypedDataInt16ArrayCid: |
| 2111 case kTypedDataUint16ArrayCid: { | 2111 case kTypedDataUint16ArrayCid: { |
| 2112 // Check that value is always smi. | 2112 // Check that value is always smi. |
| 2113 value_check = ICData::New(Function::Handle(), | 2113 value_check = ICData::New(Function::Handle(), |
| 2114 String::Handle(), | 2114 Object::null_string(), |
| 2115 Object::null_array(), | 2115 Object::null_array(), |
| 2116 Isolate::kNoDeoptId, | 2116 Isolate::kNoDeoptId, |
| 2117 1); | 2117 1); |
| 2118 value_check.AddReceiverCheck(kSmiCid, Function::Handle()); | 2118 value_check.AddReceiverCheck(kSmiCid, Function::Handle()); |
| 2119 break; | 2119 break; |
| 2120 } | 2120 } |
| 2121 case kTypedDataInt32ArrayCid: | 2121 case kTypedDataInt32ArrayCid: |
| 2122 case kTypedDataUint32ArrayCid: | 2122 case kTypedDataUint32ArrayCid: |
| 2123 // We don't have ICData for the value stored, so we optimistically assume | 2123 // We don't have ICData for the value stored, so we optimistically assume |
| 2124 // smis first. If we ever deoptimized here, we require to unbox the value | 2124 // smis first. If we ever deoptimized here, we require to unbox the value |
| 2125 // before storing to handle the mint case, too. | 2125 // before storing to handle the mint case, too. |
| 2126 if (call->ic_data()->deopt_reason() == kDeoptUnknown) { | 2126 if (call->ic_data()->deopt_reason() == kDeoptUnknown) { |
| 2127 value_check = ICData::New(Function::Handle(), | 2127 value_check = ICData::New(Function::Handle(), |
| 2128 String::Handle(), | 2128 Object::null_string(), |
| 2129 Object::null_array(), // Dummy args. descr. | 2129 Object::null_array(), // Dummy args. descr. |
| 2130 Isolate::kNoDeoptId, | 2130 Isolate::kNoDeoptId, |
| 2131 1); | 2131 1); |
| 2132 value_check.AddReceiverCheck(kSmiCid, Function::Handle()); | 2132 value_check.AddReceiverCheck(kSmiCid, Function::Handle()); |
| 2133 } | 2133 } |
| 2134 break; | 2134 break; |
| 2135 case kTypedDataFloat32ArrayCid: | 2135 case kTypedDataFloat32ArrayCid: |
| 2136 case kTypedDataFloat64ArrayCid: { | 2136 case kTypedDataFloat64ArrayCid: { |
| 2137 // Check that value is always double. | 2137 // Check that value is always double. |
| 2138 value_check = ICData::New(Function::Handle(), | 2138 value_check = ICData::New(Function::Handle(), |
| 2139 String::Handle(), | 2139 Object::null_string(), |
| 2140 Object::null_array(), // Dummy args. descr. | 2140 Object::null_array(), // Dummy args. descr. |
| 2141 Isolate::kNoDeoptId, | 2141 Isolate::kNoDeoptId, |
| 2142 1); | 2142 1); |
| 2143 value_check.AddReceiverCheck(kDoubleCid, Function::Handle()); | 2143 value_check.AddReceiverCheck(kDoubleCid, Function::Handle()); |
| 2144 break; | 2144 break; |
| 2145 } | 2145 } |
| 2146 case kTypedDataFloat32x4ArrayCid: { | 2146 case kTypedDataFloat32x4ArrayCid: { |
| 2147 // Check that value is always Float32x4. | 2147 // Check that value is always Float32x4. |
| 2148 value_check = ICData::New(Function::Handle(), | 2148 value_check = ICData::New(Function::Handle(), |
| 2149 String::Handle(), | 2149 Object::null_string(), |
| 2150 Object::null_array(), // Dummy args. descr. | 2150 Object::null_array(), // Dummy args. descr. |
| 2151 Isolate::kNoDeoptId, | 2151 Isolate::kNoDeoptId, |
| 2152 1); | 2152 1); |
| 2153 value_check.AddReceiverCheck(kFloat32x4Cid, Function::Handle()); | 2153 value_check.AddReceiverCheck(kFloat32x4Cid, Function::Handle()); |
| 2154 break; | 2154 break; |
| 2155 } | 2155 } |
| 2156 default: | 2156 default: |
| 2157 // Array cids are already checked in the caller. | 2157 // Array cids are already checked in the caller. |
| 2158 UNREACHABLE(); | 2158 UNREACHABLE(); |
| 2159 } | 2159 } |
| (...skipping 4417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6577 | 6577 |
| 6578 // Insert materializations at environment uses. | 6578 // Insert materializations at environment uses. |
| 6579 const Class& cls = Class::Handle(alloc->constructor().Owner()); | 6579 const Class& cls = Class::Handle(alloc->constructor().Owner()); |
| 6580 for (intptr_t i = 0; i < exits.length(); i++) { | 6580 for (intptr_t i = 0; i < exits.length(); i++) { |
| 6581 CreateMaterializationAt(exits[i], alloc, cls, *fields); | 6581 CreateMaterializationAt(exits[i], alloc, cls, *fields); |
| 6582 } | 6582 } |
| 6583 } | 6583 } |
| 6584 | 6584 |
| 6585 | 6585 |
| 6586 } // namespace dart | 6586 } // namespace dart |
| OLD | NEW |