Skip to content

Commit

Permalink
deps: V8: update headers for ABI compatibility
Browse files Browse the repository at this point in the history
Remove new functionality that interferes with ABI compatibility.

PR-URL: #34356
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
  • Loading branch information
addaleax authored and MylesBorins committed Jul 16, 2020
1 parent 2c9fd6e commit 95afc2e
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 22 deletions.
10 changes: 6 additions & 4 deletions deps/v8/include/v8-platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -519,10 +519,12 @@ class Platform {
* this, std::move(job_task), kNumThreads));
* }
*/
virtual std::unique_ptr<JobHandle> PostJob(
TaskPriority priority, std::unique_ptr<JobTask> job_task) {
return nullptr;
}
/* This is not available on Node v14.x.
* virtual std::unique_ptr<JobHandle> PostJob(
* TaskPriority priority, std::unique_ptr<JobTask> job_task) {
* return nullptr;
* }
*/

/**
* Monotonically increasing time in seconds from an arbitrary fixed point in
Expand Down
5 changes: 3 additions & 2 deletions deps/v8/include/v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -4768,7 +4768,9 @@ class V8_EXPORT CompiledWasmModule {
*/
MemorySpan<const uint8_t> GetWireBytesRef();

const std::string& source_url() const { return source_url_; }
/* This is not available on Node v14.x.
* const std::string& source_url() const { return source_url_; }
*/

private:
friend class WasmModuleObject;
Expand All @@ -4778,7 +4780,6 @@ class V8_EXPORT CompiledWasmModule {
const char* source_url, size_t url_length);

const std::shared_ptr<internal::wasm::NativeModule> native_module_;
const std::string source_url_;
};

// An instance of WebAssembly.Module.
Expand Down
5 changes: 2 additions & 3 deletions deps/v8/src/api/api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7168,8 +7168,7 @@ MaybeLocal<Proxy> Proxy::New(Local<Context> context, Local<Object> local_target,
CompiledWasmModule::CompiledWasmModule(
std::shared_ptr<internal::wasm::NativeModule> native_module,
const char* source_url, size_t url_length)
: native_module_(std::move(native_module)),
source_url_(source_url, url_length) {
: native_module_(std::move(native_module)) {
CHECK_NOT_NULL(native_module_);
}

Expand Down Expand Up @@ -7205,7 +7204,7 @@ MaybeLocal<WasmModuleObject> WasmModuleObject::FromCompiledModule(
i::Handle<i::WasmModuleObject> module_object =
i_isolate->wasm_engine()->ImportNativeModule(
i_isolate, compiled_module.native_module_,
i::VectorOf(compiled_module.source_url()));
{});
return Local<WasmModuleObject>::Cast(
Utils::ToLocal(i::Handle<i::JSObject>::cast(module_object)));
}
Expand Down
4 changes: 2 additions & 2 deletions deps/v8/src/libplatform/default-platform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ bool DefaultPlatform::IdleTasksEnabled(Isolate* isolate) {
return idle_task_support_ == IdleTaskSupport::kEnabled;
}

std::unique_ptr<JobHandle> DefaultPlatform::PostJob(
/*std::unique_ptr<JobHandle> DefaultPlatform::PostJob(
TaskPriority priority, std::unique_ptr<JobTask> job_task) {
size_t num_worker_threads = 0;
switch (priority) {
Expand All @@ -216,7 +216,7 @@ std::unique_ptr<JobHandle> DefaultPlatform::PostJob(
}
return std::make_unique<DefaultJobHandle>(std::make_shared<DefaultJobState>(
this, std::move(job_task), priority, num_worker_threads));
}
}*/

double DefaultPlatform::MonotonicallyIncreasingTime() {
if (time_function_for_testing_) return time_function_for_testing_();
Expand Down
4 changes: 2 additions & 2 deletions deps/v8/src/libplatform/default-platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ class V8_PLATFORM_EXPORT DefaultPlatform : public NON_EXPORTED_BASE(Platform) {
void CallDelayedOnWorkerThread(std::unique_ptr<Task> task,
double delay_in_seconds) override;
bool IdleTasksEnabled(Isolate* isolate) override;
std::unique_ptr<JobHandle> PostJob(
TaskPriority priority, std::unique_ptr<JobTask> job_state) override;
/*std::unique_ptr<JobHandle> PostJob(
TaskPriority priority, std::unique_ptr<JobTask> job_state) override;*/
double MonotonicallyIncreasingTime() override;
double CurrentClockTimeMillis() override;
v8::TracingController* GetTracingController() override;
Expand Down
10 changes: 5 additions & 5 deletions deps/v8/test/cctest/cctest.h
Original file line number Diff line number Diff line change
Expand Up @@ -704,11 +704,11 @@ class TestPlatform : public v8::Platform {
old_platform_->CallDelayedOnWorkerThread(std::move(task), delay_in_seconds);
}

std::unique_ptr<v8::JobHandle> PostJob(
v8::TaskPriority priority,
std::unique_ptr<v8::JobTask> job_task) override {
return old_platform_->PostJob(priority, std::move(job_task));
}
// std::unique_ptr<v8::JobHandle> PostJob(
// v8::TaskPriority priority,
// std::unique_ptr<v8::JobTask> job_task) override {
// return old_platform_->PostJob(priority, std::move(job_task));
// }

double MonotonicallyIncreasingTime() override {
return old_platform_->MonotonicallyIncreasingTime();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ class MockPlatform : public v8::Platform {

bool IdleTasksEnabled(v8::Isolate* isolate) override { return true; }

std::unique_ptr<JobHandle> PostJob(
TaskPriority priority, std::unique_ptr<JobTask> job_state) override {
UNREACHABLE();
}
// std::unique_ptr<JobHandle> PostJob(
// TaskPriority priority, std::unique_ptr<JobTask> job_state) override {
// UNREACHABLE();
// }

double MonotonicallyIncreasingTime() override {
time_ += time_step_;
Expand Down

0 comments on commit 95afc2e

Please sign in to comment.