[wasm] Remove more obsolete DCHECKs

This time for the current memory size. This call also used to use the
context object stored in the instance, hence it required the instance
to be set. This is no longer the case, so the DCHECKs can just be
removed.

R=ahaas@chromium.org
BUG=chromium:727222

Change-Id: I72a7e3e80c3beb15ecad00c5be068e803456797e
Reviewed-on: https://chromium-review.googlesource.com/517947
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45587}
This commit is contained in:
Clemens Hammacher 2017-05-29 14:13:45 +02:00 committed by Commit Bot
parent 959c569fe8
commit b5203e8f4e
2 changed files with 15 additions and 4 deletions

View File

@ -2896,11 +2896,8 @@ Node* WasmGraphBuilder::MemBuffer(uint32_t offset) {
}
Node* WasmGraphBuilder::CurrentMemoryPages() {
// CurrentMemoryPages will not be called from asm.js, hence we cannot be in
// lazy-compilation mode, hence the instance will be set.
// CurrentMemoryPages can not be called from asm.js.
DCHECK_EQ(wasm::kWasmOrigin, module_->module->get_origin());
DCHECK_NOT_NULL(module_);
DCHECK_NOT_NULL(module_->instance);
Node* call = BuildCallToRuntime(Runtime::kWasmMemorySize, jsgraph(), nullptr,
0, effect_, control_);
Node* result = BuildChangeSmiToInt32(call);

View File

@ -0,0 +1,14 @@
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
load('test/mjsunit/wasm/wasm-constants.js');
load('test/mjsunit/wasm/wasm-module-builder.js');
var builder = new WasmModuleBuilder();
builder.addMemory(0, 0, false);
builder.addFunction('f', kSig_i_v)
.addBody([kExprMemorySize, kMemoryZero])
.exportFunc();
var instance = builder.instantiate();
instance.exports.f();