| 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/intermediate_language.h" | 5 #include "vm/intermediate_language.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/bootstrap.h" | 8 #include "vm/bootstrap.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/constant_propagator.h" | 10 #include "vm/constant_propagator.h" |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 bool CheckClassInstr::IsDenseMask(intptr_t mask) { | 254 bool CheckClassInstr::IsDenseMask(intptr_t mask) { |
| 255 // Returns true if the mask is a continuos sequence of ones in its binary | 255 // Returns true if the mask is a continuos sequence of ones in its binary |
| 256 // representation (i.e. no holes) | 256 // representation (i.e. no holes) |
| 257 return mask == -1 || Utils::IsPowerOfTwo(mask + 1); | 257 return mask == -1 || Utils::IsPowerOfTwo(mask + 1); |
| 258 } | 258 } |
| 259 | 259 |
| 260 | 260 |
| 261 bool LoadFieldInstr::IsUnboxedLoad() const { | 261 bool LoadFieldInstr::IsUnboxedLoad() const { |
| 262 return FLAG_unbox_numeric_fields | 262 return FLAG_unbox_numeric_fields |
| 263 && (field() != NULL) | 263 && (field() != NULL) |
| 264 && field()->IsUnboxedField(); | 264 && FlowGraphCompiler::IsUnboxedField(*field()); |
| 265 } | 265 } |
| 266 | 266 |
| 267 | 267 |
| 268 bool LoadFieldInstr::IsPotentialUnboxedLoad() const { | 268 bool LoadFieldInstr::IsPotentialUnboxedLoad() const { |
| 269 return FLAG_unbox_numeric_fields | 269 return FLAG_unbox_numeric_fields |
| 270 && (field() != NULL) | 270 && (field() != NULL) |
| 271 && field()->IsPotentialUnboxedField(); | 271 && FlowGraphCompiler::IsPotentialUnboxedField(*field()); |
| 272 } | 272 } |
| 273 | 273 |
| 274 | 274 |
| 275 Representation LoadFieldInstr::representation() const { | 275 Representation LoadFieldInstr::representation() const { |
| 276 if (IsUnboxedLoad()) { | 276 if (IsUnboxedLoad()) { |
| 277 const intptr_t cid = field()->UnboxedFieldCid(); | 277 const intptr_t cid = field()->UnboxedFieldCid(); |
| 278 switch (cid) { | 278 switch (cid) { |
| 279 case kDoubleCid: | 279 case kDoubleCid: |
| 280 return kUnboxedDouble; | 280 return kUnboxedDouble; |
| 281 case kFloat32x4Cid: | 281 case kFloat32x4Cid: |
| 282 return kUnboxedFloat32x4; | 282 return kUnboxedFloat32x4; |
| 283 case kFloat64x2Cid: | 283 case kFloat64x2Cid: |
| 284 return kUnboxedFloat64x2; | 284 return kUnboxedFloat64x2; |
| 285 default: | 285 default: |
| 286 UNREACHABLE(); | 286 UNREACHABLE(); |
| 287 } | 287 } |
| 288 } | 288 } |
| 289 return kTagged; | 289 return kTagged; |
| 290 } | 290 } |
| 291 | 291 |
| 292 | 292 |
| 293 bool StoreInstanceFieldInstr::IsUnboxedStore() const { | 293 bool StoreInstanceFieldInstr::IsUnboxedStore() const { |
| 294 return FLAG_unbox_numeric_fields | 294 return FLAG_unbox_numeric_fields |
| 295 && !field().IsNull() | 295 && !field().IsNull() |
| 296 && field().IsUnboxedField(); | 296 && FlowGraphCompiler::IsUnboxedField(field()); |
| 297 } | 297 } |
| 298 | 298 |
| 299 | 299 |
| 300 bool StoreInstanceFieldInstr::IsPotentialUnboxedStore() const { | 300 bool StoreInstanceFieldInstr::IsPotentialUnboxedStore() const { |
| 301 return FLAG_unbox_numeric_fields | 301 return FLAG_unbox_numeric_fields |
| 302 && !field().IsNull() | 302 && !field().IsNull() |
| 303 && field().IsPotentialUnboxedField(); | 303 && FlowGraphCompiler::IsPotentialUnboxedField(field()); |
| 304 } | 304 } |
| 305 | 305 |
| 306 | 306 |
| 307 Representation StoreInstanceFieldInstr::RequiredInputRepresentation( | 307 Representation StoreInstanceFieldInstr::RequiredInputRepresentation( |
| 308 intptr_t index) const { | 308 intptr_t index) const { |
| 309 ASSERT((index == 0) || (index == 1)); | 309 ASSERT((index == 0) || (index == 1)); |
| 310 if ((index == 1) && IsUnboxedStore()) { | 310 if ((index == 1) && IsUnboxedStore()) { |
| 311 const intptr_t cid = field().UnboxedFieldCid(); | 311 const intptr_t cid = field().UnboxedFieldCid(); |
| 312 switch (cid) { | 312 switch (cid) { |
| 313 case kDoubleCid: | 313 case kDoubleCid: |
| (...skipping 3363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3677 set_native_c_function(native_function); | 3677 set_native_c_function(native_function); |
| 3678 function().SetIsNativeAutoSetupScope(auto_setup_scope); | 3678 function().SetIsNativeAutoSetupScope(auto_setup_scope); |
| 3679 Dart_NativeEntryResolver resolver = library.native_entry_resolver(); | 3679 Dart_NativeEntryResolver resolver = library.native_entry_resolver(); |
| 3680 bool is_bootstrap_native = Bootstrap::IsBootstapResolver(resolver); | 3680 bool is_bootstrap_native = Bootstrap::IsBootstapResolver(resolver); |
| 3681 set_is_bootstrap_native(is_bootstrap_native); | 3681 set_is_bootstrap_native(is_bootstrap_native); |
| 3682 } | 3682 } |
| 3683 | 3683 |
| 3684 #undef __ | 3684 #undef __ |
| 3685 | 3685 |
| 3686 } // namespace dart | 3686 } // namespace dart |
| OLD | NEW |