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 2329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2340 | 2340 |
2341 uint32_t GetMaxInstanceMemoryPages(Isolate* isolate, | 2341 uint32_t GetMaxInstanceMemoryPages(Isolate* isolate, |
2342 Handle<WasmInstanceObject> instance) { | 2342 Handle<WasmInstanceObject> instance) { |
2343 if (instance->has_memory_object()) { | 2343 if (instance->has_memory_object()) { |
2344 Handle<WasmMemoryObject> memory_object(instance->memory_object(), isolate); | 2344 Handle<WasmMemoryObject> memory_object(instance->memory_object(), isolate); |
2345 if (memory_object->has_maximum_pages()) { | 2345 if (memory_object->has_maximum_pages()) { |
2346 uint32_t maximum = static_cast<uint32_t>(memory_object->maximum_pages()); | 2346 uint32_t maximum = static_cast<uint32_t>(memory_object->maximum_pages()); |
2347 if (maximum < FLAG_wasm_max_mem_pages) return maximum; | 2347 if (maximum < FLAG_wasm_max_mem_pages) return maximum; |
2348 } | 2348 } |
2349 } | 2349 } |
2350 uint32_t compiled_max_pages = instance->compiled_module()->max_mem_pages(); | 2350 WasmCompiledModule* compiled_module = instance->compiled_module(); |
2351 isolate->counters()->wasm_max_mem_pages_count()->AddSample( | 2351 uint32_t compiled_max_pages = compiled_module->max_mem_pages(); |
2352 compiled_max_pages); | 2352 (compiled_module->module()->is_wasm() |
| 2353 ? isolate->counters()->wasm_wasm_max_mem_pages_count() |
| 2354 : isolate->counters()->wasm_asm_max_mem_pages_count()) |
| 2355 ->AddSample(compiled_max_pages); |
2353 if (compiled_max_pages != 0) return compiled_max_pages; | 2356 if (compiled_max_pages != 0) return compiled_max_pages; |
2354 return FLAG_wasm_max_mem_pages; | 2357 return FLAG_wasm_max_mem_pages; |
2355 } | 2358 } |
2356 | 2359 |
2357 Handle<JSArrayBuffer> GrowMemoryBuffer(Isolate* isolate, | 2360 Handle<JSArrayBuffer> GrowMemoryBuffer(Isolate* isolate, |
2358 MaybeHandle<JSArrayBuffer> buffer, | 2361 MaybeHandle<JSArrayBuffer> buffer, |
2359 uint32_t pages, uint32_t max_pages) { | 2362 uint32_t pages, uint32_t max_pages) { |
2360 Handle<JSArrayBuffer> old_buffer; | 2363 Handle<JSArrayBuffer> old_buffer; |
2361 Address old_mem_start = nullptr; | 2364 Address old_mem_start = nullptr; |
2362 uint32_t old_size = 0; | 2365 uint32_t old_size = 0; |
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3217 callee_compiled->instruction_start()); | 3220 callee_compiled->instruction_start()); |
3218 } | 3221 } |
3219 DCHECK_EQ(non_compiled_functions.size(), idx); | 3222 DCHECK_EQ(non_compiled_functions.size(), idx); |
3220 } | 3223 } |
3221 | 3224 |
3222 Code* ret = | 3225 Code* ret = |
3223 Code::cast(compiled_module->code_table()->get(func_to_return_idx)); | 3226 Code::cast(compiled_module->code_table()->get(func_to_return_idx)); |
3224 DCHECK_EQ(Code::WASM_FUNCTION, ret->kind()); | 3227 DCHECK_EQ(Code::WASM_FUNCTION, ret->kind()); |
3225 return handle(ret, isolate); | 3228 return handle(ret, isolate); |
3226 } | 3229 } |
OLD | NEW |