Index: src/wasm/wasm-js.cc |
diff --git a/src/wasm/wasm-js.cc b/src/wasm/wasm-js.cc |
index 557cb043cacf1970a1fdeb8897df91dc7bd38e16..b95ab9a20f59544562c83e4040cf6d8654b9a5a2 100644 |
--- a/src/wasm/wasm-js.cc |
+++ b/src/wasm/wasm-js.cc |
@@ -364,11 +364,10 @@ void WebAssemblyMemory(const v8::FunctionCallbackInfo<v8::Value>& args) { |
} |
} |
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
- i::Handle<i::JSArrayBuffer> buffer = |
- i_isolate->factory()->NewJSArrayBuffer(i::SharedFlag::kNotShared); |
size_t size = static_cast<size_t>(i::wasm::WasmModule::kPageSize) * |
static_cast<size_t>(initial); |
- i::JSArrayBuffer::SetupAllocatingData(buffer, i_isolate, size); |
+ i::Handle<i::JSArrayBuffer> buffer = |
+ i::wasm::NewArrayBuffer(i_isolate, size, i::FLAG_wasm_guard_pages); |
i::Handle<i::JSObject> memory_obj = i::WasmMemoryObject::New( |
i_isolate, buffer, has_maximum.FromJust() ? maximum : -1); |