summaryrefslogtreecommitdiff
path: root/deps/v8/include
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2018-09-07 17:07:13 +0200
committerMichaël Zasso <targos@protonmail.com>2018-09-07 20:59:13 +0200
commit586db2414a338e1bf6eaf6e672a3adc7ce309f6a (patch)
tree139fa972aef648481ddee22a3a85b99707d28df5 /deps/v8/include
parent12ed7c94e5160aa6d38e3d2cb2a73dae0a6f9342 (diff)
downloadandroid-node-v8-586db2414a338e1bf6eaf6e672a3adc7ce309f6a.tar.gz
android-node-v8-586db2414a338e1bf6eaf6e672a3adc7ce309f6a.tar.bz2
android-node-v8-586db2414a338e1bf6eaf6e672a3adc7ce309f6a.zip
deps: update V8 to 6.9.427.22
PR-URL: https://github.com/nodejs/node/pull/21983 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'deps/v8/include')
-rw-r--r--deps/v8/include/v8-profiler.h2
-rw-r--r--deps/v8/include/v8-version.h6
-rw-r--r--deps/v8/include/v8.h344
3 files changed, 268 insertions, 84 deletions
diff --git a/deps/v8/include/v8-profiler.h b/deps/v8/include/v8-profiler.h
index af36aa6d2d..b486683c27 100644
--- a/deps/v8/include/v8-profiler.h
+++ b/deps/v8/include/v8-profiler.h
@@ -54,7 +54,7 @@ namespace v8 {
*/
class V8_EXPORT TracingCpuProfiler {
public:
- V8_DEPRECATE_SOON(
+ V8_DEPRECATED(
"The profiler is created automatically with the isolate.\n"
"No need to create it explicitly.",
static std::unique_ptr<TracingCpuProfiler> Create(Isolate*));
diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h
index f0ded3542c..c7cffaca44 100644
--- a/deps/v8/include/v8-version.h
+++ b/deps/v8/include/v8-version.h
@@ -9,9 +9,9 @@
// NOTE these macros are used by some of the tool scripts and the build
// system so their names cannot be changed without changing the scripts.
#define V8_MAJOR_VERSION 6
-#define V8_MINOR_VERSION 8
-#define V8_BUILD_NUMBER 275
-#define V8_PATCH_LEVEL 32
+#define V8_MINOR_VERSION 9
+#define V8_BUILD_NUMBER 427
+#define V8_PATCH_LEVEL 22
// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h
index 249a4aa184..23d5ba36db 100644
--- a/deps/v8/include/v8.h
+++ b/deps/v8/include/v8.h
@@ -71,7 +71,6 @@ class BigIntObject;
class Boolean;
class BooleanObject;
class Context;
-class CpuProfiler;
class Data;
class Date;
class External;
@@ -146,6 +145,8 @@ class DeferredHandles;
class Heap;
class HeapObject;
class Isolate;
+class LocalEmbedderHeapTracer;
+class NeverReadOnlySpaceObject;
class Object;
struct ScriptStreamingData;
template<typename T> class CustomArguments;
@@ -154,6 +155,7 @@ class FunctionCallbackArguments;
class GlobalHandles;
namespace wasm {
+class CompilationResultResolver;
class StreamingDecoder;
} // namespace wasm
@@ -176,18 +178,18 @@ const int kSmiTag = 0;
const int kSmiTagSize = 1;
const intptr_t kSmiTagMask = (1 << kSmiTagSize) - 1;
-template <size_t ptr_size>
+template <size_t tagged_ptr_size>
struct SmiTagging;
template <int kSmiShiftSize>
V8_INLINE internal::Object* IntToSmi(int value) {
int smi_shift_bits = kSmiTagSize + kSmiShiftSize;
- uintptr_t tagged_value =
- (static_cast<uintptr_t>(value) << smi_shift_bits) | kSmiTag;
+ intptr_t tagged_value =
+ (static_cast<intptr_t>(value) << smi_shift_bits) | kSmiTag;
return reinterpret_cast<internal::Object*>(tagged_value);
}
-// Smi constants for 32-bit systems.
+// Smi constants for systems where tagged pointer is a 32-bit value.
template <>
struct SmiTagging<4> {
enum { kSmiShiftSize = 0, kSmiValueSize = 31 };
@@ -217,7 +219,7 @@ struct SmiTagging<4> {
}
};
-// Smi constants for 64-bit systems.
+// Smi constants for systems where tagged pointer is a 64-bit value.
template <>
struct SmiTagging<8> {
enum { kSmiShiftSize = 31, kSmiValueSize = 32 };
@@ -237,7 +239,15 @@ struct SmiTagging<8> {
}
};
+#if V8_COMPRESS_POINTERS
+static_assert(
+ kApiPointerSize == kApiInt64Size,
+ "Pointer compression can be enabled only for 64-bit architectures");
+typedef SmiTagging<4> PlatformSmiTagging;
+#else
typedef SmiTagging<kApiPointerSize> PlatformSmiTagging;
+#endif
+
const int kSmiShiftSize = PlatformSmiTagging::kSmiShiftSize;
const int kSmiValueSize = PlatformSmiTagging::kSmiValueSize;
const int kSmiMinValue = (static_cast<unsigned int>(-1)) << (kSmiValueSize - 1);
@@ -985,8 +995,8 @@ class V8_EXPORT HandleScope {
void operator delete[](void*, size_t);
// Uses heap_object to obtain the current Isolate.
- static internal::Object** CreateHandle(internal::HeapObject* heap_object,
- internal::Object* value);
+ static internal::Object** CreateHandle(
+ internal::NeverReadOnlySpaceObject* heap_object, internal::Object* value);
internal::Isolate* isolate_;
internal::Object** prev_next_;
@@ -1022,6 +1032,11 @@ class V8_EXPORT EscapableHandleScope : public HandleScope {
return Local<T>(reinterpret_cast<T*>(slot));
}
+ template <class T>
+ V8_INLINE MaybeLocal<T> EscapeMaybe(MaybeLocal<T> value) {
+ return Escape(value.FromMaybe(Local<T>()));
+ }
+
EscapableHandleScope(const EscapableHandleScope&) = delete;
void operator=(const EscapableHandleScope&) = delete;
@@ -1108,8 +1123,12 @@ class V8_EXPORT PrimitiveArray {
public:
static Local<PrimitiveArray> New(Isolate* isolate, int length);
int Length() const;
- void Set(int index, Local<Primitive> item);
- Local<Primitive> Get(int index);
+ void Set(Isolate* isolate, int index, Local<Primitive> item);
+ Local<Primitive> Get(Isolate* isolate, int index);
+
+ V8_DEPRECATE_SOON("Use Isolate version",
+ void Set(int index, Local<Primitive> item));
+ V8_DEPRECATE_SOON("Use Isolate version", Local<Primitive> Get(int index));
};
/**
@@ -1468,6 +1487,10 @@ class V8_EXPORT ScriptCompiler {
* more than two data chunks. The embedder can avoid this problem by always
* returning at least 2 bytes of data.
*
+ * When streaming UTF-16 data, V8 does not handle characters split between
+ * two data chunks. The embedder has to make sure that chunks have an even
+ * length.
+ *
* If the embedder wants to cancel the streaming, they should make the next
* GetMoreData call return 0. V8 will interpret it as end of data (and most
* probably, parsing will fail). The streaming task will return as soon as
@@ -1651,7 +1674,9 @@ class V8_EXPORT ScriptCompiler {
* ECMAScript specification.
*/
static V8_WARN_UNUSED_RESULT MaybeLocal<Module> CompileModule(
- Isolate* isolate, Source* source);
+ Isolate* isolate, Source* source,
+ CompileOptions options = kNoCompileOptions,
+ NoCacheReason no_cache_reason = kNoCacheNoReason);
/**
* Compile a function for a given context. This is equivalent to running
@@ -4349,10 +4374,29 @@ class V8_EXPORT Proxy : public Object {
class V8_EXPORT WasmCompiledModule : public Object {
public:
typedef std::pair<std::unique_ptr<const uint8_t[]>, size_t> SerializedModule;
- /**
- * A buffer that is owned by the caller.
- */
- typedef std::pair<const uint8_t*, size_t> CallerOwnedBuffer;
+
+// The COMMA macro allows us to use ',' inside of the V8_DEPRECATE_SOON macro.
+#define COMMA ,
+ V8_DEPRECATE_SOON(
+ "Use BufferReference.",
+ typedef std::pair<const uint8_t * COMMA size_t> CallerOwnedBuffer);
+#undef COMMA
+
+ /**
+ * A unowned reference to a byte buffer.
+ */
+ struct BufferReference {
+ const uint8_t* start;
+ size_t size;
+ BufferReference(const uint8_t* start, size_t size)
+ : start(start), size(size) {}
+ // Temporarily allow conversion to and from CallerOwnedBuffer.
+ V8_DEPRECATE_SOON(
+ "Use BufferReference directly.",
+ inline BufferReference(CallerOwnedBuffer)); // NOLINT(runtime/explicit)
+ V8_DEPRECATE_SOON("Use BufferReference directly.",
+ inline operator CallerOwnedBuffer());
+ };
/**
* An opaque, native heap object for transferring wasm modules. It
@@ -4369,7 +4413,7 @@ class V8_EXPORT WasmCompiledModule : public Object {
private:
typedef std::pair<std::unique_ptr<const uint8_t[]>, size_t> OwnedBuffer;
friend class WasmCompiledModule;
- TransferrableModule(OwnedBuffer&& code, OwnedBuffer&& bytes)
+ TransferrableModule(OwnedBuffer code, OwnedBuffer bytes)
: compiled_code(std::move(code)), wire_bytes(std::move(bytes)) {}
OwnedBuffer compiled_code = {nullptr, 0};
@@ -4393,7 +4437,9 @@ class V8_EXPORT WasmCompiledModule : public Object {
/**
* Get the wasm-encoded bytes that were used to compile this module.
*/
- Local<String> GetWasmWireBytes();
+ BufferReference GetWasmWireBytesRef();
+ V8_DEPRECATE_SOON("Use GetWasmWireBytesRef version.",
+ Local<String> GetWasmWireBytes());
/**
* Serialize the compiled module. The serialized data does not include the
@@ -4406,18 +4452,18 @@ class V8_EXPORT WasmCompiledModule : public Object {
* uncompiled bytes.
*/
static MaybeLocal<WasmCompiledModule> DeserializeOrCompile(
- Isolate* isolate, const CallerOwnedBuffer& serialized_module,
- const CallerOwnedBuffer& wire_bytes);
+ Isolate* isolate, BufferReference serialized_module,
+ BufferReference wire_bytes);
V8_INLINE static WasmCompiledModule* Cast(Value* obj);
private:
static MaybeLocal<WasmCompiledModule> Deserialize(
- Isolate* isolate, const CallerOwnedBuffer& serialized_module,
- const CallerOwnedBuffer& wire_bytes);
+ Isolate* isolate, BufferReference serialized_module,
+ BufferReference wire_bytes);
static MaybeLocal<WasmCompiledModule> Compile(Isolate* isolate,
const uint8_t* start,
size_t length);
- static CallerOwnedBuffer AsCallerOwned(
+ static BufferReference AsReference(
const TransferrableModule::OwnedBuffer& buff) {
return {buff.first.get(), buff.second};
}
@@ -4426,6 +4472,61 @@ class V8_EXPORT WasmCompiledModule : public Object {
static void CheckCast(Value* obj);
};
+// TODO(clemensh): Remove after M69 branch.
+WasmCompiledModule::BufferReference::BufferReference(
+ WasmCompiledModule::CallerOwnedBuffer buf)
+ : BufferReference(buf.first, buf.second) {}
+WasmCompiledModule::BufferReference::
+operator WasmCompiledModule::CallerOwnedBuffer() {
+ return {start, size};
+}
+
+/**
+ * The V8 interface for WebAssembly streaming compilation. When streaming
+ * compilation is initiated, V8 passes a {WasmStreaming} object to the embedder
+ * such that the embedder can pass the input butes for streaming compilation to
+ * V8.
+ */
+class V8_EXPORT WasmStreaming final {
+ public:
+ class WasmStreamingImpl;
+
+ WasmStreaming(std::unique_ptr<WasmStreamingImpl> impl);
+
+ ~WasmStreaming();
+
+ /**
+ * Pass a new chunck of bytes to WebAssembly streaming compilation.
+ * The buffer passed into {OnBytesReceived} is owned by the caller.
+ */
+ void OnBytesReceived(const uint8_t* bytes, size_t size);
+
+ /**
+ * {Finish} should be called after all received bytes where passed to
+ * {OnBytesReceived} to tell V8 that there will be no more bytes. {Finish}
+ * does not have to be called after {Abort} has been called already.
+ */
+ void Finish();
+
+ /**
+ * Abort streaming compilation. If {exception} has a value, then the promise
+ * associated with streaming compilation is rejected with that value. If
+ * {exception} does not have value, the promise does not get rejected.
+ */
+ void Abort(MaybeLocal<Value> exception);
+
+ /**
+ * Unpacks a {WasmStreaming} object wrapped in a {Managed} for the embedder.
+ * Since the embedder is on the other side of the API, it cannot unpack the
+ * {Managed} itself.
+ */
+ static std::shared_ptr<WasmStreaming> Unpack(Isolate* isolate,
+ Local<Value> value);
+
+ private:
+ std::unique_ptr<WasmStreamingImpl> impl_;
+};
+
// TODO(mtrofin): when streaming compilation is done, we can rename this
// to simply WasmModuleObjectBuilder
class V8_EXPORT WasmModuleObjectBuilderStreaming final {
@@ -5137,7 +5238,9 @@ class V8_EXPORT BooleanObject : public Object {
*/
class V8_EXPORT StringObject : public Object {
public:
- static Local<Value> New(Local<String> value);
+ static Local<Value> New(Isolate* isolate, Local<String> value);
+ static V8_DEPRECATE_SOON("Use Isolate* version",
+ Local<Value> New(Local<String> value));
Local<String> ValueOf() const;
@@ -5892,26 +5995,6 @@ enum class PropertyHandlerFlags {
struct NamedPropertyHandlerConfiguration {
NamedPropertyHandlerConfiguration(
- GenericNamedPropertyGetterCallback getter,
- GenericNamedPropertySetterCallback setter,
- GenericNamedPropertyQueryCallback query,
- GenericNamedPropertyDeleterCallback deleter,
- GenericNamedPropertyEnumeratorCallback enumerator,
- GenericNamedPropertyDefinerCallback definer,
- GenericNamedPropertyDescriptorCallback descriptor,
- Local<Value> data = Local<Value>(),
- PropertyHandlerFlags flags = PropertyHandlerFlags::kNone)
- : getter(getter),
- setter(setter),
- query(query),
- deleter(deleter),
- enumerator(enumerator),
- definer(definer),
- descriptor(descriptor),
- data(data),
- flags(flags) {}
-
- NamedPropertyHandlerConfiguration(
/** Note: getter is required */
GenericNamedPropertyGetterCallback getter = 0,
GenericNamedPropertySetterCallback setter = 0,
@@ -5963,25 +6046,6 @@ struct NamedPropertyHandlerConfiguration {
struct IndexedPropertyHandlerConfiguration {
IndexedPropertyHandlerConfiguration(
- IndexedPropertyGetterCallback getter,
- IndexedPropertySetterCallback setter, IndexedPropertyQueryCallback query,
- IndexedPropertyDeleterCallback deleter,
- IndexedPropertyEnumeratorCallback enumerator,
- IndexedPropertyDefinerCallback definer,
- IndexedPropertyDescriptorCallback descriptor,
- Local<Value> data = Local<Value>(),
- PropertyHandlerFlags flags = PropertyHandlerFlags::kNone)
- : getter(getter),
- setter(setter),
- query(query),
- deleter(deleter),
- enumerator(enumerator),
- definer(definer),
- descriptor(descriptor),
- data(data),
- flags(flags) {}
-
- IndexedPropertyHandlerConfiguration(
/** Note: getter is required */
IndexedPropertyGetterCallback getter = 0,
IndexedPropertySetterCallback setter = 0,
@@ -6298,7 +6362,8 @@ class V8_EXPORT AccessorSignature : public Data {
// --- Extensions ---
-
+V8_DEPRECATE_SOON("Implementation detail",
+ class ExternalOneByteStringResourceImpl);
class V8_EXPORT ExternalOneByteStringResourceImpl
: public String::ExternalOneByteStringResource {
public:
@@ -6325,7 +6390,7 @@ class V8_EXPORT Extension { // NOLINT
int dep_count = 0,
const char** deps = 0,
int source_length = -1);
- virtual ~Extension() { }
+ virtual ~Extension() { delete source_; }
virtual Local<FunctionTemplate> GetNativeFunctionTemplate(
Isolate* isolate, Local<String> name) {
return Local<FunctionTemplate>();
@@ -6334,7 +6399,8 @@ class V8_EXPORT Extension { // NOLINT
const char* name() const { return name_; }
size_t source_length() const { return source_length_; }
const String::ExternalOneByteStringResource* source() const {
- return &source_; }
+ return source_;
+ }
int dependency_count() { return dep_count_; }
const char** dependencies() { return deps_; }
void set_auto_enable(bool value) { auto_enable_ = value; }
@@ -6347,7 +6413,7 @@ class V8_EXPORT Extension { // NOLINT
private:
const char* name_;
size_t source_length_; // expected to initialize before source_
- ExternalOneByteStringResourceImpl source_;
+ String::ExternalOneByteStringResource* source_;
int dep_count_;
const char** deps_;
bool auto_enable_;
@@ -6679,6 +6745,9 @@ typedef bool (*AllowWasmCodeGenerationCallback)(Local<Context> context,
// by the embedder. Example: WebAssembly.{compile|instantiate}Streaming ---
typedef void (*ApiImplementationCallback)(const FunctionCallbackInfo<Value>&);
+// --- Callback for WebAssembly.compileStreaming ---
+typedef void (*WasmStreamingCallback)(const FunctionCallbackInfo<Value>&);
+
// --- Garbage Collection Callbacks ---
/**
@@ -6919,6 +6988,8 @@ struct JitCodeEvent {
// New location of instructions. Only valid for CODE_MOVED.
void* new_code_start;
};
+
+ Isolate* isolate;
};
/**
@@ -7040,6 +7111,12 @@ class V8_EXPORT EmbedderHeapTracer {
virtual bool AdvanceTracing(double deadline_in_ms,
AdvanceTracingActions actions) = 0;
+ /*
+ * Returns true if there no more tracing work to be done (see AdvanceTracing)
+ * and false otherwise.
+ */
+ virtual bool IsTracingDone() { return NumberOfWrappersToTrace() == 0; }
+
/**
* Called at the end of a GC cycle.
*
@@ -7061,13 +7138,35 @@ class V8_EXPORT EmbedderHeapTracer {
*/
virtual void AbortTracing() = 0;
+ /*
+ * Called by the embedder to request immediaet finalization of the currently
+ * running tracing phase that has been started with TracePrologue and not
+ * yet finished with TraceEpilogue.
+ *
+ * Will be a noop when currently not in tracing.
+ *
+ * This is an experimental feature.
+ */
+ void FinalizeTracing();
+
+ /*
+ * Returns the v8::Isolate this tracer is attached too and |nullptr| if it
+ * is not attached to any v8::Isolate.
+ */
+ v8::Isolate* isolate() const { return isolate_; }
+
/**
* Returns the number of wrappers that are still to be traced by the embedder.
*/
- virtual size_t NumberOfWrappersToTrace() { return 0; }
+ V8_DEPRECATE_SOON("Use IsTracingDone",
+ virtual size_t NumberOfWrappersToTrace() { return 0; });
protected:
virtual ~EmbedderHeapTracer() = default;
+
+ v8::Isolate* isolate_ = nullptr;
+
+ friend class internal::LocalEmbedderHeapTracer;
};
/**
@@ -7361,6 +7460,7 @@ class V8_EXPORT Isolate {
kWebAssemblyInstantiation = 46,
kDeoptimizerDisableSpeculation = 47,
kArrayPrototypeSortJSArrayModifiedPrototype = 48,
+ kFunctionTokenOffsetTooLongForToString = 49,
// If you add new values here, you'll also need to update Chromium's:
// web_feature.mojom, UseCounterCallback.cpp, and enums.xml. V8 changes to
@@ -7616,15 +7716,7 @@ class V8_EXPORT Isolate {
HeapProfiler* GetHeapProfiler();
/**
- * Returns CPU profiler for this isolate. Will return NULL unless the isolate
- * is initialized. It is the embedder's responsibility to stop all CPU
- * profiling activities if it has started any.
- */
- V8_DEPRECATED("CpuProfiler should be created with CpuProfiler::New call.",
- CpuProfiler* GetCpuProfiler());
-
- /**
- * Tells the CPU profiler whether the embedder is idle.
+ * Tells the VM whether the embedder is idle or not.
*/
void SetIdle(bool is_idle);
@@ -7704,6 +7796,85 @@ class V8_EXPORT Isolate {
void SetEmbedderHeapTracer(EmbedderHeapTracer* tracer);
/**
+ * Use for |AtomicsWaitCallback| to indicate the type of event it receives.
+ */
+ enum class AtomicsWaitEvent {
+ /** Indicates that this call is happening before waiting. */
+ kStartWait,
+ /** `Atomics.wait()` finished because of an `Atomics.wake()` call. */
+ kWokenUp,
+ /** `Atomics.wait()` finished because it timed out. */
+ kTimedOut,
+ /** `Atomics.wait()` was interrupted through |TerminateExecution()|. */
+ kTerminatedExecution,
+ /** `Atomics.wait()` was stopped through |AtomicsWaitWakeHandle|. */
+ kAPIStopped,
+ /** `Atomics.wait()` did not wait, as the initial condition was not met. */
+ kNotEqual
+ };
+
+ /**
+ * Passed to |AtomicsWaitCallback| as a means of stopping an ongoing
+ * `Atomics.wait` call.
+ */
+ class V8_EXPORT AtomicsWaitWakeHandle {
+ public:
+ /**
+ * Stop this `Atomics.wait()` call and call the |AtomicsWaitCallback|
+ * with |kAPIStopped|.
+ *
+ * This function may be called from another thread. The caller has to ensure
+ * through proper synchronization that it is not called after
+ * the finishing |AtomicsWaitCallback|.
+ *
+ * Note that the ECMAScript specification does not plan for the possibility
+ * of wakeups that are neither coming from a timeout or an `Atomics.wake()`
+ * call, so this may invalidate assumptions made by existing code.
+ * The embedder may accordingly wish to schedule an exception in the
+ * finishing |AtomicsWaitCallback|.
+ */
+ void Wake();
+ };
+
+ /**
+ * Embedder callback for `Atomics.wait()` that can be added through
+ * |SetAtomicsWaitCallback|.
+ *
+ * This will be called just before starting to wait with the |event| value
+ * |kStartWait| and after finishing waiting with one of the other
+ * values of |AtomicsWaitEvent| inside of an `Atomics.wait()` call.
+ *
+ * |array_buffer| will refer to the underlying SharedArrayBuffer,
+ * |offset_in_bytes| to the location of the waited-on memory address inside
+ * the SharedArrayBuffer.
+ *
+ * |value| and |timeout_in_ms| will be the values passed to
+ * the `Atomics.wait()` call. If no timeout was used, |timeout_in_ms|
+ * will be `INFINITY`.
+ *
+ * In the |kStartWait| callback, |stop_handle| will be an object that
+ * is only valid until the corresponding finishing callback and that
+ * can be used to stop the wait process while it is happening.
+ *
+ * This callback may schedule exceptions, *unless* |event| is equal to
+ * |kTerminatedExecution|.
+ */
+ typedef void (*AtomicsWaitCallback)(AtomicsWaitEvent event,
+ Local<SharedArrayBuffer> array_buffer,
+ size_t offset_in_bytes, int32_t value,
+ double timeout_in_ms,
+ AtomicsWaitWakeHandle* stop_handle,
+ void* data);
+
+ /**
+ * Set a new |AtomicsWaitCallback|. This overrides an earlier
+ * |AtomicsWaitCallback|, if there was any. If |callback| is nullptr,
+ * this unsets the callback. |data| will be passed to the callback
+ * as its last parameter.
+ */
+ void SetAtomicsWaitCallback(AtomicsWaitCallback callback, void* data);
+
+ /**
* Enables the host application to receive a notification after a
* garbage collection. Allocations are allowed in the callback function,
* but the callback is not re-entrant: if the allocation inside it will
@@ -7957,6 +8128,18 @@ class V8_EXPORT Isolate {
void IsolateInBackgroundNotification();
/**
+ * Optional notification which will enable the memory savings mode.
+ * V8 uses this notification to guide heuristics which may result in a
+ * smaller memory footprint at the cost of reduced runtime performance.
+ */
+ void EnableMemorySavingsMode();
+
+ /**
+ * Optional notification which will disable the memory savings mode.
+ */
+ void DisableMemorySavingsMode();
+
+ /**
* Optional notification to tell V8 the current performance requirements
* of the embedder based on RAIL.
* V8 uses these notifications to guide heuristics.
@@ -8079,6 +8262,8 @@ class V8_EXPORT Isolate {
void SetWasmCompileStreamingCallback(ApiImplementationCallback callback);
+ void SetWasmStreamingCallback(WasmStreamingCallback callback);
+
/**
* Check if V8 is dead and therefore unusable. This is the case after
* fatal errors such as out-of-memory situations.
@@ -9927,7 +10112,6 @@ AccessorSignature* AccessorSignature::Cast(Data* data) {
Local<Value> Object::GetInternalField(int index) {
#ifndef V8_ENABLE_CHECKS
typedef internal::Object O;
- typedef internal::HeapObject HO;
typedef internal::Internals I;
O* obj = *reinterpret_cast<O**>(this);
// Fast path: If the object is a plain JSObject, which is the common case, we
@@ -9938,7 +10122,8 @@ Local<Value> Object::GetInternalField(int index) {
instance_type == I::kJSSpecialApiObjectType) {
int offset = I::kJSObjectHeaderSize + (internal::kApiPointerSize * index);
O* value = I::ReadField<O*>(obj, offset);
- O** result = HandleScope::CreateHandle(reinterpret_cast<HO*>(obj), value);
+ O** result = HandleScope::CreateHandle(
+ reinterpret_cast<internal::NeverReadOnlySpaceObject*>(obj), value);
return Local<Value>(reinterpret_cast<Value*>(result));
}
#endif
@@ -10578,9 +10763,8 @@ int64_t Isolate::AdjustAmountOfExternalAllocatedMemory(
Local<Value> Context::GetEmbedderData(int index) {
#ifndef V8_ENABLE_CHECKS
typedef internal::Object O;
- typedef internal::HeapObject HO;
typedef internal::Internals I;
- HO* context = *reinterpret_cast<HO**>(this);
+ auto* context = *reinterpret_cast<internal::NeverReadOnlySpaceObject**>(this);
O** result =
HandleScope::CreateHandle(context, I::ReadEmbedderData<O*>(this, index));
return Local<Value>(reinterpret_cast<Value*>(result));