Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: src/wasm/wasm-module.cc

Issue 2783713002: Separate module max memory pages counter for asm.js/WASM. (Closed)
Patch Set: Fix merge conflicts with master Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/counters.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « src/counters.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698