OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <memory> | 5 #include <memory> |
6 | 6 |
7 #include "src/assembler-inl.h" | 7 #include "src/assembler-inl.h" |
8 #include "src/base/adapters.h" | 8 #include "src/base/adapters.h" |
9 #include "src/base/atomic-utils.h" | 9 #include "src/base/atomic-utils.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1755 "memory import %d has larger maximum than maximum %u, got %d", | 1755 "memory import %d has larger maximum than maximum %u, got %d", |
1756 index, module_->max_mem_pages, imported_max_pages); | 1756 index, module_->max_mem_pages, imported_max_pages); |
1757 return -1; | 1757 return -1; |
1758 } | 1758 } |
1759 } | 1759 } |
1760 break; | 1760 break; |
1761 } | 1761 } |
1762 case kExternalGlobal: { | 1762 case kExternalGlobal: { |
1763 // Global imports are converted to numbers and written into the | 1763 // Global imports are converted to numbers and written into the |
1764 // {globals_} array buffer. | 1764 // {globals_} array buffer. |
| 1765 if (module_->globals[import.index].type == kWasmI64) { |
| 1766 ReportLinkError("global import cannot have type i64", index, |
| 1767 module_name, import_name); |
| 1768 return -1; |
| 1769 } |
1765 if (!value->IsNumber()) { | 1770 if (!value->IsNumber()) { |
1766 ReportLinkError("global import must be a number", index, | 1771 ReportLinkError("global import must be a number", index, |
1767 module_name, import_name); | 1772 module_name, import_name); |
1768 return -1; | 1773 return -1; |
1769 } | 1774 } |
1770 WriteGlobalValue(module_->globals[import.index], value); | 1775 WriteGlobalValue(module_->globals[import.index], value); |
1771 break; | 1776 break; |
1772 } | 1777 } |
1773 default: | 1778 default: |
1774 UNREACHABLE(); | 1779 UNREACHABLE(); |
(...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2621 | 2626 |
2622 JSObject::AddProperty(entry, name_string, export_name.ToHandleChecked(), | 2627 JSObject::AddProperty(entry, name_string, export_name.ToHandleChecked(), |
2623 NONE); | 2628 NONE); |
2624 JSObject::AddProperty(entry, kind_string, export_kind, NONE); | 2629 JSObject::AddProperty(entry, kind_string, export_kind, NONE); |
2625 | 2630 |
2626 storage->set(index, *entry); | 2631 storage->set(index, *entry); |
2627 } | 2632 } |
2628 | 2633 |
2629 return array_object; | 2634 return array_object; |
2630 } | 2635 } |
OLD | NEW |