Index: src/objects.h |
diff --git a/src/objects.h b/src/objects.h |
index 651d12593a35b9ca04ad9865a5875813a17abc13..c7f1ac7b3b1f6cb89e4f4216196228d46c112710 100644 |
--- a/src/objects.h |
+++ b/src/objects.h |
@@ -4941,6 +4941,17 @@ class PodArray : public ByteArray { |
// BytecodeArray represents a sequence of interpreter bytecodes. |
class BytecodeArray : public FixedArrayBase { |
public: |
+#define DECLARE_BYTECODE_AGE_ENUM(X) k##X##BytecodeAge, |
+ enum Age { |
+ kNoAgeBytecodeAge = 0, |
+ CODE_AGE_LIST(DECLARE_BYTECODE_AGE_ENUM) kAfterLastBytecodeAge, |
+ kFirstBytecodeAge = kNoAgeBytecodeAge, |
+ kLastBytecodeAge = kAfterLastBytecodeAge - 1, |
+ kBytecodeAgeCount = kAfterLastBytecodeAge - kFirstBytecodeAge - 1, |
+ kIsOldBytecodeAge = kSexagenarianBytecodeAge |
+ }; |
+#undef DECLARE_BYTECODE_AGE_ENUM |
+ |
static int SizeFor(int length) { |
return OBJECT_POINTER_ALIGN(kHeaderSize + length); |
} |
@@ -4971,6 +4982,10 @@ class BytecodeArray : public FixedArrayBase { |
inline int osr_loop_nesting_level() const; |
inline void set_osr_loop_nesting_level(int depth); |
+ // Accessors for bytecode's code age. |
+ inline Age bytecode_age() const; |
+ inline void set_bytecode_age(Age age); |
+ |
// Accessors for the constant pool. |
DECL_ACCESSORS(constant_pool, FixedArray) |
@@ -5005,6 +5020,10 @@ class BytecodeArray : public FixedArrayBase { |
int LookupRangeInHandlerTable(int code_offset, int* data, |
HandlerTable::CatchPrediction* prediction); |
+ // Bytecode aging |
+ bool IsOld() const; |
+ void MakeOlder(); |
+ |
// Layout description. |
static const int kConstantPoolOffset = FixedArrayBase::kHeaderSize; |
static const int kHandlerTableOffset = kConstantPoolOffset + kPointerSize; |
@@ -5014,7 +5033,8 @@ class BytecodeArray : public FixedArrayBase { |
static const int kParameterSizeOffset = kFrameSizeOffset + kIntSize; |
static const int kInterruptBudgetOffset = kParameterSizeOffset + kIntSize; |
static const int kOSRNestingLevelOffset = kInterruptBudgetOffset + kIntSize; |
- static const int kHeaderSize = kOSRNestingLevelOffset + kCharSize; |
+ static const int kBytecodeAgeOffset = kOSRNestingLevelOffset + kCharSize; |
+ static const int kHeaderSize = kBytecodeAgeOffset + kCharSize; |
// Maximal memory consumption for a single BytecodeArray. |
static const int kMaxSize = 512 * MB; |