Skip to content

Commit d79df45

Browse files
Matt Loringtargos
authored andcommitted
deps: bring in V8 5.1 - 5.0 ABI compatibility
Ref: ofrobots#23 PR-URL: nodejs#7016 Reviewed-By: Ali Ijaz Sheikh <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
1 parent cac1709 commit d79df45

File tree

17 files changed

+57
-40
lines changed

17 files changed

+57
-40
lines changed

deps/v8/include/v8-platform.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ class Platform {
152152
*/
153153
virtual uint64_t AddTraceEvent(
154154
char phase, const uint8_t* category_enabled_flag, const char* name,
155-
const char* scope, uint64_t id, uint64_t bind_id, int32_t num_args,
156-
const char** arg_names, const uint8_t* arg_types,
157-
const uint64_t* arg_values, unsigned int flags) {
155+
uint64_t id, uint64_t bind_id, int32_t num_args, const char** arg_names,
156+
const uint8_t* arg_types, const uint64_t* arg_values,
157+
unsigned int flags) {
158158
return 0;
159159
}
160160

deps/v8/include/v8.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5212,8 +5212,8 @@ class V8_EXPORT HeapStatistics {
52125212
size_t total_available_size_;
52135213
size_t used_heap_size_;
52145214
size_t heap_size_limit_;
5215-
size_t malloced_memory_;
52165215
bool does_zap_garbage_;
5216+
size_t malloced_memory_;
52175217

52185218
friend class V8;
52195219
friend class Isolate;
@@ -7330,7 +7330,7 @@ class Internals {
73307330
1 * kApiPointerSize + kApiIntSize;
73317331
static const int kStringResourceOffset = 3 * kApiPointerSize;
73327332

7333-
static const int kOddballKindOffset = 5 * kApiPointerSize;
7333+
static const int kOddballKindOffset = 4 * kApiPointerSize;
73347334
static const int kForeignAddressOffset = kApiPointerSize;
73357335
static const int kJSObjectHeaderSize = 3 * kApiPointerSize;
73367336
static const int kFixedArrayHeaderSize = 2 * kApiPointerSize;
@@ -7349,12 +7349,12 @@ class Internals {
73497349
static const int kIsolateRootsOffset =
73507350
kAmountOfExternalAllocatedMemoryAtLastGlobalGCOffset + kApiInt64Size +
73517351
kApiPointerSize;
7352-
static const int kUndefinedValueRootIndex = 4;
7353-
static const int kTheHoleValueRootIndex = 5;
7354-
static const int kNullValueRootIndex = 6;
7355-
static const int kTrueValueRootIndex = 7;
7356-
static const int kFalseValueRootIndex = 8;
7357-
static const int kEmptyStringRootIndex = 9;
7352+
static const int kUndefinedValueRootIndex = 5;
7353+
static const int kNullValueRootIndex = 7;
7354+
static const int kTrueValueRootIndex = 8;
7355+
static const int kFalseValueRootIndex = 9;
7356+
static const int kEmptyStringRootIndex = 10;
7357+
static const int kTheHoleValueRootIndex = 11;
73587358

73597359
// The external allocation limit should be below 256 MB on all architectures
73607360
// to avoid that resource-constrained embedders run low on memory.
@@ -7370,7 +7370,7 @@ class Internals {
73707370
static const int kNodeIsPartiallyDependentShift = 4;
73717371
static const int kNodeIsActiveShift = 4;
73727372

7373-
static const int kJSObjectType = 0xb8;
7373+
static const int kJSObjectType = 0xb5;
73747374
static const int kFirstNonstringType = 0x80;
73757375
static const int kOddballType = 0x83;
73767376
static const int kForeignType = 0x87;

deps/v8/src/api.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5526,8 +5526,8 @@ HeapStatistics::HeapStatistics()
55265526
total_available_size_(0),
55275527
used_heap_size_(0),
55285528
heap_size_limit_(0),
5529-
malloced_memory_(0),
5530-
does_zap_garbage_(0) {}
5529+
does_zap_garbage_(0),
5530+
malloced_memory_(0) {}
55315531

55325532
HeapSpaceStatistics::HeapSpaceStatistics(): space_name_(0),
55335533
space_size_(0),

deps/v8/src/builtins.cc

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ inline bool PrototypeHasNoElements(Isolate* isolate, JSObject* object) {
223223
HeapObject* empty = isolate->heap()->empty_fixed_array();
224224
while (prototype != null) {
225225
Map* map = prototype->map();
226-
if (map->instance_type() <= LAST_CUSTOM_ELEMENTS_RECEIVER) return false;
226+
if (map->instance_type() <= LAST_CUSTOM_ELEMENTS_RECEIVER ||
227+
map->instance_type() == JS_GLOBAL_PROXY_TYPE) return false;
227228
if (JSObject::cast(prototype)->elements() != empty) return false;
228229
prototype = HeapObject::cast(map->prototype());
229230
}
@@ -237,6 +238,7 @@ inline bool IsJSArrayFastElementMovingAllowed(Isolate* isolate,
237238

238239
inline bool HasSimpleElements(JSObject* current) {
239240
return current->map()->instance_type() > LAST_CUSTOM_ELEMENTS_RECEIVER &&
241+
current->map()->instance_type() != JS_GLOBAL_PROXY_TYPE &&
240242
!current->GetElementsAccessor()->HasAccessors(current);
241243
}
242244

@@ -421,9 +423,13 @@ void Builtins::Generate_ObjectHasOwnProperty(
421423

422424
{
423425
Label if_objectissimple(assembler);
424-
assembler->Branch(assembler->Int32LessThanOrEqual(
425-
instance_type,
426-
assembler->Int32Constant(LAST_SPECIAL_RECEIVER_TYPE)),
426+
assembler->Branch(assembler->Word32Or(
427+
assembler->Int32LessThanOrEqual(
428+
instance_type, assembler->Int32Constant(
429+
LAST_SPECIAL_RECEIVER_TYPE)),
430+
assembler->Word32Equal(
431+
instance_type, assembler->Int32Constant(
432+
JS_GLOBAL_PROXY_TYPE))),
427433
&call_runtime, &if_objectissimple);
428434
assembler->Bind(&if_objectissimple);
429435
}
@@ -481,9 +487,13 @@ void Builtins::Generate_ObjectHasOwnProperty(
481487
assembler->Bind(&keyisindex);
482488
{
483489
Label if_objectissimple(assembler);
484-
assembler->Branch(assembler->Int32LessThanOrEqual(
485-
instance_type, assembler->Int32Constant(
490+
assembler->Branch(assembler->Word32Or(
491+
assembler->Int32LessThanOrEqual(
492+
instance_type, assembler->Int32Constant(
486493
LAST_CUSTOM_ELEMENTS_RECEIVER)),
494+
assembler->Word32Equal(
495+
instance_type, assembler->Int32Constant(
496+
JS_GLOBAL_PROXY_TYPE))),
487497
&call_runtime, &if_objectissimple);
488498
assembler->Bind(&if_objectissimple);
489499
}

deps/v8/src/code-stubs-hydrogen.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,9 @@ HValue* CodeStubGraphBuilder<FastArrayPushStub>::BuildCodeStub() {
923923
check_instance_type.If<HCompareNumericAndBranch>(
924924
instance_type, Add<HConstant>(LAST_CUSTOM_ELEMENTS_RECEIVER),
925925
Token::LTE);
926+
check_instance_type.Or();
927+
check_instance_type.If<HCompareNumericAndBranch>(
928+
instance_type, Add<HConstant>(JS_GLOBAL_PROXY_TYPE), Token::EQ);
926929
check_instance_type.ThenDeopt(Deoptimizer::kFastArrayPushFailed);
927930
check_instance_type.End();
928931

deps/v8/src/d8.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class PredictablePlatform : public Platform {
133133
}
134134

135135
uint64_t AddTraceEvent(char phase, const uint8_t* categoryEnabledFlag,
136-
const char* name, const char* scope, uint64_t id,
136+
const char* name, uint64_t id,
137137
uint64_t bind_id, int numArgs, const char** argNames,
138138
const uint8_t* argTypes, const uint64_t* argValues,
139139
unsigned int flags) override {

deps/v8/src/heap/heap.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ using v8::MemoryPressureLevel;
3333
V(Map, one_pointer_filler_map, OnePointerFillerMap) \
3434
V(Map, two_pointer_filler_map, TwoPointerFillerMap) \
3535
/* Cluster the most popular ones in a few cache lines here at the top. */ \
36+
V(Oddball, uninitialized_value, UninitializedValue) \
3637
V(Oddball, undefined_value, UndefinedValue) \
37-
V(Oddball, the_hole_value, TheHoleValue) \
38+
V(Map, cell_map, CellMap) \
3839
V(Oddball, null_value, NullValue) \
3940
V(Oddball, true_value, TrueValue) \
4041
V(Oddball, false_value, FalseValue) \
4142
V(String, empty_string, empty_string) \
42-
V(Oddball, uninitialized_value, UninitializedValue) \
43-
V(Map, cell_map, CellMap) \
43+
V(Oddball, the_hole_value, TheHoleValue) \
4444
V(Map, global_property_cell_map, GlobalPropertyCellMap) \
4545
V(Map, shared_function_info_map, SharedFunctionInfoMap) \
4646
V(Map, meta_map, MetaMap) \

deps/v8/src/keys.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,8 @@ MaybeHandle<FixedArray> GetOwnKeysWithUninitializedEnumCache(
406406
}
407407

408408
bool OnlyHasSimpleProperties(Map* map) {
409-
return map->instance_type() > LAST_CUSTOM_ELEMENTS_RECEIVER;
409+
return map->instance_type() > LAST_CUSTOM_ELEMENTS_RECEIVER &&
410+
map->instance_type() != JS_GLOBAL_PROXY_TYPE;
410411
}
411412

412413
} // namespace

deps/v8/src/libplatform/default-platform.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ double DefaultPlatform::MonotonicallyIncreasingTime() {
170170

171171
uint64_t DefaultPlatform::AddTraceEvent(
172172
char phase, const uint8_t* category_enabled_flag, const char* name,
173-
const char* scope, uint64_t id, uint64_t bind_id, int num_args,
173+
uint64_t id, uint64_t bind_id, int num_args,
174174
const char** arg_names, const uint8_t* arg_types,
175175
const uint64_t* arg_values, unsigned int flags) {
176176
return 0;

deps/v8/src/libplatform/default-platform.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class DefaultPlatform : public Platform {
4747
const char* GetCategoryGroupName(
4848
const uint8_t* category_enabled_flag) override;
4949
uint64_t AddTraceEvent(char phase, const uint8_t* category_enabled_flag,
50-
const char* name, const char* scope, uint64_t id,
50+
const char* name, uint64_t id,
5151
uint64_t bind_id, int32_t num_args,
5252
const char** arg_names, const uint8_t* arg_types,
5353
const uint64_t* arg_values,

0 commit comments

Comments
 (0)