diff options
Diffstat (limited to 'deps/v8/src/wasm/decoder.h')
-rw-r--r-- | deps/v8/src/wasm/decoder.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/deps/v8/src/wasm/decoder.h b/deps/v8/src/wasm/decoder.h index abb7b8ee86..71c06467f1 100644 --- a/deps/v8/src/wasm/decoder.h +++ b/deps/v8/src/wasm/decoder.h @@ -267,6 +267,12 @@ class Decoder { } const byte* end() const { return end_; } + // Check if the byte at {offset} from the current pc equals {expected}. + bool lookahead(int offset, byte expected) { + DCHECK_LE(pc_, end_); + return end_ - pc_ > offset && pc_[offset] == expected; + } + protected: const byte* start_; const byte* pc_; |