Avoid pre-aging when debugger is active

BUG=None
R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/47023003

Patch from Ross McIlroy <rmcilroy@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17443 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 316271fc
......@@ -35,6 +35,7 @@
#include "codegen.h"
#include "cpu-profiler.h"
#include "debug.h"
#include "isolate-inl.h"
#include "runtime.h"
namespace v8 {
......@@ -926,7 +927,7 @@ void MacroAssembler::Prologue(PrologueFrameMode frame_mode) {
this, kNoCodeAgeSequenceLength * Assembler::kInstrSize);
// The following three instructions must remain together and unmodified
// for code aging to work properly.
if (FLAG_optimize_for_size && FLAG_age_code) {
if (isolate()->IsCodePreAgingActive()) {
// Pre-age the code.
Code* stub = Code::GetPreAgedCodeAgeStub(isolate());
add(r0, pc, Operand(-8));
......
......@@ -33,6 +33,7 @@
#include "codegen.h"
#include "cpu-profiler.h"
#include "debug.h"
#include "isolate-inl.h"
#include "runtime.h"
#include "serialize.h"
......@@ -1022,7 +1023,7 @@ void MacroAssembler::Prologue(PrologueFrameMode frame_mode) {
} else {
PredictableCodeSizeScope predictible_code_size_scope(this,
kNoCodeAgeSequenceLength);
if (FLAG_optimize_for_size && FLAG_age_code) {
if (isolate()->IsCodePreAgingActive()) {
// Pre-age the code.
call(isolate()->builtins()->MarkCodeAsExecutedOnce(),
RelocInfo::CODE_AGE_SEQUENCE);
......
......@@ -48,6 +48,11 @@ SaveContext::SaveContext(Isolate* isolate)
}
bool Isolate::IsCodePreAgingActive() {
return FLAG_optimize_for_size && FLAG_age_code && !IsDebuggerActive();
}
bool Isolate::IsDebuggerActive() {
#ifdef ENABLE_DEBUGGER_SUPPORT
if (!NoBarrier_Load(&debugger_initialized_)) return false;
......
......@@ -994,6 +994,8 @@ class Isolate {
void PreallocatedStorageDelete(void* p);
void PreallocatedStorageInit(size_t size);
inline bool IsCodePreAgingActive();
#ifdef ENABLE_DEBUGGER_SUPPORT
Debugger* debugger() {
if (!NoBarrier_Load(&debugger_initialized_)) InitializeDebugger();
......
......@@ -35,6 +35,7 @@
#include "codegen.h"
#include "cpu-profiler.h"
#include "debug.h"
#include "isolate-inl.h"
#include "runtime.h"
namespace v8 {
......@@ -4596,7 +4597,7 @@ void MacroAssembler::Prologue(PrologueFrameMode frame_mode) {
this, kNoCodeAgeSequenceLength * Assembler::kInstrSize);
// The following three instructions must remain together and unmodified
// for code aging to work properly.
if (FLAG_optimize_for_size && FLAG_age_code) {
if (isolate()->IsCodePreAgingActive()) {
// Pre-age the code.
Code* stub = Code::GetPreAgedCodeAgeStub(isolate());
nop(Assembler::CODE_AGE_MARKER_NOP);
......
......@@ -37,6 +37,7 @@
#include "serialize.h"
#include "debug.h"
#include "heap.h"
#include "isolate-inl.h"
namespace v8 {
namespace internal {
......@@ -3659,7 +3660,7 @@ void MacroAssembler::Prologue(PrologueFrameMode frame_mode) {
} else {
PredictableCodeSizeScope predictible_code_size_scope(this,
kNoCodeAgeSequenceLength);
if (FLAG_optimize_for_size && FLAG_age_code) {
if (isolate()->IsCodePreAgingActive()) {
// Pre-age the code.
Call(isolate()->builtins()->MarkCodeAsExecutedOnce(),
RelocInfo::CODE_AGE_SEQUENCE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment