Skip to content

Commit

Permalink
deps: bring in V8 5.1 - 5.0 ABI compatibility
Browse files Browse the repository at this point in the history
Ref: ofrobots#23

PR-URL: nodejs#7016
Reviewed-By: Ali Ijaz Sheikh <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
  • Loading branch information
Matt Loring authored and targos committed Jun 29, 2016
1 parent cac1709 commit d79df45
Show file tree
Hide file tree
Showing 17 changed files with 57 additions and 40 deletions.
6 changes: 3 additions & 3 deletions deps/v8/include/v8-platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ class Platform {
*/
virtual uint64_t AddTraceEvent(
char phase, const uint8_t* category_enabled_flag, const char* name,
const char* scope, uint64_t id, uint64_t bind_id, int32_t num_args,
const char** arg_names, const uint8_t* arg_types,
const uint64_t* arg_values, unsigned int flags) {
uint64_t id, uint64_t bind_id, int32_t num_args, const char** arg_names,
const uint8_t* arg_types, const uint64_t* arg_values,
unsigned int flags) {
return 0;
}

Expand Down
18 changes: 9 additions & 9 deletions deps/v8/include/v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -5212,8 +5212,8 @@ class V8_EXPORT HeapStatistics {
size_t total_available_size_;
size_t used_heap_size_;
size_t heap_size_limit_;
size_t malloced_memory_;
bool does_zap_garbage_;
size_t malloced_memory_;

friend class V8;
friend class Isolate;
Expand Down Expand Up @@ -7330,7 +7330,7 @@ class Internals {
1 * kApiPointerSize + kApiIntSize;
static const int kStringResourceOffset = 3 * kApiPointerSize;

static const int kOddballKindOffset = 5 * kApiPointerSize;
static const int kOddballKindOffset = 4 * kApiPointerSize;
static const int kForeignAddressOffset = kApiPointerSize;
static const int kJSObjectHeaderSize = 3 * kApiPointerSize;
static const int kFixedArrayHeaderSize = 2 * kApiPointerSize;
Expand All @@ -7349,12 +7349,12 @@ class Internals {
static const int kIsolateRootsOffset =
kAmountOfExternalAllocatedMemoryAtLastGlobalGCOffset + kApiInt64Size +
kApiPointerSize;
static const int kUndefinedValueRootIndex = 4;
static const int kTheHoleValueRootIndex = 5;
static const int kNullValueRootIndex = 6;
static const int kTrueValueRootIndex = 7;
static const int kFalseValueRootIndex = 8;
static const int kEmptyStringRootIndex = 9;
static const int kUndefinedValueRootIndex = 5;
static const int kNullValueRootIndex = 7;
static const int kTrueValueRootIndex = 8;
static const int kFalseValueRootIndex = 9;
static const int kEmptyStringRootIndex = 10;
static const int kTheHoleValueRootIndex = 11;

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

static const int kJSObjectType = 0xb8;
static const int kJSObjectType = 0xb5;
static const int kFirstNonstringType = 0x80;
static const int kOddballType = 0x83;
static const int kForeignType = 0x87;
Expand Down
4 changes: 2 additions & 2 deletions deps/v8/src/api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5526,8 +5526,8 @@ HeapStatistics::HeapStatistics()
total_available_size_(0),
used_heap_size_(0),
heap_size_limit_(0),
malloced_memory_(0),
does_zap_garbage_(0) {}
does_zap_garbage_(0),
malloced_memory_(0) {}

HeapSpaceStatistics::HeapSpaceStatistics(): space_name_(0),
space_size_(0),
Expand Down
22 changes: 16 additions & 6 deletions deps/v8/src/builtins.cc
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ inline bool PrototypeHasNoElements(Isolate* isolate, JSObject* object) {
HeapObject* empty = isolate->heap()->empty_fixed_array();
while (prototype != null) {
Map* map = prototype->map();
if (map->instance_type() <= LAST_CUSTOM_ELEMENTS_RECEIVER) return false;
if (map->instance_type() <= LAST_CUSTOM_ELEMENTS_RECEIVER ||
map->instance_type() == JS_GLOBAL_PROXY_TYPE) return false;
if (JSObject::cast(prototype)->elements() != empty) return false;
prototype = HeapObject::cast(map->prototype());
}
Expand All @@ -237,6 +238,7 @@ inline bool IsJSArrayFastElementMovingAllowed(Isolate* isolate,

inline bool HasSimpleElements(JSObject* current) {
return current->map()->instance_type() > LAST_CUSTOM_ELEMENTS_RECEIVER &&
current->map()->instance_type() != JS_GLOBAL_PROXY_TYPE &&
!current->GetElementsAccessor()->HasAccessors(current);
}

Expand Down Expand Up @@ -421,9 +423,13 @@ void Builtins::Generate_ObjectHasOwnProperty(

{
Label if_objectissimple(assembler);
assembler->Branch(assembler->Int32LessThanOrEqual(
instance_type,
assembler->Int32Constant(LAST_SPECIAL_RECEIVER_TYPE)),
assembler->Branch(assembler->Word32Or(
assembler->Int32LessThanOrEqual(
instance_type, assembler->Int32Constant(
LAST_SPECIAL_RECEIVER_TYPE)),
assembler->Word32Equal(
instance_type, assembler->Int32Constant(
JS_GLOBAL_PROXY_TYPE))),
&call_runtime, &if_objectissimple);
assembler->Bind(&if_objectissimple);
}
Expand Down Expand Up @@ -481,9 +487,13 @@ void Builtins::Generate_ObjectHasOwnProperty(
assembler->Bind(&keyisindex);
{
Label if_objectissimple(assembler);
assembler->Branch(assembler->Int32LessThanOrEqual(
instance_type, assembler->Int32Constant(
assembler->Branch(assembler->Word32Or(
assembler->Int32LessThanOrEqual(
instance_type, assembler->Int32Constant(
LAST_CUSTOM_ELEMENTS_RECEIVER)),
assembler->Word32Equal(
instance_type, assembler->Int32Constant(
JS_GLOBAL_PROXY_TYPE))),
&call_runtime, &if_objectissimple);
assembler->Bind(&if_objectissimple);
}
Expand Down
3 changes: 3 additions & 0 deletions deps/v8/src/code-stubs-hydrogen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,9 @@ HValue* CodeStubGraphBuilder<FastArrayPushStub>::BuildCodeStub() {
check_instance_type.If<HCompareNumericAndBranch>(
instance_type, Add<HConstant>(LAST_CUSTOM_ELEMENTS_RECEIVER),
Token::LTE);
check_instance_type.Or();
check_instance_type.If<HCompareNumericAndBranch>(
instance_type, Add<HConstant>(JS_GLOBAL_PROXY_TYPE), Token::EQ);
check_instance_type.ThenDeopt(Deoptimizer::kFastArrayPushFailed);
check_instance_type.End();

Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/d8.cc
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class PredictablePlatform : public Platform {
}

uint64_t AddTraceEvent(char phase, const uint8_t* categoryEnabledFlag,
const char* name, const char* scope, uint64_t id,
const char* name, uint64_t id,
uint64_t bind_id, int numArgs, const char** argNames,
const uint8_t* argTypes, const uint64_t* argValues,
unsigned int flags) override {
Expand Down
6 changes: 3 additions & 3 deletions deps/v8/src/heap/heap.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ using v8::MemoryPressureLevel;
V(Map, one_pointer_filler_map, OnePointerFillerMap) \
V(Map, two_pointer_filler_map, TwoPointerFillerMap) \
/* Cluster the most popular ones in a few cache lines here at the top. */ \
V(Oddball, uninitialized_value, UninitializedValue) \
V(Oddball, undefined_value, UndefinedValue) \
V(Oddball, the_hole_value, TheHoleValue) \
V(Map, cell_map, CellMap) \
V(Oddball, null_value, NullValue) \
V(Oddball, true_value, TrueValue) \
V(Oddball, false_value, FalseValue) \
V(String, empty_string, empty_string) \
V(Oddball, uninitialized_value, UninitializedValue) \
V(Map, cell_map, CellMap) \
V(Oddball, the_hole_value, TheHoleValue) \
V(Map, global_property_cell_map, GlobalPropertyCellMap) \
V(Map, shared_function_info_map, SharedFunctionInfoMap) \
V(Map, meta_map, MetaMap) \
Expand Down
3 changes: 2 additions & 1 deletion deps/v8/src/keys.cc
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,8 @@ MaybeHandle<FixedArray> GetOwnKeysWithUninitializedEnumCache(
}

bool OnlyHasSimpleProperties(Map* map) {
return map->instance_type() > LAST_CUSTOM_ELEMENTS_RECEIVER;
return map->instance_type() > LAST_CUSTOM_ELEMENTS_RECEIVER &&
map->instance_type() != JS_GLOBAL_PROXY_TYPE;
}

} // namespace
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/libplatform/default-platform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ double DefaultPlatform::MonotonicallyIncreasingTime() {

uint64_t DefaultPlatform::AddTraceEvent(
char phase, const uint8_t* category_enabled_flag, const char* name,
const char* scope, uint64_t id, uint64_t bind_id, int num_args,
uint64_t id, uint64_t bind_id, int num_args,
const char** arg_names, const uint8_t* arg_types,
const uint64_t* arg_values, unsigned int flags) {
return 0;
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/libplatform/default-platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class DefaultPlatform : public Platform {
const char* GetCategoryGroupName(
const uint8_t* category_enabled_flag) override;
uint64_t AddTraceEvent(char phase, const uint8_t* category_enabled_flag,
const char* name, const char* scope, uint64_t id,
const char* name, uint64_t id,
uint64_t bind_id, int32_t num_args,
const char** arg_names, const uint8_t* arg_types,
const uint64_t* arg_values,
Expand Down
3 changes: 2 additions & 1 deletion deps/v8/src/lookup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ void LookupIterator::Next() {
JSReceiver* holder = *holder_;
Map* map = holder->map();

if (map->instance_type() <= LAST_SPECIAL_RECEIVER_TYPE) {
if (map->instance_type() <= LAST_SPECIAL_RECEIVER_TYPE ||
map->instance_type() == JS_GLOBAL_PROXY_TYPE) {
state_ = IsElement() ? LookupInSpecialHolder<true>(map, holder)
: LookupInSpecialHolder<false>(map, holder);
if (IsFound()) return;
Expand Down
3 changes: 2 additions & 1 deletion deps/v8/src/lookup.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ class LookupIterator final BASE_EMBEDDED {
void NextInternal(Map* map, JSReceiver* holder);
template <bool is_element>
inline State LookupInHolder(Map* map, JSReceiver* holder) {
return map->instance_type() <= LAST_SPECIAL_RECEIVER_TYPE
return (map->instance_type() <= LAST_SPECIAL_RECEIVER_TYPE ||
map->instance_type() == JS_GLOBAL_PROXY_TYPE)
? LookupInSpecialHolder<is_element>(map, holder)
: LookupInRegularHolder<is_element>(map, holder);
}
Expand Down
3 changes: 2 additions & 1 deletion deps/v8/src/objects.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8411,7 +8411,8 @@ bool Map::OnlyHasSimpleProperties() {
// Wrapped string elements aren't explicitly stored in the elements backing
// store, but are loaded indirectly from the underlying string.
return !IsStringWrapperElementsKind(elements_kind()) &&
instance_type() > LAST_SPECIAL_RECEIVER_TYPE &&
(instance_type() > LAST_SPECIAL_RECEIVER_TYPE &&
instance_type() != JS_GLOBAL_PROXY_TYPE) &&
!has_hidden_prototype() && !is_dictionary_map();
}

Expand Down
10 changes: 5 additions & 5 deletions deps/v8/src/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -707,13 +707,13 @@ enum InstanceType {
// compares for checking the JS_RECEIVER and the NONCALLABLE_JS_OBJECT range.
JS_PROXY_TYPE, // FIRST_JS_RECEIVER_TYPE
JS_GLOBAL_OBJECT_TYPE, // FIRST_JS_OBJECT_TYPE
JS_GLOBAL_PROXY_TYPE,
// Like JS_OBJECT_TYPE, but requires access checks and/or has interceptors.
JS_SPECIAL_API_OBJECT_TYPE, // LAST_SPECIAL_RECEIVER_TYPE
JS_VALUE_TYPE, // LAST_CUSTOM_ELEMENTS_RECEIVER
JS_OBJECT_TYPE,
JS_GLOBAL_PROXY_TYPE,
JS_MESSAGE_OBJECT_TYPE,
JS_DATE_TYPE,
JS_OBJECT_TYPE,
JS_CONTEXT_EXTENSION_OBJECT_TYPE,
JS_GENERATOR_OBJECT_TYPE,
JS_MODULE_TYPE,
Expand Down Expand Up @@ -9638,9 +9638,9 @@ class Oddball: public HeapObject {
static const int kToStringOffset = HeapObject::kHeaderSize;
static const int kToNumberOffset = kToStringOffset + kPointerSize;
static const int kToBooleanOffset = kToNumberOffset + kPointerSize;
static const int kTypeOfOffset = kToBooleanOffset + kPointerSize;
static const int kKindOffset = kTypeOfOffset + kPointerSize;
static const int kSize = kKindOffset + kPointerSize;
static const int kKindOffset = kToBooleanOffset + kPointerSize;
static const int kTypeOfOffset = kKindOffset + kPointerSize;
static const int kSize = kTypeOfOffset + kPointerSize;

static const byte kFalse = 0;
static const byte kTrue = 1;
Expand Down
6 changes: 3 additions & 3 deletions deps/v8/src/tracing/trace-event.h
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ static V8_INLINE uint64_t AddTraceEvent(char phase,
uint64_t id, uint64_t bind_id,
unsigned int flags) {
return TRACE_EVENT_API_ADD_TRACE_EVENT(phase, category_group_enabled, name,
scope, id, bind_id, kZeroNumArgs, NULL,
id, bind_id, kZeroNumArgs, NULL,
NULL, NULL, flags);
}

Expand All @@ -492,7 +492,7 @@ static V8_INLINE uint64_t AddTraceEvent(
uint64_t arg_values[1];
SetTraceValue(arg1_val, &arg_types[0], &arg_values[0]);
return TRACE_EVENT_API_ADD_TRACE_EVENT(
phase, category_group_enabled, name, scope, id, bind_id, num_args,
phase, category_group_enabled, name, id, bind_id, num_args,
&arg1_name, arg_types, arg_values, flags);
}

Expand All @@ -509,7 +509,7 @@ static V8_INLINE uint64_t AddTraceEvent(
SetTraceValue(arg1_val, &arg_types[0], &arg_values[0]);
SetTraceValue(arg2_val, &arg_types[1], &arg_values[1]);
return TRACE_EVENT_API_ADD_TRACE_EVENT(
phase, category_group_enabled, name, scope, id, bind_id, num_args,
phase, category_group_enabled, name, id, bind_id, num_args,
arg_names, arg_types, arg_values, flags);
}

Expand Down
2 changes: 1 addition & 1 deletion deps/v8/test/cctest/heap/test-incremental-marking.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class MockPlatform : public v8::Platform {
}

uint64_t AddTraceEvent(char phase, const uint8_t* categoryEnabledFlag,
const char* name, const char* scope, uint64_t id,
const char* name, uint64_t id,
uint64_t bind_id, int numArgs, const char** argNames,
const uint8_t* argTypes, const uint64_t* argValues,
unsigned int flags) override {
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/test/cctest/test-trace-event.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class MockTracingPlatform : public v8::Platform {
void PerformDelayedTask() {}

uint64_t AddTraceEvent(char phase, const uint8_t* category_enabled_flag,
const char* name, const char* scope, uint64_t id,
const char* name, uint64_t id,
uint64_t bind_id, int num_args, const char** arg_names,
const uint8_t* arg_types, const uint64_t* arg_values,
unsigned int flags) override {
Expand Down

0 comments on commit d79df45

Please sign in to comment.