| 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/base/atomic-utils.h" | 7 #include "src/base/atomic-utils.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 | 9 |
| 10 #include "src/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
| (...skipping 1874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1885 #define WCM_CHECK_OBJECT_OR_WEAK(TYPE, NAME) \ | 1885 #define WCM_CHECK_OBJECT_OR_WEAK(TYPE, NAME) \ |
| 1886 if (!arr->get(kID_##NAME)->IsUndefined(isolate) && \ | 1886 if (!arr->get(kID_##NAME)->IsUndefined(isolate) && \ |
| 1887 !arr->get(kID_##NAME)->Is##TYPE()) \ | 1887 !arr->get(kID_##NAME)->Is##TYPE()) \ |
| 1888 return false; | 1888 return false; |
| 1889 #define WCM_CHECK_OBJECT(TYPE, NAME) WCM_CHECK_OBJECT_OR_WEAK(TYPE, NAME) | 1889 #define WCM_CHECK_OBJECT(TYPE, NAME) WCM_CHECK_OBJECT_OR_WEAK(TYPE, NAME) |
| 1890 #define WCM_CHECK_WEAK_LINK(TYPE, NAME) WCM_CHECK_OBJECT_OR_WEAK(WeakCell, NAME) | 1890 #define WCM_CHECK_WEAK_LINK(TYPE, NAME) WCM_CHECK_OBJECT_OR_WEAK(WeakCell, NAME) |
| 1891 #define WCM_CHECK(KIND, TYPE, NAME) WCM_CHECK_##KIND(TYPE, NAME) | 1891 #define WCM_CHECK(KIND, TYPE, NAME) WCM_CHECK_##KIND(TYPE, NAME) |
| 1892 WCM_PROPERTY_TABLE(WCM_CHECK) | 1892 WCM_PROPERTY_TABLE(WCM_CHECK) |
| 1893 #undef WCM_CHECK | 1893 #undef WCM_CHECK |
| 1894 | 1894 |
| 1895 WasmCompiledModule* compiled_module = | |
| 1896 reinterpret_cast<WasmCompiledModule*>(obj); | |
| 1897 if (!compiled_module->has_module_bytes()) return false; | |
| 1898 SeqOneByteString* module_bytes = compiled_module->ptr_to_module_bytes(); | |
| 1899 if (module_bytes->length() < 4) return false; | |
| 1900 if (memcmp(module_bytes->GetChars(), "\0asm", 4)) return false; | |
| 1901 | |
| 1902 // All checks passed. | 1895 // All checks passed. |
| 1903 return true; | 1896 return true; |
| 1904 } | 1897 } |
| 1905 | 1898 |
| 1906 void WasmCompiledModule::PrintInstancesChain() { | 1899 void WasmCompiledModule::PrintInstancesChain() { |
| 1907 #if DEBUG | 1900 #if DEBUG |
| 1908 if (!FLAG_trace_wasm_instances) return; | 1901 if (!FLAG_trace_wasm_instances) return; |
| 1909 for (WasmCompiledModule* current = this; current != nullptr;) { | 1902 for (WasmCompiledModule* current = this; current != nullptr;) { |
| 1910 PrintF("->%d", current->instance_id()); | 1903 PrintF("->%d", current->instance_id()); |
| 1911 if (current->ptr_to_weak_next_instance() == nullptr) break; | 1904 if (current->ptr_to_weak_next_instance() == nullptr) break; |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2240 WasmCompiledModule* compiled_module = | 2233 WasmCompiledModule* compiled_module = |
| 2241 WasmCompiledModule::cast(instance->GetInternalField(kWasmCompiledModule)); | 2234 WasmCompiledModule::cast(instance->GetInternalField(kWasmCompiledModule)); |
| 2242 CHECK(compiled_module->has_weak_module_object()); | 2235 CHECK(compiled_module->has_weak_module_object()); |
| 2243 CHECK(compiled_module->ptr_to_weak_module_object()->cleared()); | 2236 CHECK(compiled_module->ptr_to_weak_module_object()->cleared()); |
| 2244 } | 2237 } |
| 2245 | 2238 |
| 2246 } // namespace testing | 2239 } // namespace testing |
| 2247 } // namespace wasm | 2240 } // namespace wasm |
| 2248 } // namespace internal | 2241 } // namespace internal |
| 2249 } // namespace v8 | 2242 } // namespace v8 |
| OLD | NEW |