Chromium Code Reviews| Index: src/objects.h |
| diff --git a/src/objects.h b/src/objects.h |
| index b376bcc30e2b7c9727f69d0481962ccdfe83ffbf..10df3aef564e16bd1d0474b7ee7e12ed628b46e8 100644 |
| --- a/src/objects.h |
| +++ b/src/objects.h |
| @@ -5028,6 +5028,16 @@ class SharedFunctionInfo: public HeapObject { |
| // To be called if generation failed for any reason. |
| void ForbidInlineConstructor(); |
| + // Contains the number of AST nodes in the function or kAstNodeCountMask |
| + // if the number of nodes is larger than kAstNodeCountMask. |
| + inline int ast_node_count(); |
| + inline void set_ast_node_count(int age); |
| + |
| + // Indicates whether the function is primitive or not. A primitive |
| + // function is a leaf function that does not call other functions |
| + // and does not contain complex statements (e.g. loops, try-catch). |
| + DECL_BOOLEAN_ACCESSORS(is_primitive) |
| + |
| // For functions which only contains this property assignments this provides |
| // access to the names for the properties assigned. |
| DECL_ACCESSORS(this_property_assignments, Object) |
| @@ -5191,6 +5201,10 @@ class SharedFunctionInfo: public HeapObject { |
| static const int kCodeAgeSize = 3; |
| static const int kCodeAgeMask = (1 << kCodeAgeSize) - 1; |
| + // Make sure that kAstNodeCountMask > HGraphBuilder::kMaxInlinedSize. |
|
Kevin Millikin (Chromium)
2011/11/28 12:11:59
STATIC_ASSERT-ing it in one place or the other is
ulan
2011/11/29 14:06:52
Done. Added assert to the other place.
|
| + static const int kAstNodeCountSize = 8; |
| + static const int kAstNodeCountMask = (1 << kAstNodeCountSize) - 1; |
| + |
| enum CompilerHints { |
| kHasOnlySimpleThisPropertyAssignments, |
| kAllowLazyCompilation, |
| @@ -5204,6 +5218,8 @@ class SharedFunctionInfo: public HeapObject { |
| kBoundFunction, |
| kIsAnonymous, |
| kNameShouldPrintAsAnonymous, |
| + kAstNodeCountShift, |
| + kIsPrimitive = kAstNodeCountShift + kAstNodeCountSize, |
| kCompilerHintsCount // Pseudo entry |
| }; |
| @@ -5218,8 +5234,9 @@ class SharedFunctionInfo: public HeapObject { |
| static const int kCompilerHintsSize = kIntSize; |
| #endif |
| + // One byte is reserved for the inobject slack counter. |
| STATIC_ASSERT(SharedFunctionInfo::kCompilerHintsCount <= |
| - SharedFunctionInfo::kCompilerHintsSize * kBitsPerByte); |
| + (SharedFunctionInfo::kCompilerHintsSize - 1) * kBitsPerByte); |
| public: |
| // Constants for optimizing codegen for strict mode function and |