Skip to content

Commit

Permalink
Update missing include headers
Browse files Browse the repository at this point in the history
  • Loading branch information
rogchap committed Sep 22, 2019
1 parent 397f199 commit a5ee959
Show file tree
Hide file tree
Showing 6 changed files with 174 additions and 47 deletions.
11 changes: 7 additions & 4 deletions deps/include/libplatform/v8-tracing.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
#include "libplatform/libplatform-export.h"
#include "v8-platform.h" // NOLINT(build/include)

namespace perfetto {
class TracingSession;
}

namespace v8 {

namespace base {
Expand All @@ -23,8 +27,8 @@ class Mutex;
namespace platform {
namespace tracing {

class PerfettoTracingController;
class TraceEventListener;
class JSONTraceEventListener;

const int kTraceMaxNumArgs = 2;

Expand Down Expand Up @@ -292,11 +296,10 @@ class V8_PLATFORM_EXPORT TracingController
std::unordered_set<v8::TracingController::TraceStateObserver*> observers_;
std::atomic_bool recording_{false};
#ifdef V8_USE_PERFETTO
std::atomic_bool perfetto_recording_{false};
std::unique_ptr<PerfettoTracingController> perfetto_tracing_controller_;
std::ostream* output_stream_ = nullptr;
std::unique_ptr<TraceEventListener> json_listener_;
std::unique_ptr<JSONTraceEventListener> json_listener_;
TraceEventListener* listener_for_testing_ = nullptr;
std::unique_ptr<perfetto::TracingSession> tracing_session_;
#endif

// Disallow copy and assign
Expand Down
6 changes: 2 additions & 4 deletions deps/include/v8-inspector.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ class V8_EXPORT V8StackTrace {
virtual ~V8StackTrace() = default;
virtual std::unique_ptr<protocol::Runtime::API::StackTrace>
buildInspectorObject() const = 0;
virtual std::unique_ptr<protocol::Runtime::API::StackTrace>
buildInspectorObject(int maxAsyncDepth) const = 0;
virtual std::unique_ptr<StringBuffer> toString() const = 0;

// Safe to pass between threads, drops async chain.
Expand All @@ -130,10 +132,6 @@ class V8_EXPORT V8InspectorSession {
// Dispatching protocol messages.
static bool canDispatchMethod(const StringView& method);
virtual void dispatchProtocolMessage(const StringView& message) = 0;
virtual V8_DEPRECATED("Use state() instead",
std::unique_ptr<StringBuffer> stateJSON()) {
return nullptr;
}
virtual std::vector<uint8_t> state() = 0;
virtual std::vector<std::unique_ptr<protocol::Schema::API::Domain>>
supportedDomains() = 0;
Expand Down
8 changes: 8 additions & 0 deletions deps/include/v8-platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,14 @@ class Platform {
*/
virtual void DumpWithoutCrashing() {}

/**
* Lets the embedder to add crash keys.
*/
virtual void AddCrashKey(int id, const char* name, uintptr_t value) {
// "noop" is a valid implementation if the embedder doesn't care to log
// additional data for crashes.
}

protected:
/**
* Default implementation of current wall-clock time in milliseconds
Expand Down
6 changes: 3 additions & 3 deletions deps/include/v8-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 7
#define V8_MINOR_VERSION 6
#define V8_BUILD_NUMBER 303
#define V8_PATCH_LEVEL 0
#define V8_MINOR_VERSION 7
#define V8_BUILD_NUMBER 299
#define V8_PATCH_LEVEL 9

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
Expand Down
184 changes: 148 additions & 36 deletions deps/include/v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -1326,6 +1326,37 @@ class V8_EXPORT Module {
* kEvaluated or kErrored.
*/
Local<UnboundModuleScript> GetUnboundModuleScript();

/*
* Callback defined in the embedder. This is responsible for setting
* the module's exported values with calls to SetSyntheticModuleExport().
* The callback must return a Value to indicate success (where no
* exception was thrown) and return an empy MaybeLocal to indicate falure
* (where an exception was thrown).
*/
typedef MaybeLocal<Value> (*SyntheticModuleEvaluationSteps)(
Local<Context> context, Local<Module> module);

/**
* Creates a new SyntheticModule with the specified export names, where
* evaluation_steps will be executed upon module evaluation.
* export_names must not contain duplicates.
* module_name is used solely for logging/debugging and doesn't affect module
* behavior.
*/
static Local<Module> CreateSyntheticModule(
Isolate* isolate, Local<String> module_name,
const std::vector<Local<String>>& export_names,
SyntheticModuleEvaluationSteps evaluation_steps);

/**
* Set this module's exported value for the name export_name to the specified
* export_value. This method must be called only on Modules created via
* CreateSyntheticModule. export_name must be one of the export_names that
* were passed in that CreateSyntheticModule call.
*/
void SetSyntheticModuleExport(Local<String> export_name,
Local<Value> export_value);
};

/**
Expand Down Expand Up @@ -1668,7 +1699,8 @@ class V8_EXPORT ScriptCompiler {
Local<String> arguments[], size_t context_extension_count,
Local<Object> context_extensions[],
CompileOptions options = kNoCompileOptions,
NoCacheReason no_cache_reason = kNoCacheNoReason);
NoCacheReason no_cache_reason = kNoCacheNoReason,
Local<ScriptOrModule>* script_or_module_out = nullptr);

/**
* Creates and returns code cache for the specified unbound_script.
Expand Down Expand Up @@ -3288,17 +3320,13 @@ enum class IntegrityLevel { kFrozen, kSealed };
*/
class V8_EXPORT Object : public Value {
public:
V8_DEPRECATED("Use maybe version",
bool Set(Local<Value> key, Local<Value> value));
/**
* Set only return Just(true) or Empty(), so if it should never fail, use
* result.Check().
*/
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
Local<Value> key, Local<Value> value);

V8_DEPRECATED("Use maybe version",
bool Set(uint32_t index, Local<Value> value));
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
Local<Value> value);

Expand Down Expand Up @@ -3340,13 +3368,12 @@ class V8_EXPORT Object : public Value {
//
// Returns true on success.
V8_WARN_UNUSED_RESULT Maybe<bool> DefineProperty(
Local<Context> context, Local<Name> key, PropertyDescriptor& descriptor);
Local<Context> context, Local<Name> key,
PropertyDescriptor& descriptor); // NOLINT(runtime/references)

V8_DEPRECATED("Use maybe version", Local<Value> Get(Local<Value> key));
V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
Local<Value> key);

V8_DEPRECATED("Use maybe version", Local<Value> Get(uint32_t index));
V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
uint32_t index);

Expand Down Expand Up @@ -5319,6 +5346,8 @@ class V8_EXPORT RegExp : public Object {
kDotAll = 1 << 5,
};

static constexpr int kFlagCount = 6;

/**
* Creates a regular expression from the given pattern string and
* the flags bit field. May throw a JavaScript exception as
Expand Down Expand Up @@ -6405,7 +6434,19 @@ V8_INLINE Local<Boolean> False(Isolate* isolate);
*/
class V8_EXPORT ResourceConstraints {
public:
ResourceConstraints();
/**
* Configures the constraints with reasonable default values based on the
* provided heap size limit. The heap size includes both the young and
* the old generation.
*
* \param maximum_heap_size_in_bytes The hard limit for the heap size.
* When the heap size approaches this limit, V8 will perform series of
* garbage collections and invoke the NearHeapLimitCallback.
* If the garbage collections do not help and the callback does not
* increase the limit, then V8 will crash with V8::FatalProcessOutOfMemory.
*/
void ConfigureDefaultsFromHeapSize(size_t initial_heap_size_in_bytes,
size_t maximum_heap_size_in_bytes);

/**
* Configures the constraints with reasonable default values based on the
Expand All @@ -6419,26 +6460,81 @@ class V8_EXPORT ResourceConstraints {
void ConfigureDefaults(uint64_t physical_memory,
uint64_t virtual_memory_limit);

// Returns the max semi-space size in KB.
size_t max_semi_space_size_in_kb() const {
return max_semi_space_size_in_kb_;
/**
* The address beyond which the VM's stack may not grow.
*/
uint32_t* stack_limit() const { return stack_limit_; }
void set_stack_limit(uint32_t* value) { stack_limit_ = value; }

/**
* The amount of virtual memory reserved for generated code. This is relevant
* for 64-bit architectures that rely on code range for calls in code.
*/
size_t code_range_size_in_bytes() const { return code_range_size_; }
void set_code_range_size_in_bytes(size_t limit) { code_range_size_ = limit; }

/**
* The maximum size of the old generation.
* When the old generation approaches this limit, V8 will perform series of
* garbage collections and invoke the NearHeapLimitCallback.
* If the garbage collections do not help and the callback does not
* increase the limit, then V8 will crash with V8::FatalProcessOutOfMemory.
*/
size_t max_old_generation_size_in_bytes() const {
return max_old_generation_size_;
}
void set_max_old_generation_size_in_bytes(size_t limit) {
max_old_generation_size_ = limit;
}

// Sets the max semi-space size in KB.
void set_max_semi_space_size_in_kb(size_t limit_in_kb) {
max_semi_space_size_in_kb_ = limit_in_kb;
/**
* The maximum size of the young generation, which consists of two semi-spaces
* and a large object space. This affects frequency of Scavenge garbage
* collections and should be typically much smaller that the old generation.
*/
size_t max_young_generation_size_in_bytes() const {
return max_young_generation_size_;
}
void set_max_young_generation_size_in_bytes(size_t limit) {
max_young_generation_size_ = limit;
}

size_t max_old_space_size() const { return max_old_space_size_; }
void set_max_old_space_size(size_t limit_in_mb) {
max_old_space_size_ = limit_in_mb;
size_t initial_old_generation_size_in_bytes() const {
return initial_old_generation_size_;
}
uint32_t* stack_limit() const { return stack_limit_; }
// Sets an address beyond which the VM's stack may not grow.
void set_stack_limit(uint32_t* value) { stack_limit_ = value; }
size_t code_range_size() const { return code_range_size_; }
void set_code_range_size(size_t limit_in_mb) {
code_range_size_ = limit_in_mb;
void set_initial_old_generation_size_in_bytes(size_t initial_size) {
initial_old_generation_size_ = initial_size;
}

size_t initial_young_generation_size_in_bytes() const {
return initial_young_generation_size_;
}
void set_initial_young_generation_size_in_bytes(size_t initial_size) {
initial_young_generation_size_ = initial_size;
}

/**
* Deprecated functions. Do not use in new code.
*/
V8_DEPRECATE_SOON("Use code_range_size_in_bytes.",
size_t code_range_size() const) {
return code_range_size_ / kMB;
}
V8_DEPRECATE_SOON("Use set_code_range_size_in_bytes.",
void set_code_range_size(size_t limit_in_mb)) {
code_range_size_ = limit_in_mb * kMB;
}
V8_DEPRECATE_SOON("Use max_young_generation_size_in_bytes.",
size_t max_semi_space_size_in_kb() const);
V8_DEPRECATE_SOON("Use set_max_young_generation_size_in_bytes.",
void set_max_semi_space_size_in_kb(size_t limit_in_kb));
V8_DEPRECATE_SOON("Use max_old_generation_size_in_bytes.",
size_t max_old_space_size() const) {
return max_old_generation_size_ / kMB;
}
V8_DEPRECATE_SOON("Use set_max_old_generation_size_in_bytes.",
void set_max_old_space_size(size_t limit_in_mb)) {
max_old_generation_size_ = limit_in_mb * kMB;
}
V8_DEPRECATE_SOON("Zone does not pool memory any more.",
size_t max_zone_pool_size() const) {
Expand All @@ -6450,14 +6546,14 @@ class V8_EXPORT ResourceConstraints {
}

private:
// max_semi_space_size_ is in KB
size_t max_semi_space_size_in_kb_;

// The remaining limits are in MB
size_t max_old_space_size_;
uint32_t* stack_limit_;
size_t code_range_size_;
size_t max_zone_pool_size_;
static constexpr size_t kMB = 1048576u;
size_t code_range_size_ = 0;
size_t max_old_generation_size_ = 0;
size_t max_young_generation_size_ = 0;
size_t max_zone_pool_size_ = 0;
size_t initial_old_generation_size_ = 0;
size_t initial_young_generation_size_ = 0;
uint32_t* stack_limit_ = nullptr;
};


Expand Down Expand Up @@ -6770,6 +6866,8 @@ typedef void (*FailedAccessCheckCallback)(Local<Object> target,
*/
typedef bool (*AllowCodeGenerationFromStringsCallback)(Local<Context> context,
Local<String> source);
typedef MaybeLocal<String> (*ModifyCodeGenerationFromStringsCallback)(
Local<Context> context, Local<Value> source);

// --- WebAssembly compilation callbacks ---
typedef bool (*ExtensionCallback)(const FunctionCallbackInfo<Value>&);
Expand Down Expand Up @@ -7230,12 +7328,13 @@ class V8_EXPORT EmbedderHeapTracer {
void GarbageCollectionForTesting(EmbedderStackState stack_state);

/*
* Called by the embedder to signal newly allocated memory. Not bound to
* tracing phases. Embedders should trade off when increments are reported as
* V8 may consult global heuristics on whether to trigger garbage collection
* on this change.
* Called by the embedder to signal newly allocated or freed memory. Not bound
* to tracing phases. Embedders should trade off when increments are reported
* as V8 may consult global heuristics on whether to trigger garbage
* collection on this change.
*/
void IncreaseAllocatedSize(size_t bytes);
void DecreaseAllocatedSize(size_t bytes);

/*
* Returns the v8::Isolate this tracer is attached too and |nullptr| if it
Expand Down Expand Up @@ -7563,6 +7662,8 @@ class V8_EXPORT Isolate {
kRegExpMatchIsFalseishOnJSRegExp = 73,
kDateGetTimezoneOffset = 74,
kStringNormalize = 75,
kCallSiteAPIGetFunctionSloppyCall = 76,
kCallSiteAPIGetThisSloppyCall = 77,

// 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
Expand Down Expand Up @@ -8367,6 +8468,8 @@ class V8_EXPORT Isolate {
*/
void SetAllowCodeGenerationFromStringsCallback(
AllowCodeGenerationFromStringsCallback callback);
void SetModifyCodeGenerationFromStringsCallback(
ModifyCodeGenerationFromStringsCallback callback);

/**
* Set the callback to invoke to check if wasm code generation should
Expand Down Expand Up @@ -9401,6 +9504,15 @@ class V8_EXPORT Context {
template <class T>
V8_INLINE MaybeLocal<T> GetDataFromSnapshotOnce(size_t index);

/**
* If callback is set, abort any attempt to execute JavaScript in this
* context, call the specified callback, and throw an exception.
* To unset abort, pass nullptr as callback.
*/
typedef void (*AbortScriptExecutionCallback)(Isolate* isolate,
Local<Context> context);
void SetAbortScriptExecution(AbortScriptExecutionCallback callback);

/**
* Stack-allocated class which sets the execution context for all
* operations executed within a local scope.
Expand Down
6 changes: 6 additions & 0 deletions deps/include/v8config.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,12 @@
#define V8_WARN_UNUSED_RESULT /* NOT SUPPORTED */
#endif

#if defined(BUILDING_V8_SHARED) && defined(USING_V8_SHARED)
#error Inconsistent build configuration: To build the V8 shared library \
set BUILDING_V8_SHARED, to include its headers for linking against the \
V8 shared library set USING_V8_SHARED.
#endif

#ifdef V8_OS_WIN

// Setup for Windows DLL export/import. When building the V8 DLL the
Expand Down

0 comments on commit a5ee959

Please sign in to comment.