Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 2e8c0ada3877b3633e34c5f4d9732c94868de3c2..fa6b6f3feb45abcbca3a55b2626aa55a8b81dcc6 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -3874,33 +3874,14 @@ inline void Code::set_is_crankshafted(bool value) { |
int Code::major_key() { |
- ASSERT(kind() == STUB || |
- kind() == HANDLER || |
- kind() == BINARY_OP_IC || |
- kind() == COMPARE_IC || |
- kind() == COMPARE_NIL_IC || |
- kind() == STORE_IC || |
- kind() == LOAD_IC || |
- kind() == KEYED_LOAD_IC || |
- kind() == KEYED_CALL_IC || |
- kind() == TO_BOOLEAN_IC); |
+ ASSERT(has_major_key()); |
return StubMajorKeyField::decode( |
READ_UINT32_FIELD(this, kKindSpecificFlags2Offset)); |
} |
void Code::set_major_key(int major) { |
- ASSERT(kind() == STUB || |
- kind() == HANDLER || |
- kind() == BINARY_OP_IC || |
- kind() == COMPARE_IC || |
- kind() == COMPARE_NIL_IC || |
- kind() == LOAD_IC || |
- kind() == KEYED_LOAD_IC || |
- kind() == STORE_IC || |
- kind() == KEYED_STORE_IC || |
- kind() == KEYED_CALL_IC || |
- kind() == TO_BOOLEAN_IC); |
+ ASSERT(has_major_key()); |
ASSERT(0 <= major && major < 256); |
int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); |
int updated = StubMajorKeyField::update(previous, major); |
@@ -3908,6 +3889,21 @@ void Code::set_major_key(int major) { |
} |
+bool Code::has_major_key() { |
+ return kind() == STUB || |
+ kind() == HANDLER || |
+ kind() == BINARY_OP_IC || |
+ kind() == COMPARE_IC || |
+ kind() == COMPARE_NIL_IC || |
+ kind() == LOAD_IC || |
+ kind() == KEYED_LOAD_IC || |
+ kind() == STORE_IC || |
+ kind() == KEYED_STORE_IC || |
+ kind() == KEYED_CALL_IC || |
+ kind() == TO_BOOLEAN_IC; |
+} |
+ |
+ |
bool Code::is_pregenerated() { |
return (kind() == STUB && IsPregeneratedField::decode(flags())); |
} |