Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(565)

Unified Diff: src/objects.h

Issue 8677008: Relax inlining limits for simple leaf functions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/hydrogen.cc ('K') | « src/isolate.h ('k') | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
+ 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
« src/hydrogen.cc ('K') | « src/isolate.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698