Skip to content

Commit

Permalink
[wasm] Disallow interpreter move
Browse files Browse the repository at this point in the history
The MOVE_ONLY_NO_DEFAULT_CONSTRUCTOR macro defines a defaulted move
constructor and move-assignment operator. The {std::unique_ptr} on the
other hand needs the contained type to be complete when instantiating
the move assignment operator. Hence, this fails e.g. on MSVC, see
nodejs/node#30020 (comment).

It turns out that we never actually move the interpreter, so we can
just replace the MOVE_ONLY_NO_DEFAULT_CONSTRUCTOR by
DISALLOW_COPY_AND_ASSIGN.

R=ahaas@chromium.org

Change-Id: Iba7d30243510ed9554be62b0c4c8e6f47f0c3307
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1871921
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64423}
  • Loading branch information
backes authored and Commit Bot committed Oct 21, 2019
1 parent 71e52b2 commit cfe9172
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/wasm/wasm-debug.cc
Expand Up @@ -97,7 +97,6 @@ MaybeHandle<String> GetLocalName(Isolate* isolate,
}

class InterpreterHandle {
MOVE_ONLY_NO_DEFAULT_CONSTRUCTOR(InterpreterHandle);
Isolate* isolate_;
const WasmModule* module_;
WasmInterpreter interpreter_;
Expand Down Expand Up @@ -461,6 +460,9 @@ class InterpreterHandle {
}
return local_scope_object;
}

private:
DISALLOW_COPY_AND_ASSIGN(InterpreterHandle);
};

} // namespace
Expand Down
4 changes: 2 additions & 2 deletions src/wasm/wasm-interpreter.h
Expand Up @@ -171,8 +171,6 @@ class V8_EXPORT_PRIVATE WasmInterpreter {
uint32_t ActivationFrameBase(uint32_t activation_id);
};

MOVE_ONLY_NO_DEFAULT_CONSTRUCTOR(WasmInterpreter);

WasmInterpreter(Isolate* isolate, const WasmModule* module,
const ModuleWireBytes& wire_bytes,
Handle<WasmInstanceObject> instance);
Expand Down Expand Up @@ -219,6 +217,8 @@ class V8_EXPORT_PRIVATE WasmInterpreter {
private:
Zone zone_;
std::unique_ptr<WasmInterpreterInternals> internals_;

DISALLOW_COPY_AND_ASSIGN(WasmInterpreter);
};

} // namespace wasm
Expand Down

0 comments on commit cfe9172

Please sign in to comment.