| 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 3492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3503 ASSERT(store_index < length); | 3503 ASSERT(store_index < length); |
| 3504 ASSERT(store != NULL); | 3504 ASSERT(store != NULL); |
| 3505 if (store->value()->definition()->IsConstant()) { | 3505 if (store->value()->definition()->IsConstant()) { |
| 3506 ASSERT(store->index()->BindsToConstant()); | 3506 ASSERT(store->index()->BindsToConstant()); |
| 3507 const Object& obj = store->value()->definition()->AsConstant()->value(); | 3507 const Object& obj = store->value()->definition()->AsConstant()->value(); |
| 3508 // TODO(srdjan): Verify if any other types should be converted as well. | 3508 // TODO(srdjan): Verify if any other types should be converted as well. |
| 3509 if (obj.IsString()) { | 3509 if (obj.IsString()) { |
| 3510 pieces.SetAt(store_index, String::Cast(obj)); | 3510 pieces.SetAt(store_index, String::Cast(obj)); |
| 3511 } else if (obj.IsSmi()) { | 3511 } else if (obj.IsSmi()) { |
| 3512 const char* cstr = obj.ToCString(); | 3512 const char* cstr = obj.ToCString(); |
| 3513 pieces.SetAt(store_index, String::Handle(zone, String::New(cstr))); | 3513 pieces.SetAt(store_index, |
| 3514 String::Handle(zone, String::New(cstr, Heap::kOld))); |
| 3514 } else if (obj.IsBool()) { | 3515 } else if (obj.IsBool()) { |
| 3515 pieces.SetAt(store_index, | 3516 pieces.SetAt(store_index, |
| 3516 Bool::Cast(obj).value() ? Symbols::True() : Symbols::False()); | 3517 Bool::Cast(obj).value() ? Symbols::True() : Symbols::False()); |
| 3517 } else if (obj.IsNull()) { | 3518 } else if (obj.IsNull()) { |
| 3518 pieces.SetAt(store_index, Symbols::Null()); | 3519 pieces.SetAt(store_index, Symbols::Null()); |
| 3519 } else { | 3520 } else { |
| 3520 return this; | 3521 return this; |
| 3521 } | 3522 } |
| 3522 } else { | 3523 } else { |
| 3523 return this; | 3524 return this; |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3752 set_native_c_function(native_function); | 3753 set_native_c_function(native_function); |
| 3753 function().SetIsNativeAutoSetupScope(auto_setup_scope); | 3754 function().SetIsNativeAutoSetupScope(auto_setup_scope); |
| 3754 Dart_NativeEntryResolver resolver = library.native_entry_resolver(); | 3755 Dart_NativeEntryResolver resolver = library.native_entry_resolver(); |
| 3755 bool is_bootstrap_native = Bootstrap::IsBootstapResolver(resolver); | 3756 bool is_bootstrap_native = Bootstrap::IsBootstapResolver(resolver); |
| 3756 set_is_bootstrap_native(is_bootstrap_native); | 3757 set_is_bootstrap_native(is_bootstrap_native); |
| 3757 } | 3758 } |
| 3758 | 3759 |
| 3759 #undef __ | 3760 #undef __ |
| 3760 | 3761 |
| 3761 } // namespace dart | 3762 } // namespace dart |
| OLD | NEW |