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 1558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1569 reader->ReadObjectImpl(kAsReference); | 1569 reader->ReadObjectImpl(kAsReference); |
1570 result->SetObjectAt(i, *(reader->PassiveObjectHandle())); | 1570 result->SetObjectAt(i, *(reader->PassiveObjectHandle())); |
1571 break; | 1571 break; |
1572 } | 1572 } |
1573 case ObjectPool::kImmediate: { | 1573 case ObjectPool::kImmediate: { |
1574 intptr_t raw_value = reader->Read<intptr_t>(); | 1574 intptr_t raw_value = reader->Read<intptr_t>(); |
1575 result->SetRawValueAt(i, raw_value); | 1575 result->SetRawValueAt(i, raw_value); |
1576 break; | 1576 break; |
1577 } | 1577 } |
1578 case ObjectPool::kNativeEntry: { | 1578 case ObjectPool::kNativeEntry: { |
| 1579 #if !defined(TARGET_ARCH_DBC) |
1579 // Read nothing. Initialize with the lazy link entry. | 1580 // Read nothing. Initialize with the lazy link entry. |
1580 uword new_entry = NativeEntry::LinkNativeCallEntry(); | 1581 uword new_entry = NativeEntry::LinkNativeCallEntry(); |
1581 result->SetRawValueAt(i, static_cast<intptr_t>(new_entry)); | 1582 result->SetRawValueAt(i, static_cast<intptr_t>(new_entry)); |
| 1583 #else |
| 1584 UNREACHABLE(); // DBC does not support lazy native call linking. |
| 1585 #endif |
1582 break; | 1586 break; |
1583 } | 1587 } |
1584 default: | 1588 default: |
1585 UNREACHABLE(); | 1589 UNREACHABLE(); |
1586 } | 1590 } |
1587 } | 1591 } |
1588 } | 1592 } |
1589 return result->raw(); | 1593 return result->raw(); |
1590 } | 1594 } |
1591 | 1595 |
(...skipping 29 matching lines...) Expand all Loading... |
1621 ASSERT(info_array != TypedData::null()); | 1625 ASSERT(info_array != TypedData::null()); |
1622 | 1626 |
1623 writer->Write<intptr_t>(length); | 1627 writer->Write<intptr_t>(length); |
1624 for (intptr_t i = 0; i < length; i++) { | 1628 for (intptr_t i = 0; i < length; i++) { |
1625 ObjectPool::EntryType entry_type = | 1629 ObjectPool::EntryType entry_type = |
1626 static_cast<ObjectPool::EntryType>(info_array->data()[i]); | 1630 static_cast<ObjectPool::EntryType>(info_array->data()[i]); |
1627 writer->Write<int8_t>(entry_type); | 1631 writer->Write<int8_t>(entry_type); |
1628 Entry& entry = ptr()->data()[i]; | 1632 Entry& entry = ptr()->data()[i]; |
1629 switch (entry_type) { | 1633 switch (entry_type) { |
1630 case ObjectPool::kTaggedObject: { | 1634 case ObjectPool::kTaggedObject: { |
| 1635 #if !defined(TARGET_ARCH_DBC) |
1631 if (entry.raw_obj_ == StubCode::CallNativeCFunction_entry()->code()) { | 1636 if (entry.raw_obj_ == StubCode::CallNativeCFunction_entry()->code()) { |
1632 // Natives can run while precompiling, becoming linked and switching | 1637 // Natives can run while precompiling, becoming linked and switching |
1633 // their stub. Reset to the initial stub used for lazy-linking. | 1638 // their stub. Reset to the initial stub used for lazy-linking. |
1634 writer->WriteObjectImpl( | 1639 writer->WriteObjectImpl( |
1635 StubCode::CallBootstrapCFunction_entry()->code(), kAsReference); | 1640 StubCode::CallBootstrapCFunction_entry()->code(), kAsReference); |
1636 } else { | 1641 break; |
1637 writer->WriteObjectImpl(entry.raw_obj_, kAsReference); | |
1638 } | 1642 } |
| 1643 #endif |
| 1644 writer->WriteObjectImpl(entry.raw_obj_, kAsReference); |
1639 break; | 1645 break; |
1640 } | 1646 } |
1641 case ObjectPool::kImmediate: { | 1647 case ObjectPool::kImmediate: { |
1642 writer->Write<intptr_t>(entry.raw_value_); | 1648 writer->Write<intptr_t>(entry.raw_value_); |
1643 break; | 1649 break; |
1644 } | 1650 } |
1645 case ObjectPool::kNativeEntry: { | 1651 case ObjectPool::kNativeEntry: { |
1646 // Write nothing. Will initialize with the lazy link entry. | 1652 // Write nothing. Will initialize with the lazy link entry. |
| 1653 #if defined(TARGET_ARCH_DBC) |
| 1654 UNREACHABLE(); // DBC does not support lazy native call linking. |
| 1655 #endif |
1647 break; | 1656 break; |
1648 } | 1657 } |
1649 default: | 1658 default: |
1650 UNREACHABLE(); | 1659 UNREACHABLE(); |
1651 } | 1660 } |
1652 } | 1661 } |
1653 } | 1662 } |
1654 } | 1663 } |
1655 | 1664 |
1656 | 1665 |
(...skipping 2073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3730 // We do not allow objects with native fields in an isolate message. | 3739 // We do not allow objects with native fields in an isolate message. |
3731 writer->SetWriteException(Exceptions::kArgument, | 3740 writer->SetWriteException(Exceptions::kArgument, |
3732 "Illegal argument in isolate message" | 3741 "Illegal argument in isolate message" |
3733 " : (object is a UserTag)"); | 3742 " : (object is a UserTag)"); |
3734 } else { | 3743 } else { |
3735 UNREACHABLE(); | 3744 UNREACHABLE(); |
3736 } | 3745 } |
3737 } | 3746 } |
3738 | 3747 |
3739 } // namespace dart | 3748 } // namespace dart |
OLD | NEW |