Skip to content

Commit cfe9172

Browse files
backesCommit Bot
authored andcommitted
[wasm] Disallow interpreter move
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. [email protected] Change-Id: Iba7d30243510ed9554be62b0c4c8e6f47f0c3307 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1871921 Reviewed-by: Andreas Haas <[email protected]> Commit-Queue: Clemens Backes <[email protected]> Cr-Commit-Position: refs/heads/master@{#64423}
1 parent 71e52b2 commit cfe9172

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/wasm/wasm-debug.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ MaybeHandle<String> GetLocalName(Isolate* isolate,
9797
}
9898

9999
class InterpreterHandle {
100-
MOVE_ONLY_NO_DEFAULT_CONSTRUCTOR(InterpreterHandle);
101100
Isolate* isolate_;
102101
const WasmModule* module_;
103102
WasmInterpreter interpreter_;
@@ -461,6 +460,9 @@ class InterpreterHandle {
461460
}
462461
return local_scope_object;
463462
}
463+
464+
private:
465+
DISALLOW_COPY_AND_ASSIGN(InterpreterHandle);
464466
};
465467

466468
} // namespace

src/wasm/wasm-interpreter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,6 @@ class V8_EXPORT_PRIVATE WasmInterpreter {
171171
uint32_t ActivationFrameBase(uint32_t activation_id);
172172
};
173173

174-
MOVE_ONLY_NO_DEFAULT_CONSTRUCTOR(WasmInterpreter);
175-
176174
WasmInterpreter(Isolate* isolate, const WasmModule* module,
177175
const ModuleWireBytes& wire_bytes,
178176
Handle<WasmInstanceObject> instance);
@@ -219,6 +217,8 @@ class V8_EXPORT_PRIVATE WasmInterpreter {
219217
private:
220218
Zone zone_;
221219
std::unique_ptr<WasmInterpreterInternals> internals_;
220+
221+
DISALLOW_COPY_AND_ASSIGN(WasmInterpreter);
222222
};
223223

224224
} // namespace wasm

0 commit comments

Comments
 (0)