-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide a stub `third_party_heap::Heap` implementation to work around linker erors with Visual Studio. Refs: #10
- Loading branch information
1 parent
a971abe
commit fe73b9b
Showing
2 changed files
with
121 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
From 3412c509ea1cda47fc598f28ebecd3cec3a9cce6 Mon Sep 17 00:00:00 2001 | ||
From: Ben Noordhuis <[email protected]> | ||
Date: Tue, 21 Apr 2020 18:15:06 +0200 | ||
Subject: [PATCH] Patch v8/src/heap/third-party | ||
|
||
Provide a stub `third_party_heap::Heap` implementation to work around | ||
linker erors with Visual Studio. | ||
|
||
Refs: https://github.com/bnoordhuis/v8-cmake/issues/10 | ||
--- | ||
v8/src/heap/third-party/heap-api-stub.cc | 49 ++++++++++++++++++++++++ | ||
1 file changed, 49 insertions(+) | ||
create mode 100644 v8/src/heap/third-party/heap-api-stub.cc | ||
|
||
diff --git a/v8/src/heap/third-party/heap-api-stub.cc b/v8/src/heap/third-party/heap-api-stub.cc | ||
new file mode 100644 | ||
index 00000000..ff3c09f6 | ||
--- /dev/null | ||
+++ b/v8/src/heap/third-party/heap-api-stub.cc | ||
@@ -0,0 +1,49 @@ | ||
+// Copyright 2020 the V8 project authors. All rights reserved. | ||
+// Use of this source code is governed by a BSD-style license that can be | ||
+// found in the LICENSE file. | ||
+ | ||
+#include "src/heap/third-party/heap-api.h" | ||
+#include "src/execution/isolate-utils-inl.h" | ||
+#include "src/heap/heap-inl.h" | ||
+ | ||
+// Work around Visual Studio linker errors when V8_ENABLE_THIRD_PARTY_HEAP | ||
+// is disabled. | ||
+#ifndef V8_ENABLE_THIRD_PARTY_HEAP | ||
+ | ||
+namespace v8 { | ||
+namespace internal { | ||
+ | ||
+Isolate* Heap::GetIsolateFromWritableObject(HeapObject object) { | ||
+ return GetHeapFromWritableObject(object)->isolate(); | ||
+} | ||
+ | ||
+} // namespace internal | ||
+} // namespace v8 | ||
+ | ||
+namespace v8 { | ||
+namespace internal { | ||
+namespace third_party_heap { | ||
+ | ||
+// static | ||
+std::unique_ptr<Heap> Heap::New(v8::Isolate*) { return nullptr; } | ||
+ | ||
+// static | ||
+v8::Isolate* Heap::GetIsolate(Address) { return nullptr; } | ||
+ | ||
+AllocationResult Heap::Allocate(size_t) { | ||
+ return AllocationResult(); | ||
+} | ||
+ | ||
+AllocationResult Heap::AllocateCode(size_t) { | ||
+ return AllocationResult(); | ||
+} | ||
+ | ||
+Address Heap::GetObjectFromInnerPointer(Address) { return 0; } | ||
+ | ||
+void Heap::CollectGarbage() {} | ||
+ | ||
+} // namespace third_party_heap | ||
+} // namespace internal | ||
+} // namespace v8 | ||
+ | ||
+#endif // !defined(V8_ENABLE_THIRD_PARTY_HEAP) | ||
-- | ||
2.20.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Copyright 2020 the V8 project authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "src/heap/third-party/heap-api.h" | ||
#include "src/execution/isolate-utils-inl.h" | ||
#include "src/heap/heap-inl.h" | ||
|
||
// Work around Visual Studio linker errors when V8_ENABLE_THIRD_PARTY_HEAP | ||
// is disabled. | ||
#ifndef V8_ENABLE_THIRD_PARTY_HEAP | ||
|
||
namespace v8 { | ||
namespace internal { | ||
|
||
Isolate* Heap::GetIsolateFromWritableObject(HeapObject object) { | ||
return GetHeapFromWritableObject(object)->isolate(); | ||
} | ||
|
||
} // namespace internal | ||
} // namespace v8 | ||
|
||
namespace v8 { | ||
namespace internal { | ||
namespace third_party_heap { | ||
|
||
// static | ||
std::unique_ptr<Heap> Heap::New(v8::Isolate*) { return nullptr; } | ||
|
||
// static | ||
v8::Isolate* Heap::GetIsolate(Address) { return nullptr; } | ||
|
||
AllocationResult Heap::Allocate(size_t) { | ||
return AllocationResult(); | ||
} | ||
|
||
AllocationResult Heap::AllocateCode(size_t) { | ||
return AllocationResult(); | ||
} | ||
|
||
Address Heap::GetObjectFromInnerPointer(Address) { return 0; } | ||
|
||
void Heap::CollectGarbage() {} | ||
|
||
} // namespace third_party_heap | ||
} // namespace internal | ||
} // namespace v8 | ||
|
||
#endif // !defined(V8_ENABLE_THIRD_PARTY_HEAP) |