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

Unified Diff: src/objects.h

Issue 8700008: New approach to Crankshaft decision-making (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix snapshot build and memory leaks Created 9 years 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
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 5af771828999fc9b9a0370c6e2736e298f93c019..a65d9ac45e8a2d164056ed86ec76c232dc483f38 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -4994,6 +4994,9 @@ class SharedFunctionInfo: public HeapObject {
inline Smi* deopt_counter();
inline void set_deopt_counter(Smi* counter);
+ inline int call_counter();
+ inline void set_call_counter(int count);
+
// Add information on assignments of the form this.x = ...;
void SetThisPropertyAssignmentsInfo(
bool has_only_simple_this_property_assignments,
@@ -5154,6 +5157,13 @@ class SharedFunctionInfo: public HeapObject {
// Constants.
static const int kDontAdaptArgumentsSentinel = -1;
+ // Number of calls until a "primitive" function triggers its own optimization.
+#if defined(V8_TARGET_ARCH_IA32) || defined(V8_TARGET_ARCH_X64)
+ static const int kCallsUntilPrimitiveOptimization = 20000;
+#elif defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_MIPS)
+ static const int kCallsUntilPrimitiveOptimization = 1000;
+#endif
+
// Layout description.
// Pointer fields.
static const int kNameOffset = HeapObject::kHeaderSize;
@@ -5171,8 +5181,10 @@ class SharedFunctionInfo: public HeapObject {
kInferredNameOffset + kPointerSize;
static const int kThisPropertyAssignmentsOffset =
kInitialMapOffset + kPointerSize;
- static const int kDeoptCounterOffset =
+ static const int kCallCounterOffset =
kThisPropertyAssignmentsOffset + kPointerSize;
+ static const int kDeoptCounterOffset =
+ kCallCounterOffset + kPointerSize;
#if V8_HOST_ARCH_32_BIT
// Smi fields.
static const int kLengthOffset =
@@ -5461,6 +5473,9 @@ class JSFunction: public JSObject {
// a weak list by the GC.
DECL_ACCESSORS(next_function_link, Object)
+ inline int profiler_ticks();
+ inline void set_profiler_ticks(int ticks);
+
// Prints the name of the function using PrintF.
inline void PrintName() {
PrintName(stdout);
@@ -5500,7 +5515,9 @@ class JSFunction: public JSObject {
kPrototypeOrInitialMapOffset + kPointerSize;
static const int kContextOffset = kSharedFunctionInfoOffset + kPointerSize;
static const int kLiteralsOffset = kContextOffset + kPointerSize;
- static const int kNonWeakFieldsEndOffset = kLiteralsOffset + kPointerSize;
+ static const int kProfilerTicksOffset = kLiteralsOffset + kPointerSize;
+ static const int kNonWeakFieldsEndOffset =
+ kProfilerTicksOffset + kPointerSize;
static const int kNextFunctionLinkOffset = kNonWeakFieldsEndOffset;
static const int kSize = kNextFunctionLinkOffset + kPointerSize;
« no previous file with comments | « src/mips/code-stubs-mips.cc ('k') | src/objects-inl.h » ('j') | src/platform-linux.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698