Skip to content

Commit 758b730

Browse files
addaleaxgibfahn
authored andcommitted
deps: revert ABI breaking changes in V8 6.2
Below is the list of changes: [ABI] deps: move new PARSER value to end of enum [ABI] deps: revert 749b9c062ea from upstream V8 Original commit message: Remove deprecated allow code-gen callback BUG=chromium:732736 R=marja@chromium.org Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng Change-Id: I2c0a96b76ae977e53a418d22175bcc487f548786 Reviewed-on: https://chromium-review.googlesource.com/543238 Reviewed-by: Marja Hölttä <marja@chromium.org> Commit-Queue: Jochen Eisinger <jochen@chromium.org> Cr-Commit-Position: refs/heads/master@{#47509} [ABI] deps: reorder InstanceType enum for ABI compat [ABI] deps: restore HeapProfiler::GetProfilerMemorySize() Reimplemented as a method returning 0. [ABI] deps: partially revert a5f321cd9bf Remove default arguments from `Context::SetDefaultContext()` and `Context::New()`. Refs: v8/v8@a5f321cd9bf [ABI] deps: revert change to ComputeMaxSemiSpaceSize Refs: v8/v8@2178bba PR-URL: #16413
1 parent 2b84fa9 commit 758b730

File tree

7 files changed

+86
-296
lines changed

7 files changed

+86
-296
lines changed

deps/v8/include/v8-profiler.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,9 @@ class V8_EXPORT HeapProfiler {
809809
*/
810810
static const uint16_t kPersistentHandleNoClassId = 0;
811811

812+
/** Returns memory used for profiler internal data and snapshots. */
813+
size_t GetProfilerMemorySize();
814+
812815
private:
813816
HeapProfiler();
814817
~HeapProfiler();

deps/v8/include/v8.h

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1729,12 +1729,12 @@ class V8_EXPORT StackFrame {
17291729
enum StateTag {
17301730
JS,
17311731
GC,
1732-
PARSER,
1733-
BYTECODE_COMPILER,
17341732
COMPILER,
17351733
OTHER,
17361734
EXTERNAL,
1737-
IDLE
1735+
IDLE,
1736+
PARSER,
1737+
BYTECODE_COMPILER
17381738
};
17391739

17401740
// A RegisterState represents the current state of registers used
@@ -6348,6 +6348,8 @@ typedef void (*FailedAccessCheckCallback)(Local<Object> target,
63486348
* Callback to check if code generation from strings is allowed. See
63496349
* Context::AllowCodeGenerationFromStrings.
63506350
*/
6351+
typedef bool (*DeprecatedAllowCodeGenerationFromStringsCallback)(
6352+
Local<Context> context);
63516353
typedef bool (*AllowCodeGenerationFromStringsCallback)(Local<Context> context,
63526354
Local<String> source);
63536355

@@ -7636,6 +7638,9 @@ class V8_EXPORT Isolate {
76367638
*/
76377639
void SetAllowCodeGenerationFromStringsCallback(
76387640
AllowCodeGenerationFromStringsCallback callback);
7641+
V8_DEPRECATED("Use callback with source parameter.",
7642+
void SetAllowCodeGenerationFromStringsCallback(
7643+
DeprecatedAllowCodeGenerationFromStringsCallback callback));
76397644

76407645
/**
76417646
* Embedder over{ride|load} injection points for wasm APIs. The expectation
@@ -7796,6 +7801,15 @@ class V8_EXPORT V8 {
77967801
"Use isolate version",
77977802
void SetFatalErrorHandler(FatalErrorCallback that));
77987803

7804+
/**
7805+
* Set the callback to invoke to check if code generation from
7806+
* strings should be allowed.
7807+
*/
7808+
V8_INLINE static V8_DEPRECATED(
7809+
"Use isolate version",
7810+
void SetAllowCodeGenerationFromStringsCallback(
7811+
DeprecatedAllowCodeGenerationFromStringsCallback that));
7812+
77997813
/**
78007814
* Check if V8 is dead and therefore unusable. This is the case after
78017815
* fatal errors such as out-of-memory situations.
@@ -8205,12 +8219,8 @@ class V8_EXPORT SnapshotCreator {
82058219
* Set the default context to be included in the snapshot blob.
82068220
* The snapshot will not contain the global proxy, and we expect one or a
82078221
* global object template to create one, to be provided upon deserialization.
8208-
*
8209-
* \param callback optional callback to serialize internal fields.
82108222
*/
8211-
void SetDefaultContext(Local<Context> context,
8212-
SerializeInternalFieldsCallback callback =
8213-
SerializeInternalFieldsCallback());
8223+
void SetDefaultContext(Local<Context> context);
82148224

82158225
/**
82168226
* Add additional context to be included in the snapshot blob.
@@ -8562,9 +8572,7 @@ class V8_EXPORT Context {
85628572
static Local<Context> New(
85638573
Isolate* isolate, ExtensionConfiguration* extensions = NULL,
85648574
MaybeLocal<ObjectTemplate> global_template = MaybeLocal<ObjectTemplate>(),
8565-
MaybeLocal<Value> global_object = MaybeLocal<Value>(),
8566-
DeserializeInternalFieldsCallback internal_fields_deserializer =
8567-
DeserializeInternalFieldsCallback());
8575+
MaybeLocal<Value> global_object = MaybeLocal<Value>());
85688576

85698577
/**
85708578
* Create a new context from a (non-default) context snapshot. There
@@ -9021,8 +9029,8 @@ class Internals {
90219029
static const int kNodeIsIndependentShift = 3;
90229030
static const int kNodeIsActiveShift = 4;
90239031

9024-
static const int kJSApiObjectType = 0xbd;
9025-
static const int kJSObjectType = 0xbe;
9032+
static const int kJSApiObjectType = 0xbb;
9033+
static const int kJSObjectType = 0xbc;
90269034
static const int kFirstNonstringType = 0x80;
90279035
static const int kOddballType = 0x82;
90289036
static const int kForeignType = 0x86;
@@ -10275,6 +10283,14 @@ void* Context::GetAlignedPointerFromEmbedderData(int index) {
1027510283
#endif
1027610284
}
1027710285

10286+
void V8::SetAllowCodeGenerationFromStringsCallback(
10287+
DeprecatedAllowCodeGenerationFromStringsCallback callback) {
10288+
Isolate* isolate = Isolate::GetCurrent();
10289+
isolate->SetAllowCodeGenerationFromStringsCallback(
10290+
reinterpret_cast<AllowCodeGenerationFromStringsCallback>(callback));
10291+
}
10292+
10293+
1027810294
bool V8::IsDead() {
1027910295
Isolate* isolate = Isolate::GetCurrent();
1028010296
return isolate->IsDead();

deps/v8/src/api.cc

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -597,16 +597,16 @@ Isolate* SnapshotCreator::GetIsolate() {
597597
return SnapshotCreatorData::cast(data_)->isolate_;
598598
}
599599

600-
void SnapshotCreator::SetDefaultContext(
601-
Local<Context> context, SerializeInternalFieldsCallback callback) {
600+
void SnapshotCreator::SetDefaultContext(Local<Context> context) {
602601
DCHECK(!context.IsEmpty());
603602
SnapshotCreatorData* data = SnapshotCreatorData::cast(data_);
604603
DCHECK(!data->created_);
605604
DCHECK(data->default_context_.IsEmpty());
606605
Isolate* isolate = data->isolate_;
607606
CHECK_EQ(isolate, context->GetIsolate());
608607
data->default_context_.Reset(isolate, context);
609-
data->default_embedder_fields_serializer_ = callback;
608+
data->default_embedder_fields_serializer_ =
609+
v8::SerializeInternalFieldsCallback();
610610
}
611611

612612
size_t SnapshotCreator::AddContext(Local<Context> context,
@@ -6559,10 +6559,9 @@ Local<Context> NewContext(
65596559
Local<Context> v8::Context::New(
65606560
v8::Isolate* external_isolate, v8::ExtensionConfiguration* extensions,
65616561
v8::MaybeLocal<ObjectTemplate> global_template,
6562-
v8::MaybeLocal<Value> global_object,
6563-
DeserializeInternalFieldsCallback internal_fields_deserializer) {
6562+
v8::MaybeLocal<Value> global_object) {
65646563
return NewContext(external_isolate, extensions, global_template,
6565-
global_object, 0, internal_fields_deserializer);
6564+
global_object, 0, v8::DeserializeInternalFieldsCallback());
65666565
}
65676566

65686567
MaybeLocal<Context> v8::Context::FromSnapshot(
@@ -9052,6 +9051,13 @@ void Isolate::SetAllowCodeGenerationFromStringsCallback(
90529051
isolate->set_allow_code_gen_callback(callback);
90539052
}
90549053

9054+
void Isolate::SetAllowCodeGenerationFromStringsCallback(
9055+
DeprecatedAllowCodeGenerationFromStringsCallback callback) {
9056+
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
9057+
isolate->set_allow_code_gen_callback(
9058+
reinterpret_cast<AllowCodeGenerationFromStringsCallback>(callback));
9059+
}
9060+
90559061
#define CALLBACK_SETTER(ExternalName, Type, InternalName) \
90569062
void Isolate::Set##ExternalName(Type callback) { \
90579063
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); \
@@ -10509,6 +10515,10 @@ void HeapProfiler::SetGetRetainerInfosCallback(
1050910515
callback);
1051010516
}
1051110517

10518+
size_t HeapProfiler::GetProfilerMemorySize() {
10519+
return 0;
10520+
}
10521+
1051210522
v8::Testing::StressType internal::Testing::stress_type_ =
1051310523
v8::Testing::kStressTypeOpt;
1051410524

deps/v8/src/heap/heap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1303,7 +1303,7 @@ class Heap {
13031303

13041304
static size_t ComputeMaxSemiSpaceSize(uint64_t physical_memory) {
13051305
const uint64_t min_physical_memory = 512 * MB;
1306-
const uint64_t max_physical_memory = 3 * static_cast<uint64_t>(GB);
1306+
const uint64_t max_physical_memory = 2 * static_cast<uint64_t>(GB);
13071307

13081308
uint64_t capped_physical_memory =
13091309
Max(Min(physical_memory, max_physical_memory), min_physical_memory);

deps/v8/src/objects.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,10 +384,10 @@ const int kStubMinorKeyBits = kSmiValueSize - kStubMajorKeyBits - 1;
384384
V(JS_MODULE_NAMESPACE_TYPE) \
385385
V(JS_SPECIAL_API_OBJECT_TYPE) \
386386
V(JS_VALUE_TYPE) \
387-
V(JS_MESSAGE_OBJECT_TYPE) \
388-
V(JS_DATE_TYPE) \
389387
V(JS_API_OBJECT_TYPE) \
390388
V(JS_OBJECT_TYPE) \
389+
V(JS_MESSAGE_OBJECT_TYPE) \
390+
V(JS_DATE_TYPE) \
391391
V(JS_ARGUMENTS_TYPE) \
392392
V(JS_CONTEXT_EXTENSION_OBJECT_TYPE) \
393393
V(JS_GENERATOR_OBJECT_TYPE) \
@@ -741,11 +741,11 @@ enum InstanceType : uint8_t {
741741
// interceptors.
742742
JS_SPECIAL_API_OBJECT_TYPE, // LAST_SPECIAL_RECEIVER_TYPE
743743
JS_VALUE_TYPE, // LAST_CUSTOM_ELEMENTS_RECEIVER
744-
JS_MESSAGE_OBJECT_TYPE,
745-
JS_DATE_TYPE,
746744
// Like JS_OBJECT_TYPE, but created from API function.
747745
JS_API_OBJECT_TYPE,
748746
JS_OBJECT_TYPE,
747+
JS_MESSAGE_OBJECT_TYPE,
748+
JS_DATE_TYPE,
749749
JS_ARGUMENTS_TYPE,
750750
JS_CONTEXT_EXTENSION_OBJECT_TYPE,
751751
JS_GENERATOR_OBJECT_TYPE,

0 commit comments

Comments
 (0)