Index: src/objects.h |
diff --git a/src/objects.h b/src/objects.h |
index 475fbd4032684dce69426902a1289cbbbcd9e93f..0ae3483c7f1faaf4510104c35b92d248e74d26e2 100644 |
--- a/src/objects.h |
+++ b/src/objects.h |
@@ -5411,8 +5411,8 @@ class SharedFunctionInfo: public HeapObject { |
// A counter used to determine when to stress the deoptimizer with a |
// deopt. |
- inline int deopt_counter(); |
- inline void set_deopt_counter(int counter); |
+ inline int stress_deopt_counter(); |
+ inline void set_stress_deopt_counter(int counter); |
inline int profiler_ticks(); |
@@ -5540,9 +5540,26 @@ class SharedFunctionInfo: public HeapObject { |
bool HasSourceCode(); |
Handle<Object> GetSourceCode(); |
+ // Number of times the function was optimized. |
inline int opt_count(); |
inline void set_opt_count(int opt_count); |
+ // Number of times the function was deoptimized. |
+ inline void set_deopt_count(int value); |
+ inline int deopt_count(); |
+ inline void increment_deopt_count(); |
+ |
+ // Number of time we tried to re-enable optimization after it |
+ // was disabled due to high number of deoptimizations. |
+ inline void set_opt_reenable_tries(int value); |
+ inline int opt_reenable_tries(); |
+ |
+ inline void TryReenableOptimization(); |
+ |
+ // Stores deopt_count, opt_reenable_tries and ic_age as bit-fields. |
+ inline void set_counters(int value); |
+ inline int counters(); |
+ |
// Source size of this function. |
int SourceSize(); |
@@ -5599,13 +5616,14 @@ class SharedFunctionInfo: public HeapObject { |
kInferredNameOffset + kPointerSize; |
static const int kThisPropertyAssignmentsOffset = |
kInitialMapOffset + kPointerSize; |
- // ic_age is a Smi field. It could be grouped with another Smi field into a |
- // PSEUDO_SMI_ACCESSORS pair (on x64), if one becomes available. |
- static const int kICAgeOffset = kThisPropertyAssignmentsOffset + kPointerSize; |
+ // ast_node_count is a Smi field. It could be grouped with another Smi field |
+ // into a PSEUDO_SMI_ACCESSORS pair (on x64), if one becomes available. |
+ static const int kAstNodeCountOffset = |
+ kThisPropertyAssignmentsOffset + kPointerSize; |
#if V8_HOST_ARCH_32_BIT |
// Smi fields. |
static const int kLengthOffset = |
- kICAgeOffset + kPointerSize; |
+ kAstNodeCountOffset + kPointerSize; |
static const int kFormalParameterCountOffset = kLengthOffset + kPointerSize; |
static const int kExpectedNofPropertiesOffset = |
kFormalParameterCountOffset + kPointerSize; |
@@ -5623,12 +5641,11 @@ class SharedFunctionInfo: public HeapObject { |
kCompilerHintsOffset + kPointerSize; |
static const int kOptCountOffset = |
kThisPropertyAssignmentsCountOffset + kPointerSize; |
- static const int kAstNodeCountOffset = kOptCountOffset + kPointerSize; |
- static const int kDeoptCounterOffset = kAstNodeCountOffset + kPointerSize; |
- |
+ static const int kCountersOffset = kOptCountOffset + kPointerSize; |
+ static const int kStressDeoptCounterOffset = kCountersOffset + kPointerSize; |
// Total size. |
- static const int kSize = kDeoptCounterOffset + kPointerSize; |
+ static const int kSize = kStressDeoptCounterOffset + kPointerSize; |
#else |
// The only reason to use smi fields instead of int fields |
// is to allow iteration without maps decoding during |
@@ -5640,7 +5657,7 @@ class SharedFunctionInfo: public HeapObject { |
// word is not set and thus this word cannot be treated as pointer |
// to HeapObject during old space traversal. |
static const int kLengthOffset = |
- kICAgeOffset + kPointerSize; |
+ kAstNodeCountOffset + kPointerSize; |
static const int kFormalParameterCountOffset = |
kLengthOffset + kIntSize; |
@@ -5664,11 +5681,11 @@ class SharedFunctionInfo: public HeapObject { |
static const int kOptCountOffset = |
kThisPropertyAssignmentsCountOffset + kIntSize; |
- static const int kAstNodeCountOffset = kOptCountOffset + kIntSize; |
- static const int kDeoptCounterOffset = kAstNodeCountOffset + kIntSize; |
+ static const int kCountersOffset = kOptCountOffset + kIntSize; |
+ static const int kStressDeoptCounterOffset = kCountersOffset + kIntSize; |
// Total size. |
- static const int kSize = kDeoptCounterOffset + kIntSize; |
+ static const int kSize = kStressDeoptCounterOffset + kIntSize; |
#endif |
@@ -5721,6 +5738,10 @@ class SharedFunctionInfo: public HeapObject { |
kCompilerHintsCount // Pseudo entry |
}; |
+ class DeoptCountBits: public BitField<int, 0, 4> {}; |
+ class OptReenableTriesBits: public BitField<int, 4, 18> {}; |
+ class ICAgeBits: public BitField<int, 22, 8> {}; |
+ |
private: |
#if V8_HOST_ARCH_32_BIT |
// On 32 bit platforms, compiler hints is a smi. |