Skip to content

Commit 2c46e23

Browse files
Matt Loringofrobots
Matt Loring
authored andcommitted
deps: bring in V8 5.1 - 5.0 ABI compatibility
Ref: ofrobots#23 PR-URL: #7016 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent 06a6c03 commit 2c46e23

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
@@ -5221,8 +5221,8 @@ class V8_EXPORT HeapStatistics {
52215221
size_t total_available_size_;
52225222
size_t used_heap_size_;
52235223
size_t heap_size_limit_;
5224-
size_t malloced_memory_;
52255224
bool does_zap_garbage_;
5225+
size_t malloced_memory_;
52265226

52275227
friend class V8;
52285228
friend class Isolate;
@@ -7339,7 +7339,7 @@ class Internals {
73397339
1 * kApiPointerSize + kApiIntSize;
73407340
static const int kStringResourceOffset = 3 * kApiPointerSize;
73417341

7342-
static const int kOddballKindOffset = 5 * kApiPointerSize;
7342+
static const int kOddballKindOffset = 4 * kApiPointerSize;
73437343
static const int kForeignAddressOffset = kApiPointerSize;
73447344
static const int kJSObjectHeaderSize = 3 * kApiPointerSize;
73457345
static const int kFixedArrayHeaderSize = 2 * kApiPointerSize;
@@ -7358,12 +7358,12 @@ class Internals {
73587358
static const int kIsolateRootsOffset =
73597359
kAmountOfExternalAllocatedMemoryAtLastGlobalGCOffset + kApiInt64Size +
73607360
kApiPointerSize;
7361-
static const int kUndefinedValueRootIndex = 4;
7362-
static const int kTheHoleValueRootIndex = 5;
7363-
static const int kNullValueRootIndex = 6;
7364-
static const int kTrueValueRootIndex = 7;
7365-
static const int kFalseValueRootIndex = 8;
7366-
static const int kEmptyStringRootIndex = 9;
7361+
static const int kUndefinedValueRootIndex = 5;
7362+
static const int kNullValueRootIndex = 7;
7363+
static const int kTrueValueRootIndex = 8;
7364+
static const int kFalseValueRootIndex = 9;
7365+
static const int kEmptyStringRootIndex = 10;
7366+
static const int kTheHoleValueRootIndex = 11;
73677367

73687368
// The external allocation limit should be below 256 MB on all architectures
73697369
// to avoid that resource-constrained embedders run low on memory.
@@ -7379,7 +7379,7 @@ class Internals {
73797379
static const int kNodeIsPartiallyDependentShift = 4;
73807380
static const int kNodeIsActiveShift = 4;
73817381

7382-
static const int kJSObjectType = 0xb8;
7382+
static const int kJSObjectType = 0xb5;
73837383
static const int kFirstNonstringType = 0x80;
73847384
static const int kOddballType = 0x83;
73857385
static const int kForeignType = 0x87;

deps/v8/src/api.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5544,8 +5544,8 @@ HeapStatistics::HeapStatistics()
55445544
total_available_size_(0),
55455545
used_heap_size_(0),
55465546
heap_size_limit_(0),
5547-
malloced_memory_(0),
5548-
does_zap_garbage_(0) {}
5547+
does_zap_garbage_(0),
5548+
malloced_memory_(0) {}
55495549

55505550
HeapSpaceStatistics::HeapSpaceStatistics(): space_name_(0),
55515551
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,

deps/v8/src/lookup.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ void LookupIterator::Next() {
7474
JSReceiver* holder = *holder_;
7575
Map* map = holder->map();
7676

77-
if (map->instance_type() <= LAST_SPECIAL_RECEIVER_TYPE) {
77+
if (map->instance_type() <= LAST_SPECIAL_RECEIVER_TYPE ||
78+
map->instance_type() == JS_GLOBAL_PROXY_TYPE) {
7879
state_ = IsElement() ? LookupInSpecialHolder<true>(map, holder)
7980
: LookupInSpecialHolder<false>(map, holder);
8081
if (IsFound()) return;

deps/v8/src/lookup.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,8 @@ class LookupIterator final BASE_EMBEDDED {
289289
void NextInternal(Map* map, JSReceiver* holder);
290290
template <bool is_element>
291291
inline State LookupInHolder(Map* map, JSReceiver* holder) {
292-
return map->instance_type() <= LAST_SPECIAL_RECEIVER_TYPE
292+
return (map->instance_type() <= LAST_SPECIAL_RECEIVER_TYPE ||
293+
map->instance_type() == JS_GLOBAL_PROXY_TYPE)
293294
? LookupInSpecialHolder<is_element>(map, holder)
294295
: LookupInRegularHolder<is_element>(map, holder);
295296
}

deps/v8/src/objects.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8411,7 +8411,8 @@ bool Map::OnlyHasSimpleProperties() {
84118411
// Wrapped string elements aren't explicitly stored in the elements backing
84128412
// store, but are loaded indirectly from the underlying string.
84138413
return !IsStringWrapperElementsKind(elements_kind()) &&
8414-
instance_type() > LAST_SPECIAL_RECEIVER_TYPE &&
8414+
(instance_type() > LAST_SPECIAL_RECEIVER_TYPE &&
8415+
instance_type() != JS_GLOBAL_PROXY_TYPE) &&
84158416
!has_hidden_prototype() && !is_dictionary_map();
84168417
}
84178418

deps/v8/src/objects.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -707,13 +707,13 @@ enum InstanceType {
707707
// compares for checking the JS_RECEIVER and the NONCALLABLE_JS_OBJECT range.
708708
JS_PROXY_TYPE, // FIRST_JS_RECEIVER_TYPE
709709
JS_GLOBAL_OBJECT_TYPE, // FIRST_JS_OBJECT_TYPE
710-
JS_GLOBAL_PROXY_TYPE,
711710
// Like JS_OBJECT_TYPE, but requires access checks and/or has interceptors.
712711
JS_SPECIAL_API_OBJECT_TYPE, // LAST_SPECIAL_RECEIVER_TYPE
713712
JS_VALUE_TYPE, // LAST_CUSTOM_ELEMENTS_RECEIVER
713+
JS_OBJECT_TYPE,
714+
JS_GLOBAL_PROXY_TYPE,
714715
JS_MESSAGE_OBJECT_TYPE,
715716
JS_DATE_TYPE,
716-
JS_OBJECT_TYPE,
717717
JS_CONTEXT_EXTENSION_OBJECT_TYPE,
718718
JS_GENERATOR_OBJECT_TYPE,
719719
JS_MODULE_TYPE,
@@ -9638,9 +9638,9 @@ class Oddball: public HeapObject {
96389638
static const int kToStringOffset = HeapObject::kHeaderSize;
96399639
static const int kToNumberOffset = kToStringOffset + kPointerSize;
96409640
static const int kToBooleanOffset = kToNumberOffset + kPointerSize;
9641-
static const int kTypeOfOffset = kToBooleanOffset + kPointerSize;
9642-
static const int kKindOffset = kTypeOfOffset + kPointerSize;
9643-
static const int kSize = kKindOffset + kPointerSize;
9641+
static const int kKindOffset = kToBooleanOffset + kPointerSize;
9642+
static const int kTypeOfOffset = kKindOffset + kPointerSize;
9643+
static const int kSize = kTypeOfOffset + kPointerSize;
96449644

96459645
static const byte kFalse = 0;
96469646
static const byte kTrue = 1;

deps/v8/src/tracing/trace-event.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ static V8_INLINE uint64_t AddTraceEvent(char phase,
478478
uint64_t id, uint64_t bind_id,
479479
unsigned int flags) {
480480
return TRACE_EVENT_API_ADD_TRACE_EVENT(phase, category_group_enabled, name,
481-
scope, id, bind_id, kZeroNumArgs, NULL,
481+
id, bind_id, kZeroNumArgs, NULL,
482482
NULL, NULL, flags);
483483
}
484484

@@ -492,7 +492,7 @@ static V8_INLINE uint64_t AddTraceEvent(
492492
uint64_t arg_values[1];
493493
SetTraceValue(arg1_val, &arg_types[0], &arg_values[0]);
494494
return TRACE_EVENT_API_ADD_TRACE_EVENT(
495-
phase, category_group_enabled, name, scope, id, bind_id, num_args,
495+
phase, category_group_enabled, name, id, bind_id, num_args,
496496
&arg1_name, arg_types, arg_values, flags);
497497
}
498498

@@ -509,7 +509,7 @@ static V8_INLINE uint64_t AddTraceEvent(
509509
SetTraceValue(arg1_val, &arg_types[0], &arg_values[0]);
510510
SetTraceValue(arg2_val, &arg_types[1], &arg_values[1]);
511511
return TRACE_EVENT_API_ADD_TRACE_EVENT(
512-
phase, category_group_enabled, name, scope, id, bind_id, num_args,
512+
phase, category_group_enabled, name, id, bind_id, num_args,
513513
arg_names, arg_types, arg_values, flags);
514514
}
515515

deps/v8/test/cctest/heap/test-incremental-marking.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class MockPlatform : public v8::Platform {
8686
}
8787

8888
uint64_t AddTraceEvent(char phase, const uint8_t* categoryEnabledFlag,
89-
const char* name, const char* scope, uint64_t id,
89+
const char* name, uint64_t id,
9090
uint64_t bind_id, int numArgs, const char** argNames,
9191
const uint8_t* argTypes, const uint64_t* argValues,
9292
unsigned int flags) override {

deps/v8/test/cctest/test-trace-event.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class MockTracingPlatform : public v8::Platform {
7272
void PerformDelayedTask() {}
7373

7474
uint64_t AddTraceEvent(char phase, const uint8_t* category_enabled_flag,
75-
const char* name, const char* scope, uint64_t id,
75+
const char* name, uint64_t id,
7676
uint64_t bind_id, int num_args, const char** arg_names,
7777
const uint8_t* arg_types, const uint64_t* arg_values,
7878
unsigned int flags) override {

0 commit comments

Comments
 (0)