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

Unified Diff: src/runtime/runtime-wasm.cc

Issue 2391223002: Revert of [wasm] Call a runtime function for a MemorySize instruction. (Closed)
Patch Set: Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime/runtime.h ('k') | test/cctest/wasm/test-run-wasm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-wasm.cc
diff --git a/src/runtime/runtime-wasm.cc b/src/runtime/runtime-wasm.cc
index 443755bd4f5d709e4676d7729c38a4154484cf08..84bb819a3974679060a9ba91d90f7c319baf4a09 100644
--- a/src/runtime/runtime-wasm.cc
+++ b/src/runtime/runtime-wasm.cc
@@ -17,37 +17,6 @@
namespace v8 {
namespace internal {
-
-RUNTIME_FUNCTION(Runtime_WasmMemorySize) {
- HandleScope scope(isolate);
- DCHECK_EQ(0, args.length());
-
- Handle<JSObject> module_instance;
- {
- // Get the module JSObject
- DisallowHeapAllocation no_allocation;
- const Address entry = Isolate::c_entry_fp(isolate->thread_local_top());
- Address pc =
- Memory::Address_at(entry + StandardFrameConstants::kCallerPCOffset);
- Code* code =
- isolate->inner_pointer_to_code_cache()->GetCacheEntry(pc)->code;
- Object* owning_instance = wasm::GetOwningWasmInstance(code);
- CHECK_NOT_NULL(owning_instance);
- module_instance = handle(JSObject::cast(owning_instance), isolate);
- }
-
- // Get mem buffer associated with module object
- MaybeHandle<JSArrayBuffer> maybe_mem_buffer =
- wasm::GetInstanceMemory(isolate, module_instance);
- Handle<JSArrayBuffer> old_buffer;
- if (!maybe_mem_buffer.ToHandle(&old_buffer)) {
- return *isolate->factory()->NewNumberFromInt(0);
- } else {
- uint32_t old_size = old_buffer->byte_length()->Number();
- return *isolate->factory()->NewNumberFromInt(old_size /
- wasm::WasmModule::kPageSize);
- }
-}
RUNTIME_FUNCTION(Runtime_WasmGrowMemory) {
HandleScope scope(isolate);
« no previous file with comments | « src/runtime/runtime.h ('k') | test/cctest/wasm/test-run-wasm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698