Revision: 15209
Author: [email protected]
Date: Wed Jun 19 10:00:01 2013
Log: Deprecate old code aging mechanism.
The old code aging mechanism is too agressive with flushing as it leads
to many functions being flushed and recompiled over and over again. By
now the new code aging mechanism has stabilized enough to deprecate the
old fallback mechanism.
[email protected]
Review URL: https://codereview.chromium.org/17061004
http://code.google.com/p/v8/source/detail?r=15209
Modified:
/branches/bleeding_edge/src/compiler.cc
/branches/bleeding_edge/src/flag-definitions.h
/branches/bleeding_edge/src/objects-inl.h
/branches/bleeding_edge/src/objects-visiting-inl.h
/branches/bleeding_edge/src/objects.cc
/branches/bleeding_edge/src/objects.h
=======================================
--- /branches/bleeding_edge/src/compiler.cc Wed Jun 19 00:48:41 2013
+++ /branches/bleeding_edge/src/compiler.cc Wed Jun 19 10:00:01 2013
@@ -811,7 +811,6 @@
// Check the function has compiled code.
ASSERT(shared->is_compiled());
- shared->set_code_age(0);
shared->set_dont_optimize(lit->flags()->Contains(kDontOptimize));
shared->set_dont_inline(lit->flags()->Contains(kDontInline));
shared->set_ast_node_count(lit->ast_node_count());
=======================================
--- /branches/bleeding_edge/src/flag-definitions.h Tue Jun 18 07:36:17 2013
+++ /branches/bleeding_edge/src/flag-definitions.h Wed Jun 19 10:00:01 2013
@@ -480,7 +480,7 @@
DEFINE_bool(trace_code_flushing, false, "trace code flushing progress")
DEFINE_bool(age_code, true,
"track un-executed functions to age code and flush only "
- "old code")
+ "old code (required for code flushing)")
DEFINE_bool(incremental_marking, true, "use incremental marking")
DEFINE_bool(incremental_marking_steps, true, "do incremental marking
steps")
DEFINE_bool(trace_incremental_marking, false,
=======================================
--- /branches/bleeding_edge/src/objects-inl.h Mon Jun 17 09:10:01 2013
+++ /branches/bleeding_edge/src/objects-inl.h Wed Jun 19 10:00:01 2013
@@ -4779,17 +4779,6 @@
ASSERT(HasBuiltinFunctionId());
return
static_cast<BuiltinFunctionId>(Smi::cast(function_data())->value());
}
-
-
-int SharedFunctionInfo::code_age() {
- return (compiler_hints() >> kCodeAgeShift) & kCodeAgeMask;
-}
-
-
-void SharedFunctionInfo::set_code_age(int code_age) {
- int hints = compiler_hints() & ~(kCodeAgeMask << kCodeAgeShift);
- set_compiler_hints(hints | ((code_age & kCodeAgeMask) << kCodeAgeShift));
-}
int SharedFunctionInfo::ic_age() {
=======================================
--- /branches/bleeding_edge/src/objects-visiting-inl.h Fri Jun 14 09:06:12
2013
+++ /branches/bleeding_edge/src/objects-visiting-inl.h Wed Jun 19 10:00:01
2013
@@ -606,11 +606,6 @@
// by optimized version of function.
MarkBit code_mark = Marking::MarkBitFrom(function->code());
if (code_mark.Get()) {
- if (!FLAG_age_code) {
- if (!Marking::MarkBitFrom(shared_info).Get()) {
- shared_info->set_code_age(0);
- }
- }
return false;
}
@@ -682,20 +677,12 @@
return false;
}
- if (FLAG_age_code) {
- return shared_info->code()->IsOld();
- } else {
- // How many collections newly compiled code object will survive before
being
- // flushed.
- static const int kCodeAgeThreshold = 5;
+ // Check age of code. If code aging is disabled we never flush.
+ if (!FLAG_age_code || !shared_info->code()->IsOld()) {
+ return false;
+ }
- // Age this shared function info.
- if (shared_info->code_age() < kCodeAgeThreshold) {
- shared_info->set_code_age(shared_info->code_age() + 1);
- return false;
- }
- return true;
- }
+ return true;
}
=======================================
--- /branches/bleeding_edge/src/objects.cc Mon Jun 17 10:42:27 2013
+++ /branches/bleeding_edge/src/objects.cc Wed Jun 19 10:00:01 2013
@@ -9403,7 +9403,6 @@
bool result = true;
if (function->shared()->is_compiled()) {
function->ReplaceCode(function->shared()->code());
- function->shared()->set_code_age(0);
} else {
ASSERT(function->shared()->allows_lazy_compilation());
CompilationInfoWithZone info(function);
=======================================
--- /branches/bleeding_edge/src/objects.h Wed Jun 19 02:25:24 2013
+++ /branches/bleeding_edge/src/objects.h Wed Jun 19 10:00:01 2013
@@ -4820,7 +4820,10 @@
};
#undef DECLARE_CODE_AGE_ENUM
- // Code aging
+ // Code aging. Indicates how many full GCs this code has survived
without
+ // being entered through the prologue. Used to determine when it is
+ // relatively safe to flush this code object and replace it with the lazy
+ // compilation stub.
static void MakeCodeAgeSequenceYoung(byte* sequence);
void MakeOlder(MarkingParity);
static bool IsYoungSequence(byte* sequence);
@@ -6139,14 +6142,6 @@
// iteration by the debugger).
DECL_BOOLEAN_ACCESSORS(allows_lazy_compilation_without_context)
- // Indicates how many full GCs this function has survived with assigned
- // code object. Used to determine when it is relatively safe to flush
- // this code object and replace it with lazy compilation stub.
- // Age is reset when GC notices that the code object is referenced
- // from the stack or compilation cache.
- inline int code_age();
- inline void set_code_age(int age);
-
// Indicates whether optimizations have been disabled for this
// shared function info. If a function is repeatedly optimized or if
// we cannot optimize the function we disable optimization to avoid
@@ -6390,15 +6385,11 @@
static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1);
// Bit positions in compiler_hints.
- static const int kCodeAgeSize = 3;
- static const int kCodeAgeMask = (1 << kCodeAgeSize) - 1;
-
enum CompilerHints {
kAllowLazyCompilation,
kAllowLazyCompilationWithoutContext,
kLiveObjectsMayExist,
- kCodeAgeShift,
- kOptimizationDisabled = kCodeAgeShift + kCodeAgeSize,
+ kOptimizationDisabled,
kStrictModeFunction,
kExtendedModeFunction,
kUsesArguments,
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.