Commit 9c6bc7af authored by Yang Guo's avatar Yang Guo Committed by Commit Bot

Leave spaces between instance types.

We used to frequently break the ABI when we introduced new instance
types because some instance types are hard-coded in v8.h.

Now that we have more instance types available, we can leave some
room to anticipate future new instance types.

Also take this opportunity to reorder some instance types.

Also see: https://github.com/nodejs/node/issues/17754

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I9b59eeab9dfcdf11d779f0b700fc5dce30d3eebe
Reviewed-on: https://chromium-review.googlesource.com/833874Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50223}
parent 50cb6751
......@@ -9089,9 +9089,9 @@ class Internals {
static const int kFirstNonstringType = 0x80;
static const int kOddballType = 0x83;
static const int kForeignType = 0x87;
static const int kJSSpecialApiObjectType = 0xbe;
static const int kJSApiObjectType = 0xc2;
static const int kJSObjectType = 0xc3;
static const int kJSSpecialApiObjectType = 0x8100;
static const int kJSApiObjectType = 0x8200;
static const int kJSObjectType = 0x8201;
static const int kUndefinedOddballKind = 5;
static const int kNullOddballKind = 3;
......
......@@ -297,6 +297,9 @@ bool HeapObject::IsJSProxy() const { return map()->IsJSProxyMap(); }
bool HeapObject::IsJSMapIterator() const {
InstanceType instance_type = map()->instance_type();
STATIC_ASSERT(JS_MAP_KEY_ITERATOR_TYPE + 1 == JS_MAP_KEY_VALUE_ITERATOR_TYPE);
STATIC_ASSERT(JS_MAP_KEY_VALUE_ITERATOR_TYPE + 1 ==
JS_MAP_VALUE_ITERATOR_TYPE);
return (instance_type >= JS_MAP_KEY_ITERATOR_TYPE &&
instance_type <= JS_MAP_VALUE_ITERATOR_TYPE);
}
......
This diff is collapsed.
......@@ -61,7 +61,7 @@ TEST(Object, InstanceTypeListOrder) {
current_type = InstanceType::type; \
current = static_cast<int>(current_type); \
if (current > static_cast<int>(LAST_NAME_TYPE)) { \
EXPECT_EQ(last + 1, current); \
EXPECT_LE(last + 1, current); \
} \
EXPECT_LT(last, current) << " INSTANCE_TYPE_LIST is not ordered: " \
<< "last = " << static_cast<InstanceType>(last) \
......@@ -73,7 +73,7 @@ TEST(Object, InstanceTypeListOrder) {
}
TEST(Object, StructListOrder) {
int current = static_cast<int>(InstanceType::ACCESSOR_INFO_TYPE);
int current = static_cast<int>(InstanceType::ACCESS_CHECK_INFO_TYPE);
int last = current - 1;
ASSERT_LT(0, last);
InstanceType current_type = static_cast<InstanceType>(current);
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment