OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/native_entry.h" | 5 #include "vm/native_entry.h" |
6 #include "vm/object.h" | 6 #include "vm/object.h" |
7 #include "vm/object_store.h" | 7 #include "vm/object_store.h" |
8 #include "vm/snapshot.h" | 8 #include "vm/snapshot.h" |
9 #include "vm/stub_code.h" | 9 #include "vm/stub_code.h" |
10 #include "vm/symbols.h" | 10 #include "vm/symbols.h" |
(...skipping 1610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1621 ASSERT(info_array != TypedData::null()); | 1621 ASSERT(info_array != TypedData::null()); |
1622 | 1622 |
1623 writer->Write<intptr_t>(length); | 1623 writer->Write<intptr_t>(length); |
1624 for (intptr_t i = 0; i < length; i++) { | 1624 for (intptr_t i = 0; i < length; i++) { |
1625 ObjectPool::EntryType entry_type = | 1625 ObjectPool::EntryType entry_type = |
1626 static_cast<ObjectPool::EntryType>(info_array->data()[i]); | 1626 static_cast<ObjectPool::EntryType>(info_array->data()[i]); |
1627 writer->Write<int8_t>(entry_type); | 1627 writer->Write<int8_t>(entry_type); |
1628 Entry& entry = ptr()->data()[i]; | 1628 Entry& entry = ptr()->data()[i]; |
1629 switch (entry_type) { | 1629 switch (entry_type) { |
1630 case ObjectPool::kTaggedObject: { | 1630 case ObjectPool::kTaggedObject: { |
| 1631 #if !defined(TARGET_ARCH_DBC) |
1631 if (entry.raw_obj_ == StubCode::CallNativeCFunction_entry()->code()) { | 1632 if (entry.raw_obj_ == StubCode::CallNativeCFunction_entry()->code()) { |
1632 // Natives can run while precompiling, becoming linked and switching | 1633 // Natives can run while precompiling, becoming linked and switching |
1633 // their stub. Reset to the initial stub used for lazy-linking. | 1634 // their stub. Reset to the initial stub used for lazy-linking. |
1634 writer->WriteObjectImpl( | 1635 writer->WriteObjectImpl( |
1635 StubCode::CallBootstrapCFunction_entry()->code(), kAsReference); | 1636 StubCode::CallBootstrapCFunction_entry()->code(), kAsReference); |
1636 } else { | 1637 break; |
1637 writer->WriteObjectImpl(entry.raw_obj_, kAsReference); | |
1638 } | 1638 } |
| 1639 #endif |
| 1640 writer->WriteObjectImpl(entry.raw_obj_, kAsReference); |
1639 break; | 1641 break; |
1640 } | 1642 } |
1641 case ObjectPool::kImmediate: { | 1643 case ObjectPool::kImmediate: { |
1642 writer->Write<intptr_t>(entry.raw_value_); | 1644 writer->Write<intptr_t>(entry.raw_value_); |
1643 break; | 1645 break; |
1644 } | 1646 } |
1645 case ObjectPool::kNativeEntry: { | 1647 case ObjectPool::kNativeEntry: { |
1646 // Write nothing. Will initialize with the lazy link entry. | 1648 // Write nothing. Will initialize with the lazy link entry. |
1647 break; | 1649 break; |
1648 } | 1650 } |
(...skipping 2081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3730 // We do not allow objects with native fields in an isolate message. | 3732 // We do not allow objects with native fields in an isolate message. |
3731 writer->SetWriteException(Exceptions::kArgument, | 3733 writer->SetWriteException(Exceptions::kArgument, |
3732 "Illegal argument in isolate message" | 3734 "Illegal argument in isolate message" |
3733 " : (object is a UserTag)"); | 3735 " : (object is a UserTag)"); |
3734 } else { | 3736 } else { |
3735 UNREACHABLE(); | 3737 UNREACHABLE(); |
3736 } | 3738 } |
3737 } | 3739 } |
3738 | 3740 |
3739 } // namespace dart | 3741 } // namespace dart |
OLD | NEW |