ifeq ($(optdebug), on)
GYPFLAGS += -Dv8_optimized_debug=2
endif
-# debuggersupport=off
-ifeq ($(debuggersupport), off)
- GYPFLAGS += -Dv8_enable_debugger_support=0
-endif
# unalignedaccess=on
ifeq ($(unalignedaccess), on)
GYPFLAGS += -Dv8_can_use_unaligned_accesses=true
'variables': {
'v8_compress_startup_data%': 'off',
- 'v8_enable_debugger_support%': 1,
-
'v8_enable_disassembler%': 0,
'v8_enable_gdbjit%': 0,
},
'target_defaults': {
'conditions': [
- ['v8_enable_debugger_support==1', {
- 'defines': ['ENABLE_DEBUGGER_SUPPORT',],
- }],
['v8_enable_disassembler==1', {
'defines': ['ENABLE_DISASSEMBLER',],
}],
#include <v8.h>
-#ifdef ENABLE_DEBUGGER_SUPPORT
#include <v8-debug.h>
-#endif // ENABLE_DEBUGGER_SUPPORT
#include <fcntl.h>
#include <string.h>
bool report_exceptions);
-#ifdef ENABLE_DEBUGGER_SUPPORT
v8::Persistent<v8::Context> debug_message_context;
void DispatchDebugMessages() {
v8::Debug::ProcessDebugMessages();
}
-#endif // ENABLE_DEBUGGER_SUPPORT
int RunMain(int argc, char* argv[]) {
v8::Handle<v8::Value> script_name;
int script_param_counter = 0;
-#ifdef ENABLE_DEBUGGER_SUPPORT
int port_number = -1;
bool wait_for_connection = false;
bool support_callback = false;
-#endif // ENABLE_DEBUGGER_SUPPORT
MainCycleType cycle_type = CycleInCpp;
cycle_type = CycleInCpp;
} else if (strcmp(str, "--main-cycle-in-js") == 0) {
cycle_type = CycleInJs;
-#ifdef ENABLE_DEBUGGER_SUPPORT
} else if (strcmp(str, "--callback") == 0) {
support_callback = true;
} else if (strcmp(str, "--wait-for-connection") == 0) {
} else if (strcmp(str, "-p") == 0 && i + 1 < argc) {
port_number = atoi(argv[i + 1]); // NOLINT
i++;
-#endif // ENABLE_DEBUGGER_SUPPORT
} else if (strncmp(str, "--", 2) == 0) {
printf("Warning: unknown flag %s.\nTry --help for options\n", str);
} else if (strcmp(str, "-e") == 0 && i + 1 < argc) {
// Enter the newly created execution environment.
v8::Context::Scope context_scope(context);
-#ifdef ENABLE_DEBUGGER_SUPPORT
debug_message_context.Reset(isolate, context);
v8::Locker locker(isolate);
if (port_number != -1) {
v8::Debug::EnableAgent("lineprocessor", port_number, wait_for_connection);
}
-#endif // ENABLE_DEBUGGER_SUPPORT
bool report_exceptions = true;
v8::Local<v8::Context> context,
bool report_exceptions) {
v8::Isolate* isolate = context->GetIsolate();
-#ifdef ENABLE_DEBUGGER_SUPPORT
v8::Locker lock(isolate);
-#endif // ENABLE_DEBUGGER_SUPPORT
v8::Handle<v8::String> fun_name =
v8::String::NewFromUtf8(isolate, "ProcessLine");
char* res;
{
-#ifdef ENABLE_DEBUGGER_SUPPORT
v8::Unlocker unlocker(v8::Isolate::GetCurrent());
-#endif // ENABLE_DEBUGGER_SUPPORT
res = fgets(buffer, kBufferSize, stdin);
}
v8::Isolate* isolate = v8::Isolate::GetCurrent();
// --- D e b u g S u p p o r t ---
-#ifdef ENABLE_DEBUGGER_SUPPORT
-
bool Debug::SetDebugEventListener2(EventCallback2 that, Handle<Value> data) {
i::Isolate* isolate = i::Isolate::Current();
EnsureInitializedForIsolate(isolate, "v8::Debug::SetDebugEventListener2()");
}
-#endif // ENABLE_DEBUGGER_SUPPORT
-
-
Handle<String> CpuProfileNode::GetFunctionName() const {
i::Isolate* isolate = i::Isolate::Current();
const i::ProfileNode* node = reinterpret_cast<const i::ProfileNode*>(this);
visitor->VisitExternalReference(this);
} else if (RelocInfo::IsCodeAgeSequence(mode)) {
visitor->VisitCodeAgeSequence(this);
-#ifdef ENABLE_DEBUGGER_SUPPORT
} else if (((RelocInfo::IsJSReturn(mode) &&
IsPatchedReturnSequence()) ||
(RelocInfo::IsDebugBreakSlot(mode) &&
IsPatchedDebugBreakSlotSequence())) &&
isolate->debug()->has_break_points()) {
visitor->VisitDebugTarget(this);
-#endif
} else if (RelocInfo::IsRuntimeEntry(mode)) {
visitor->VisitRuntimeEntry(this);
}
StaticVisitor::VisitExternalReference(this);
} else if (RelocInfo::IsCodeAgeSequence(mode)) {
StaticVisitor::VisitCodeAgeSequence(heap, this);
-#ifdef ENABLE_DEBUGGER_SUPPORT
} else if (heap->isolate()->debug()->has_break_points() &&
((RelocInfo::IsJSReturn(mode) &&
IsPatchedReturnSequence()) ||
(RelocInfo::IsDebugBreakSlot(mode) &&
IsPatchedDebugBreakSlotSequence()))) {
StaticVisitor::VisitDebugTarget(heap, this);
-#endif
} else if (RelocInfo::IsRuntimeEntry(mode)) {
StaticVisitor::VisitRuntimeEntry(this);
}
void Assembler::RecordConstPool(int size) {
// We only need this for debugger support, to correctly compute offsets in the
// code.
-#ifdef ENABLE_DEBUGGER_SUPPORT
RecordRelocInfo(RelocInfo::CONST_POOL, static_cast<intptr_t>(size));
-#endif
}
Label rt_call, allocated;
if (FLAG_inline_new) {
Label undo_allocation;
-#ifdef ENABLE_DEBUGGER_SUPPORT
ExternalReference debug_step_in_fp =
ExternalReference::debug_step_in_fp_address(isolate);
__ mov(r2, Operand(debug_step_in_fp));
__ ldr(r2, MemOperand(r2));
__ tst(r2, r2);
__ b(ne, &rt_call);
-#endif
// Load the initial map and verify that it is in fact a map.
// r1: constructor function
namespace v8 {
namespace internal {
-#ifdef ENABLE_DEBUGGER_SUPPORT
bool BreakLocationIterator::IsDebugBreakAtReturn() {
return Debug::IsDebugBreakAtReturn(rinfo());
}
#undef __
-
-
-#endif // ENABLE_DEBUGGER_SUPPORT
-
} } // namespace v8::internal
#endif // V8_TARGET_ARCH_ARM
}
-#ifdef ENABLE_DEBUGGER_SUPPORT
void MacroAssembler::DebugBreak() {
mov(r0, Operand::Zero());
mov(r1, Operand(ExternalReference(Runtime::kDebugBreak, isolate())));
ASSERT(AllowThisStubCall(&ces));
Call(ces.GetCode(), RelocInfo::DEBUG_BREAK);
}
-#endif
void MacroAssembler::PushTryHandler(StackHandler::Kind kind,
Register scratch,
Label* fail);
-#ifdef ENABLE_DEBUGGER_SUPPORT
// ---------------------------------------------------------------------------
// Debugger Support
void DebugBreak();
-#endif
// ---------------------------------------------------------------------------
// Exception handling
visitor->VisitCell(this);
} else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
visitor->VisitExternalReference(this);
-#ifdef ENABLE_DEBUGGER_SUPPORT
} else if (((RelocInfo::IsJSReturn(mode) &&
IsPatchedReturnSequence()) ||
(RelocInfo::IsDebugBreakSlot(mode) &&
IsPatchedDebugBreakSlotSequence())) &&
isolate->debug()->has_break_points()) {
visitor->VisitDebugTarget(this);
-#endif
} else if (RelocInfo::IsRuntimeEntry(mode)) {
visitor->VisitRuntimeEntry(this);
}
StaticVisitor::VisitCell(heap, this);
} else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
StaticVisitor::VisitExternalReference(this);
-#ifdef ENABLE_DEBUGGER_SUPPORT
} else if (heap->isolate()->debug()->has_break_points() &&
((RelocInfo::IsJSReturn(mode) &&
IsPatchedReturnSequence()) ||
(RelocInfo::IsDebugBreakSlot(mode) &&
IsPatchedDebugBreakSlotSequence()))) {
StaticVisitor::VisitDebugTarget(heap, this);
-#endif
} else if (RelocInfo::IsRuntimeEntry(mode)) {
StaticVisitor::VisitRuntimeEntry(this);
}
void Assembler::RecordVeneerPool(int location_offset, int size) {
-#ifdef ENABLE_DEBUGGER_SUPPORT
RelocInfo rinfo(buffer_ + location_offset,
RelocInfo::VENEER_POOL, static_cast<intptr_t>(size),
NULL);
reloc_info_writer.Write(&rinfo);
-#endif
}
void Assembler::RecordConstPool(int size) {
// We only need this for debugger support, to correctly compute offsets in the
// code.
-#ifdef ENABLE_DEBUGGER_SUPPORT
RecordRelocInfo(RelocInfo::CONST_POOL, static_cast<intptr_t>(size));
-#endif
}
Label rt_call, allocated;
if (FLAG_inline_new) {
Label undo_allocation;
-#if ENABLE_DEBUGGER_SUPPORT
ExternalReference debug_step_in_fp =
ExternalReference::debug_step_in_fp_address(isolate);
__ Mov(x2, Operand(debug_step_in_fp));
__ Ldr(x2, MemOperand(x2));
__ Cbnz(x2, &rt_call);
-#endif
// Load the initial map and verify that it is in fact a map.
Register init_map = x2;
__ Ldr(init_map,
#define __ ACCESS_MASM(masm)
-
-#ifdef ENABLE_DEBUGGER_SUPPORT
bool BreakLocationIterator::IsDebugBreakAtReturn() {
return Debug::IsDebugBreakAtReturn(rinfo());
}
const bool Debug::kFrameDropperSupported = false;
-#endif // ENABLE_DEBUGGER_SUPPORT
-
} } // namespace v8::internal
#endif // V8_TARGET_ARCH_ARM64
}
-#ifdef ENABLE_DEBUGGER_SUPPORT
void MacroAssembler::DebugBreak() {
Mov(x0, 0);
Mov(x1, ExternalReference(Runtime::kDebugBreak, isolate()));
ASSERT(AllowThisStubCall(&ces));
Call(ces.GetCode(), RelocInfo::DEBUG_BREAK);
}
-#endif
void MacroAssembler::PushTryHandler(StackHandler::Kind kind,
MacroAssembler* masm_;
};
-#ifdef ENABLE_DEBUGGER_SUPPORT
// ---------------------------------------------------------------------------
// Debugger Support
void DebugBreak();
-#endif
+
// ---------------------------------------------------------------------------
// Exception handling
case RelocInfo::CONSTRUCT_CALL:
return "code target (js construct call)";
case RelocInfo::DEBUG_BREAK:
-#ifndef ENABLE_DEBUGGER_SUPPORT
- UNREACHABLE();
-#endif
return "debug break";
case RelocInfo::CODE_TARGET:
return "code target";
case RelocInfo::VENEER_POOL:
return "veneer pool";
case RelocInfo::DEBUG_BREAK_SLOT:
-#ifndef ENABLE_DEBUGGER_SUPPORT
- UNREACHABLE();
-#endif
return "debug break slot";
case RelocInfo::CODE_AGE_SEQUENCE:
return "code_age_sequence";
Object::VerifyPointer(target_cell());
break;
case DEBUG_BREAK:
-#ifndef ENABLE_DEBUGGER_SUPPORT
- UNREACHABLE();
- break;
-#endif
case CONSTRUCT_CALL:
case CODE_TARGET_WITH_ID:
case CODE_TARGET: {
Isolate* isolate)
: address_(Redirect(isolate, ic_utility.address())) {}
-#ifdef ENABLE_DEBUGGER_SUPPORT
ExternalReference::ExternalReference(const Debug_Address& debug_address,
Isolate* isolate)
: address_(debug_address.address(isolate)) {}
-#endif
ExternalReference::ExternalReference(StatsCounter* counter)
: address_(reinterpret_cast<Address>(counter->GetInternalPointer())) {}
}
-#ifdef ENABLE_DEBUGGER_SUPPORT
ExternalReference ExternalReference::debug_break(Isolate* isolate) {
return ExternalReference(Redirect(isolate, FUNCTION_ADDR(Debug_Break)));
}
Isolate* isolate) {
return ExternalReference(isolate->debug()->step_in_fp_addr());
}
-#endif
void PositionsRecorder::RecordPosition(int pos) {
//----------------------------------------------------------------------------
class IC_Utility;
class SCTableReference;
-#ifdef ENABLE_DEBUGGER_SUPPORT
class Debug_Address;
-#endif
// An ExternalReference represents a C++ address used in the generated
ExternalReference(const IC_Utility& ic_utility, Isolate* isolate);
-#ifdef ENABLE_DEBUGGER_SUPPORT
ExternalReference(const Debug_Address& debug_address, Isolate* isolate);
-#endif
explicit ExternalReference(StatsCounter* counter);
Address address() const { return reinterpret_cast<Address>(address_); }
-#ifdef ENABLE_DEBUGGER_SUPPORT
// Function Debug::Break()
static ExternalReference debug_break(Isolate* isolate);
// Used to check if single stepping is enabled in generated code.
static ExternalReference debug_step_in_fp_address(Isolate* isolate);
-#endif
#ifndef V8_INTERPRETED_REGEXP
// C functions called from RegExp generated code.
Vector<const char> name,
Handle<String> source) {
HandleScope scope(isolate);
-#ifdef ENABLE_DEBUGGER_SUPPORT
isolate->debugger()->set_compiling_natives(true);
-#endif
// During genesis, the boilerplate for stack overflow won't work until the
// environment has been at least partially initialized. Add a stack check
// before entering JS code to catch overflow early.
true);
ASSERT(isolate->has_pending_exception() != result);
if (!result) isolate->clear_pending_exception();
-#ifdef ENABLE_DEBUGGER_SUPPORT
isolate->debugger()->set_compiling_natives(false);
-#endif
return result;
}
false);
}
-#ifdef ENABLE_DEBUGGER_SUPPORT
// Expose the debug global object in global if a name for it is specified.
if (FLAG_expose_debug_as != NULL && strlen(FLAG_expose_debug_as) != 0) {
Debug* debug = isolate->debug();
global, debug_string, global_proxy, DONT_ENUM),
false);
}
-#endif
return true;
}
}
-#ifdef ENABLE_DEBUGGER_SUPPORT
static void Generate_LoadIC_DebugBreak(MacroAssembler* masm) {
Debug::GenerateLoadICDebugBreak(masm);
}
static void Generate_FrameDropper_LiveEdit(MacroAssembler* masm) {
Debug::GenerateFrameDropperLiveEdit(masm);
}
-#endif
Builtins::Builtins() : initialized_(false) {
V(LoadIC_Normal, LOAD_IC) \
V(StoreIC_Normal, STORE_IC)
-#ifdef ENABLE_DEBUGGER_SUPPORT
// Define list of builtins used by the debugger implemented in assembly.
#define BUILTIN_LIST_DEBUG_A(V) \
V(Return_DebugBreak, BUILTIN, DEBUG_STUB, \
DEBUG_BREAK) \
V(FrameDropper_LiveEdit, BUILTIN, DEBUG_STUB, \
DEBUG_BREAK)
-#else
-#define BUILTIN_LIST_DEBUG_A(V)
-#endif
// Define list of builtins implemented in JavaScript.
#define BUILTINS_LIST_JS(V) \
// the full compiler need not be be used if a debugger is attached, but only if
// break points has actually been set.
static bool IsDebuggerActive(Isolate* isolate) {
-#ifdef ENABLE_DEBUGGER_SUPPORT
return isolate->use_crankshaft() ?
isolate->debug()->has_break_points() :
isolate->debugger()->IsDebuggerActive();
-#else
- return false;
-#endif
}
}
-#ifdef ENABLE_DEBUGGER_SUPPORT
void Compiler::CompileForLiveEdit(Handle<Script> script) {
// TODO(635): support extensions.
CompilationInfoWithZone info(script);
}
tracker.RecordRootFunctionInfo(info.code());
}
-#endif
static bool DebuggerWantsEagerCompilation(CompilationInfo* info,
FixedArray* array = isolate->native_context()->embedder_data();
script->set_context_data(array->get(0));
-#ifdef ENABLE_DEBUGGER_SUPPORT
isolate->debugger()->OnBeforeCompile(script);
-#endif
ASSERT(info->is_eval() || info->is_global());
live_edit_tracker.RecordFunctionInfo(result, lit, info->zone());
}
-#ifdef ENABLE_DEBUGGER_SUPPORT
isolate->debugger()->OnAfterCompile(script, Debugger::NO_AFTER_COMPILE_FLAGS);
-#endif
return result;
}
info.SetParseRestriction(restriction);
info.SetContext(context);
-#if ENABLE_DEBUGGER_SUPPORT
Debug::RecordEvalCaller(script);
-#endif // ENABLE_DEBUGGER_SUPPORT
shared_info = CompileToplevel(&info);
MUST_USE_RESULT static MaybeHandle<Code> GetCodeForDebugging(
Handle<JSFunction> function);
-#ifdef ENABLE_DEBUGGER_SUPPORT
static void CompileForLiveEdit(Handle<Script> script);
-#endif
// Compile a String source within a context for eval.
MUST_USE_RESULT static MaybeHandle<JSFunction> GetFunctionFromEval(
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifdef ENABLE_DEBUGGER_SUPPORT
-
#include "d8.h"
#include "d8-debug.h"
#include "debug-agent.h"
} // namespace v8
-
-#endif // ENABLE_DEBUGGER_SUPPORT
#include "natives.h"
#include "platform.h"
#include "v8.h"
-#endif // V8_SHARED
+#endif // !V8_SHARED
#if !defined(_WIN32) && !defined(_WIN64)
#include <unistd.h> // NOLINT
i::Mutex Shell::context_mutex_;
const i::TimeTicks Shell::kInitialTicks = i::TimeTicks::HighResolutionNow();
Persistent<Context> Shell::utility_context_;
-#endif // V8_SHARED
+#endif // !V8_SHARED
Persistent<Context> Shell::evaluation_context_;
ShellOptions Shell::options;
const char* name2 = reinterpret_cast<const char*>(key2);
return strcmp(name1, name2) == 0;
}
-#endif // V8_SHARED
+#endif // !V8_SHARED
// Converts a V8 value to a C string.
Handle<Value> name,
bool print_result,
bool report_exceptions) {
-#if !defined(V8_SHARED) && defined(ENABLE_DEBUGGER_SUPPORT)
+#ifndef V8_SHARED
bool FLAG_debugger = i::FLAG_debugger;
#else
bool FLAG_debugger = false;
-#endif // !V8_SHARED && ENABLE_DEBUGGER_SUPPORT
+#endif // !V8_SHARED
HandleScope handle_scope(isolate);
TryCatch try_catch;
options.script_executed = true;
i::TimeDelta delta = i::TimeTicks::HighResolutionNow() - kInitialTicks;
args.GetReturnValue().Set(delta.InMillisecondsF());
}
-#endif // V8_SHARED
+#endif // !V8_SHARED
// Realm.current() returns the index of the currently active realm.
void Shell::ReportException(Isolate* isolate, v8::TryCatch* try_catch) {
HandleScope handle_scope(isolate);
-#if !defined(V8_SHARED) && defined(ENABLE_DEBUGGER_SUPPORT)
+#ifndef V8_SHARED
Handle<Context> utility_context;
bool enter_context = !isolate->InContext();
if (enter_context) {
utility_context = Local<Context>::New(isolate, utility_context_);
utility_context->Enter();
}
-#endif // !V8_SHARED && ENABLE_DEBUGGER_SUPPORT
+#endif // !V8_SHARED
v8::String::Utf8Value exception(try_catch->Exception());
const char* exception_string = ToCString(exception);
Handle<Message> message = try_catch->Message();
}
}
printf("\n");
-#if !defined(V8_SHARED) && defined(ENABLE_DEBUGGER_SUPPORT)
+#ifndef V8_SHARED
if (enter_context) utility_context->Exit();
-#endif // !V8_SHARED && ENABLE_DEBUGGER_SUPPORT
+#endif // !V8_SHARED
}
}
-#ifdef ENABLE_DEBUGGER_SUPPORT
Local<Object> Shell::DebugMessageDetails(Isolate* isolate,
Handle<String> message) {
EscapableHandleScope handle_scope(isolate);
v8::Context::Scope context_scope(context);
v8::Debug::ProcessDebugMessages();
}
-#endif // ENABLE_DEBUGGER_SUPPORT
-#endif // V8_SHARED
-#ifndef V8_SHARED
int32_t* Counter::Bind(const char* name, bool is_histogram) {
int i;
for (i = 0; i < kMaxNameSize - 1 && name[i]; i++)
evaluation_context->SetSecurityToken(Undefined(isolate));
v8::Context::Scope context_scope(utility_context);
-#ifdef ENABLE_DEBUGGER_SUPPORT
if (i::FLAG_debugger) printf("JavaScript debugger enabled\n");
// Install the debugger object in the utility scope
i::Debug* debug = reinterpret_cast<i::Isolate*>(isolate)->debug();
Utils::ToLocal(js_debug));
debug->debug_context()->set_security_token(
reinterpret_cast<i::Isolate*>(isolate)->heap()->undefined_value());
-#endif // ENABLE_DEBUGGER_SUPPORT
// Run the d8 shell utility script in the utility context
int source_index = i::NativesCollection<i::D8>::GetIndex("d8");
i::SharedFunctionInfo::cast(*compiled_script)->script()));
script_object->set_type(i::Smi::FromInt(i::Script::TYPE_NATIVE));
-#ifdef ENABLE_DEBUGGER_SUPPORT
// Start the in-process debugger if requested.
if (i::FLAG_debugger && !i::FLAG_debugger_agent) {
v8::Debug::SetDebugEventListener2(HandleDebugEvent);
}
-#endif // ENABLE_DEBUGGER_SUPPORT
}
-#endif // V8_SHARED
+#endif // !V8_SHARED
#ifdef COMPRESS_STARTUP_DATA_BZ2
FunctionTemplate::New(isolate, PerformanceNow));
global_template->Set(String::NewFromUtf8(isolate, "performance"),
performance_template);
-#endif // V8_SHARED
+#endif // !V8_SHARED
#if !defined(V8_SHARED) && !defined(_WIN32) && !defined(_WIN64)
Handle<ObjectTemplate> os_templ = ObjectTemplate::New(isolate);
AddOSMethods(isolate, os_templ);
global_template->Set(String::NewFromUtf8(isolate, "os"), os_templ);
-#endif // V8_SHARED
+#endif // !V8_SHARED && !_WIN32 && !_WIN64
return global_template;
}
V8::SetCreateHistogramFunction(CreateHistogram);
V8::SetAddHistogramSampleFunction(AddHistogramSample);
}
-#endif // V8_SHARED
+#endif // !V8_SHARED
}
utility_context_.Reset(isolate,
Context::New(isolate, NULL, global_template));
-#ifdef ENABLE_DEBUGGER_SUPPORT
// Start the debugger agent if requested.
if (i::FLAG_debugger_agent) {
v8::Debug::EnableAgent("d8 shell", i::FLAG_debugger_port, true);
v8::Debug::SetDebugMessageDispatchHandler(DispatchDebugMessages, true);
}
-#endif // ENABLE_DEBUGGER_SUPPORT
-#endif // V8_SHARED
+#endif // !V8_SHARED
}
#ifndef V8_SHARED
// This needs to be a critical section since this is not thread-safe
i::LockGuard<i::Mutex> lock_guard(&context_mutex_);
-#endif // V8_SHARED
+#endif // !V8_SHARED
// Initialize the global objects
Handle<ObjectTemplate> global_template = CreateGlobalTemplate(isolate);
EscapableHandleScope handle_scope(isolate);
factory->NewJSArrayWithElements(arguments_array);
context->Global()->Set(String::NewFromUtf8(isolate, "arguments"),
Utils::ToLocal(arguments_jsarray));
-#endif // V8_SHARED
+#endif // !V8_SHARED
return handle_scope.Escape(context);
}
inline bool operator<(const CounterAndKey& lhs, const CounterAndKey& rhs) {
return strcmp(lhs.key, rhs.key) < 0;
}
-#endif // V8_SHARED
+#endif // !V8_SHARED
void Shell::OnExit() {
}
delete counters_file_;
delete counter_map_;
-#endif // V8_SHARED
+#endif // !V8_SHARED
}
static char* ReadWord(char* data) {
return ReadToken(data, ' ');
}
-#endif // V8_SHARED
+#endif // !V8_SHARED
// Reads a file into a v8 string.
ptr = next_line;
}
}
-#endif // V8_SHARED
+#endif // !V8_SHARED
SourceGroup::~SourceGroup() {
#ifndef V8_SHARED
delete thread_;
thread_ = NULL;
-#endif // V8_SHARED
+#endif // !V8_SHARED
}
done_semaphore_.Wait();
}
}
-#endif // V8_SHARED
+#endif // !V8_SHARED
bool Shell::SetOptions(int argc, char* argv[]) {
#else
options.dump_heap_constants = true;
argv[i] = NULL;
-#endif
+#endif // V8_SHARED
} else if (strcmp(argv[i], "--throws") == 0) {
options.expected_to_throw = true;
argv[i] = NULL;
printf("-p requires a file containing a list of files as parameter\n");
return false;
}
-#endif // V8_SHARED
+#endif // !V8_SHARED
v8::V8::SetFlagsFromCommandLine(&argc, argv, true);
for (int i = 1; i < options.num_isolates; ++i) {
options.isolate_sources[i].StartExecuteInThread();
}
-#endif // V8_SHARED
+#endif // !V8_SHARED
{ // NOLINT
Locker lock(isolate);
{
if (options.last_run) {
// Keep using the same context in the interactive shell.
evaluation_context_.Reset(isolate, context);
-#if !defined(V8_SHARED) && defined(ENABLE_DEBUGGER_SUPPORT)
+#ifndef V8_SHARED
// If the interactive debugger is enabled make sure to activate
// it before running the files passed on the command line.
if (i::FLAG_debugger) {
InstallUtilityScript(isolate);
}
-#endif // !V8_SHARED && ENABLE_DEBUGGER_SUPPORT
+#endif // !V8_SHARED
}
{
Context::Scope cscope(context);
thread->Join();
delete thread;
}
-#endif // V8_SHARED
+#endif // !V8_SHARED
return 0;
}
printf("}\n");
#undef ROOT_LIST_CASE
}
-#endif // V8_SHARED
+#endif // !V8_SHARED
class ShellArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
}
-#if !defined(V8_SHARED) && defined(ENABLE_DEBUGGER_SUPPORT)
+#ifndef V8_SHARED
// Run remote debugger if requested, but never on --test
if (i::FLAG_remote_debugger && !options.test_shell) {
InstallUtilityScript(isolate);
RunRemoteDebugger(isolate, i::FLAG_debugger_port);
return 0;
}
-#endif // !V8_SHARED && ENABLE_DEBUGGER_SUPPORT
+#endif // !V8_SHARED
// Run interactive shell if explicitly requested or if no script has been
// executed, but never on --test
if (( options.interactive_shell || !options.script_executed )
&& !options.test_shell ) {
-#if !defined(V8_SHARED) && defined(ENABLE_DEBUGGER_SUPPORT)
+#ifndef V8_SHARED
if (!i::FLAG_debugger) {
InstallUtilityScript(isolate);
}
-#endif // !V8_SHARED && ENABLE_DEBUGGER_SUPPORT
+#endif // !V8_SHARED
RunShell(isolate);
}
}
#include "v8.h"
#else
#include "../include/v8.h"
-#endif // V8_SHARED
+#endif // !V8_SHARED
namespace v8 {
static bool Match(void* key1, void* key2);
i::HashMap hash_map_;
};
-#endif // V8_SHARED
+#endif // !V8_SHARED
class LineEditor {
next_semaphore_(0),
done_semaphore_(0),
thread_(NULL),
-#endif // V8_SHARED
+#endif // !V8_SHARED
argv_(NULL),
begin_offset_(0),
end_offset_(0) {}
i::Semaphore next_semaphore_;
i::Semaphore done_semaphore_;
i::Thread* thread_;
-#endif // V8_SHARED
+#endif // !V8_SHARED
void ExitShell(int exit_code);
Handle<String> ReadFile(Isolate* isolate, const char* name);
#ifndef V8_SHARED
num_parallel_files(0),
parallel_files(NULL),
-#endif // V8_SHARED
+#endif // !V8_SHARED
script_executed(false),
last_run(true),
send_idle_notification(false),
~ShellOptions() {
#ifndef V8_SHARED
delete[] parallel_files;
-#endif // V8_SHARED
+#endif // !V8_SHARED
delete[] isolate_sources;
}
#ifndef V8_SHARED
int num_parallel_files;
char** parallel_files;
-#endif // V8_SHARED
+#endif // !V8_SHARED
bool script_executed;
bool last_run;
bool send_idle_notification;
static void AddHistogramSample(void* histogram, int sample);
static void MapCounters(const char* name);
-#ifdef ENABLE_DEBUGGER_SUPPORT
static Local<Object> DebugMessageDetails(Isolate* isolate,
Handle<String> message);
static Local<Value> DebugCommandToJSONRequest(Isolate* isolate,
Handle<String> command);
static void DispatchDebugMessages();
-#endif // ENABLE_DEBUGGER_SUPPORT
static void PerformanceNow(const v8::FunctionCallbackInfo<v8::Value>& args);
-#endif // V8_SHARED
+#endif // !V8_SHARED
static void RealmCurrent(const v8::FunctionCallbackInfo<v8::Value>& args);
static void RealmOwner(const v8::FunctionCallbackInfo<v8::Value>& args);
static Counter* GetCounter(const char* name, bool is_histogram);
static void InstallUtilityScript(Isolate* isolate);
-#endif // V8_SHARED
+#endif // !V8_SHARED
static void Initialize(Isolate* isolate);
static void InitializeDebugger(Isolate* isolate);
static void RunShell(Isolate* isolate);
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifdef ENABLE_DEBUGGER_SUPPORT
-
#include "v8.h"
#include "debug.h"
#include "debug-agent.h"
}
} } // namespace v8::internal
-
-#endif // ENABLE_DEBUGGER_SUPPORT
#ifndef V8_DEBUG_AGENT_H_
#define V8_DEBUG_AGENT_H_
-#ifdef ENABLE_DEBUGGER_SUPPORT
#include "../include/v8-debug.h"
#include "platform.h"
} } // namespace v8::internal
-#endif // ENABLE_DEBUGGER_SUPPORT
-
#endif // V8_DEBUG_AGENT_H_
namespace v8 {
namespace internal {
-#ifdef ENABLE_DEBUGGER_SUPPORT
-
-
Debug::Debug(Isolate* isolate)
: has_break_points_(false),
script_cache_(NULL),
}
}
-#endif // ENABLE_DEBUGGER_SUPPORT
-
} } // namespace v8::internal
#include "string-stream.h"
#include "v8threads.h"
-#ifdef ENABLE_DEBUGGER_SUPPORT
#include "../include/v8-debug.h"
namespace v8 {
} } // namespace v8::internal
-#endif // ENABLE_DEBUGGER_SUPPORT
-
#endif // V8_DEBUG_H_
DeoptimizerData::DeoptimizerData(MemoryAllocator* allocator)
: allocator_(allocator),
-#ifdef ENABLE_DEBUGGER_SUPPORT
deoptimized_frame_info_(NULL),
-#endif
current_(NULL) {
for (int i = 0; i < Deoptimizer::kBailoutTypesWithCodeEntry; ++i) {
deopt_entry_code_entries_[i] = -1;
}
-#ifdef ENABLE_DEBUGGER_SUPPORT
void DeoptimizerData::Iterate(ObjectVisitor* v) {
if (deoptimized_frame_info_ != NULL) {
deoptimized_frame_info_->Iterate(v);
}
}
-#endif
Code* Deoptimizer::FindDeoptimizingCode(Address addr) {
}
-#ifdef ENABLE_DEBUGGER_SUPPORT
DeoptimizedFrameInfo* Deoptimizer::DebuggerInspectableFrame(
JavaScriptFrame* frame,
int jsframe_index,
delete info;
isolate->deoptimizer_data()->deoptimized_frame_info_ = NULL;
}
-#endif
+
void Deoptimizer::GenerateDeoptimizationEntries(MacroAssembler* masm,
int count,
}
-#ifdef ENABLE_DEBUGGER_SUPPORT
void Deoptimizer::MaterializeHeapNumbersForDebuggerInspectableFrame(
Address parameters_top,
uint32_t parameters_size,
}
}
}
-#endif
static const char* TraceValueType(bool is_smi) {
return new_array;
}
-#ifdef ENABLE_DEBUGGER_SUPPORT
DeoptimizedFrameInfo::DeoptimizedFrameInfo(Deoptimizer* deoptimizer,
int frame_index,
v->VisitPointers(expression_stack_, expression_stack_ + expression_count_);
}
-#endif // ENABLE_DEBUGGER_SUPPORT
-
} } // namespace v8::internal
Isolate* isolate);
static Deoptimizer* Grab(Isolate* isolate);
-#ifdef ENABLE_DEBUGGER_SUPPORT
// The returned object with information on the optimized frame needs to be
// freed before another one can be generated.
static DeoptimizedFrameInfo* DebuggerInspectableFrame(JavaScriptFrame* frame,
Isolate* isolate);
static void DeleteDebuggerInspectableFrame(DeoptimizedFrameInfo* info,
Isolate* isolate);
-#endif
// Makes sure that there is enough room in the relocation
// information of a code object to perform lazy deoptimization
~Deoptimizer();
void MaterializeHeapObjects(JavaScriptFrameIterator* it);
-#ifdef ENABLE_DEBUGGER_SUPPORT
+
void MaterializeHeapNumbersForDebuggerInspectableFrame(
Address parameters_top,
uint32_t parameters_size,
Address expressions_top,
uint32_t expressions_size,
DeoptimizedFrameInfo* info);
-#endif
static void ComputeOutputFrames(Deoptimizer* deoptimizer);
explicit DeoptimizerData(MemoryAllocator* allocator);
~DeoptimizerData();
-#ifdef ENABLE_DEBUGGER_SUPPORT
void Iterate(ObjectVisitor* v);
-#endif
private:
MemoryAllocator* allocator_;
int deopt_entry_code_entries_[Deoptimizer::kBailoutTypesWithCodeEntry];
MemoryChunk* deopt_entry_code_[Deoptimizer::kBailoutTypesWithCodeEntry];
-#ifdef ENABLE_DEBUGGER_SUPPORT
DeoptimizedFrameInfo* deoptimized_frame_info_;
-#endif
Deoptimizer* current_;
};
-#ifdef ENABLE_DEBUGGER_SUPPORT
// Class used to represent an unoptimized frame when the debugger
// needs to inspect a frame that is part of an optimized frame. The
// internally used FrameDescription objects are not GC safe so for use
friend class Deoptimizer;
};
-#endif
} } // namespace v8::internal
ASSERT(has_exception == isolate->has_pending_exception());
if (has_exception) {
isolate->ReportPendingMessages();
-#ifdef ENABLE_DEBUGGER_SUPPORT
// Reset stepping state when script exits with uncaught exception.
if (isolate->debugger()->IsDebuggerActive()) {
isolate->debug()->ClearStepping();
}
-#endif // ENABLE_DEBUGGER_SUPPORT
return MaybeHandle<Object>();
} else {
isolate->clear_pending_message();
}
-#ifdef ENABLE_DEBUGGER_SUPPORT
bool StackGuard::IsDebugBreak() {
ExecutionAccess access(isolate_);
return thread_local_.interrupt_flags_ & DEBUGBREAK;
thread_local_.interrupt_flags_ |= DEBUGCOMMAND;
set_interrupt_limits(access);
}
-#endif
+
void StackGuard::Continue(InterruptFlag after_what) {
ExecutionAccess access(isolate_);
// Clear the preempt request flag.
isolate->stack_guard()->Continue(PREEMPT);
-#ifdef ENABLE_DEBUGGER_SUPPORT
if (isolate->debug()->InDebugger()) {
// If currently in the debugger don't do any actual preemption but record
// that preemption occoured while in the debugger.
v8::Unlocker unlocker(reinterpret_cast<v8::Isolate*>(isolate));
Thread::YieldCPU();
}
-#else
- { // NOLINT
- // Perform preemption.
- v8::Unlocker unlocker(reinterpret_cast<v8::Isolate*>(isolate));
- Thread::YieldCPU();
- }
-#endif
return isolate->heap()->undefined_value();
}
-#ifdef ENABLE_DEBUGGER_SUPPORT
Object* Execution::DebugBreakHelper(Isolate* isolate) {
// Just continue if breaks are disabled.
if (isolate->debug()->disable_break()) {
isolate->debugger()->OnDebugBreak(isolate->factory()->undefined_value(),
debug_command_only);
}
-#endif
+
Object* Execution::HandleStackGuardInterrupt(Isolate* isolate) {
StackGuard* stack_guard = isolate->stack_guard();
isolate->counters()->stack_interrupts()->Increment();
isolate->counters()->runtime_profiler_ticks()->Increment();
-#ifdef ENABLE_DEBUGGER_SUPPORT
if (stack_guard->IsDebugBreak() || stack_guard->IsDebugCommand()) {
DebugBreakHelper(isolate);
}
-#endif
if (stack_guard->IsPreempted()) RuntimePreempt(isolate);
if (stack_guard->IsTerminateExecution()) {
stack_guard->Continue(TERMINATE);
Handle<JSFunction> fun,
Handle<Object> pos,
Handle<Object> is_global);
-#ifdef ENABLE_DEBUGGER_SUPPORT
+
static Object* DebugBreakHelper(Isolate* isolate);
static void ProcessDebugMessages(Isolate* isolate, bool debug_command_only);
-#endif
// If the stack guard is triggered, but it is not an actual
// stack overflow, then handle the interruption accordingly.
bool IsTerminateExecution();
void TerminateExecution();
void CancelTerminateExecution();
-#ifdef ENABLE_DEBUGGER_SUPPORT
bool IsDebugBreak();
void DebugBreak();
bool IsDebugCommand();
void DebugCommand();
-#endif
bool IsGCRequest();
void RequestGC();
bool IsInstallCodeRequest();
desc.origin->PopulateConstantPool(*constant_pool);
code->set_constant_pool(*constant_pool);
-#ifdef ENABLE_DEBUGGER_SUPPORT
if (code->kind() == Code::FUNCTION) {
code->set_has_debug_break_slots(isolate()->debugger()->IsDebuggerActive());
}
-#endif
// Allow self references to created code object by patching the handle to
// point to the newly allocated Code object.
}
-#ifdef ENABLE_DEBUGGER_SUPPORT
Handle<DebugInfo> Factory::NewDebugInfo(Handle<SharedFunctionInfo> shared) {
// Get the original code of the function.
Handle<Code> code(shared->code());
return debug_info;
}
-#endif
Handle<JSObject> Factory::NewArgumentsObject(Handle<Object> callee,
Handle<Object> script,
Handle<Object> stack_frames);
-#ifdef ENABLE_DEBUGGER_SUPPORT
Handle<DebugInfo> NewDebugInfo(Handle<SharedFunctionInfo> shared);
-#endif
// Return a map using the map cache in the native context.
// The key the an ordered set of property names.
DEFINE_bool(help, false, "Print usage message, including flags, on console")
DEFINE_bool(dump_counters, false, "Dump counters on exit")
-#ifdef ENABLE_DEBUGGER_SUPPORT
DEFINE_bool(debugger, false, "Enable JavaScript debugger")
DEFINE_bool(remote_debugger, false, "Connect JavaScript debugger to the "
"debugger agent in another process")
DEFINE_bool(debugger_agent, false, "Enable debugger agent")
DEFINE_int(debugger_port, 5858, "Port to use for remote debugging")
-#endif // ENABLE_DEBUGGER_SUPPORT
DEFINE_string(map_counters, "", "Map counters to a file")
DEFINE_args(js_arguments,
cgen.PopulateTypeFeedbackInfo(code);
code->set_has_deoptimization_support(info->HasDeoptimizationSupport());
code->set_handler_table(*cgen.handler_table());
-#ifdef ENABLE_DEBUGGER_SUPPORT
code->set_compiled_optimizable(info->IsOptimizable());
-#endif // ENABLE_DEBUGGER_SUPPORT
code->set_allow_osr_at_loop_nesting_level(0);
code->set_profiler_ticks(0);
code->set_back_edge_table_offset(table_offset);
void FullCodeGenerator::SetStatementPosition(Statement* stmt) {
-#ifdef ENABLE_DEBUGGER_SUPPORT
if (!isolate()->debugger()->IsDebuggerActive()) {
CodeGenerator::RecordPositions(masm_, stmt->position());
} else {
Debug::GenerateSlot(masm_);
}
}
-#else
- CodeGenerator::RecordPositions(masm_, stmt->position());
-#endif
}
void FullCodeGenerator::SetExpressionPosition(Expression* expr) {
-#ifdef ENABLE_DEBUGGER_SUPPORT
if (!isolate()->debugger()->IsDebuggerActive()) {
CodeGenerator::RecordPositions(masm_, expr->position());
} else {
Debug::GenerateSlot(masm_);
}
}
-#else
- CodeGenerator::RecordPositions(masm_, expr->position());
-#endif
}
void FullCodeGenerator::VisitDebuggerStatement(DebuggerStatement* stmt) {
-#ifdef ENABLE_DEBUGGER_SUPPORT
Comment cmnt(masm_, "[ DebuggerStatement");
SetStatementPosition(stmt);
__ DebugBreak();
// Ignore the return value.
-#endif
}
GlobalObject* global = context->global_object();
if (global->IsJSGlobalObject()) {
bool is_debug_object = false;
-#ifdef ENABLE_DEBUGGER_SUPPORT
is_debug_object = heap_->isolate()->debug()->IsDebugGlobal(global);
-#endif
if (!is_debug_object && !user_roots_.Contains(global)) {
user_roots_.Insert(global);
SetUserGlobalReference(global);
#undef UPDATE_FRAGMENTATION_FOR_SPACE
#undef UPDATE_COUNTERS_AND_FRAGMENTATION_FOR_SPACE
-#if defined(DEBUG)
+#ifdef DEBUG
ReportStatisticsAfterGC();
#endif // DEBUG
-#ifdef ENABLE_DEBUGGER_SUPPORT
isolate_->debug()->AfterGarbageCollection();
-#endif // ENABLE_DEBUGGER_SUPPORT
}
Relocatable::Iterate(isolate_, v);
v->Synchronize(VisitorSynchronization::kRelocatable);
-#ifdef ENABLE_DEBUGGER_SUPPORT
isolate_->debug()->Iterate(v);
if (isolate_->deoptimizer_data() != NULL) {
isolate_->deoptimizer_data()->Iterate(v);
}
-#endif
v->Synchronize(VisitorSynchronization::kDebug);
isolate_->compilation_cache()->Iterate(v);
v->Synchronize(VisitorSynchronization::kCompilationCache);
CPU::FlushICache(pc_, sizeof(Address));
} else if (RelocInfo::IsCodeAgeSequence(mode)) {
visitor->VisitCodeAgeSequence(this);
- #ifdef ENABLE_DEBUGGER_SUPPORT
} else if (((RelocInfo::IsJSReturn(mode) &&
IsPatchedReturnSequence()) ||
(RelocInfo::IsDebugBreakSlot(mode) &&
IsPatchedDebugBreakSlotSequence())) &&
isolate->debug()->has_break_points()) {
visitor->VisitDebugTarget(this);
-#endif
} else if (IsRuntimeEntry(mode)) {
visitor->VisitRuntimeEntry(this);
}
CPU::FlushICache(pc_, sizeof(Address));
} else if (RelocInfo::IsCodeAgeSequence(mode)) {
StaticVisitor::VisitCodeAgeSequence(heap, this);
-#ifdef ENABLE_DEBUGGER_SUPPORT
} else if (heap->isolate()->debug()->has_break_points() &&
((RelocInfo::IsJSReturn(mode) &&
IsPatchedReturnSequence()) ||
(RelocInfo::IsDebugBreakSlot(mode) &&
IsPatchedDebugBreakSlotSequence()))) {
StaticVisitor::VisitDebugTarget(heap, this);
-#endif
} else if (IsRuntimeEntry(mode)) {
StaticVisitor::VisitRuntimeEntry(this);
}
Label rt_call, allocated;
if (FLAG_inline_new) {
Label undo_allocation;
-#ifdef ENABLE_DEBUGGER_SUPPORT
ExternalReference debug_step_in_fp =
ExternalReference::debug_step_in_fp_address(masm->isolate());
__ cmp(Operand::StaticVariable(debug_step_in_fp), Immediate(0));
__ j(not_equal, &rt_call);
-#endif
// Verified that the constructor is a JSFunction.
// Load the initial map and verify that it is in fact a map.
namespace v8 {
namespace internal {
-#ifdef ENABLE_DEBUGGER_SUPPORT
-
bool BreakLocationIterator::IsDebugBreakAtReturn() {
return Debug::IsDebugBreakAtReturn(rinfo());
}
#undef __
-#endif // ENABLE_DEBUGGER_SUPPORT
-
} } // namespace v8::internal
#endif // V8_TARGET_ARCH_IA32
int arguments_bytes = (info_->scope()->num_parameters() + 1) * kPointerSize;
__ Ret(arguments_bytes, ecx);
-#ifdef ENABLE_DEBUGGER_SUPPORT
// Check that the size of the code used for returning is large enough
// for the debugger's requirements.
ASSERT(Assembler::kJSReturnSequenceLength <=
masm_->SizeOfCodeGeneratedSince(&check_exit_codesize));
-#endif
info_->AddNoFrameRange(no_frame_start, masm_->pc_offset());
}
}
}
-#ifdef ENABLE_DEBUGGER_SUPPORT
void MacroAssembler::DebugBreak() {
Move(eax, Immediate(0));
mov(ebx, Immediate(ExternalReference(Runtime::kDebugBreak, isolate())));
CEntryStub ces(isolate(), 1);
call(ces.GetCode(), RelocInfo::DEBUG_BREAK);
}
-#endif
void MacroAssembler::Cvtsi2sd(XMMRegister dst, const Operand& src) {
Register scratch2,
SaveFPRegsMode save_fp);
-#ifdef ENABLE_DEBUGGER_SUPPORT
// ---------------------------------------------------------------------------
// Debugger Support
void DebugBreak();
-#endif
// Generates function and stub prologue code.
void Prologue(PrologueFrameMode frame_mode);
// Get the address of the call.
Address result = Assembler::target_address_from_return_address(pc());
-#ifdef ENABLE_DEBUGGER_SUPPORT
Debug* debug = isolate()->debug();
// First check if any break points are active if not just return the address
// of the call.
// No break point here just return the address of the call.
return result;
}
-#else
- return result;
-#endif
}
return NULL;
} else {
Handle<ConstantPoolArray> result = raw_constant_pool_;
-#ifdef ENABLE_DEBUGGER_SUPPORT
Debug* debug = isolate()->debug();
// First check if any break points are active if not just return the
// original constant pool.
// constant pool for the original code instead of the breakpointed code.
return GetOriginalCode()->constant_pool();
}
-#endif
return *result;
}
}
}
-#ifdef ENABLE_DEBUGGER_SUPPORT
SharedFunctionInfo* IC::GetSharedFunctionInfo() const {
// Compute the JavaScript frame for the frame pointer of this IC
// structure. We need this to be able to find the function
ASSERT(original_code->IsCode());
return original_code;
}
-#endif
static bool HasInterceptorGetter(JSObject* object) {
Address pc() const { return *pc_address_; }
Isolate* isolate() const { return isolate_; }
-#ifdef ENABLE_DEBUGGER_SUPPORT
// Get the shared function info of the caller.
SharedFunctionInfo* GetSharedFunctionInfo() const;
// Get the code object of the caller.
Code* GetCode() const;
// Get the original (non-breakpointed) code object of the caller.
Code* GetOriginalCode() const;
-#endif
// Set the call-site target.
void set_target(Code* code) {
bool Isolate::IsDebuggerActive() {
-#ifdef ENABLE_DEBUGGER_SUPPORT
if (!NoBarrier_Load(&debugger_initialized_)) return false;
return debugger()->IsDebuggerActive();
-#else
- return false;
-#endif
}
bool Isolate::DebuggerHasBreakPoints() {
-#ifdef ENABLE_DEBUGGER_SUPPORT
return debug()->has_break_points();
-#else
- return false;
-#endif
}
thread_local_top()->rethrowing_message_ = false;
-#ifdef ENABLE_DEBUGGER_SUPPORT
// Notify debugger of exception.
if (catchable_by_javascript) {
debugger_->OnException(
exception_handle, report_exception, factory()->undefined_value());
}
-#endif
// Generate the message if required.
if (report_exception || try_catch_needs_message) {
Handle<Context> Isolate::GetCallingNativeContext() {
JavaScriptFrameIterator it(this);
-#ifdef ENABLE_DEBUGGER_SUPPORT
if (debug_->InDebugger()) {
while (!it.done()) {
JavaScriptFrame* frame = it.frame();
}
}
}
-#endif // ENABLE_DEBUGGER_SUPPORT
if (it.done()) return Handle<Context>::null();
JavaScriptFrame* frame = it.frame();
Context* context = Context::cast(frame->context());
memset(&js_spill_information_, 0, sizeof(js_spill_information_));
#endif
-#ifdef ENABLE_DEBUGGER_SUPPORT
debug_ = NULL;
debugger_ = NULL;
-#endif
handle_scope_data_.Initialize();
if (state_ == INITIALIZED) {
TRACE_ISOLATE(deinit);
-#ifdef ENABLE_DEBUGGER_SUPPORT
debugger()->UnloadDebugger();
-#endif
if (concurrent_recompilation_enabled()) {
optimizing_compiler_thread_->Stop();
delete random_number_generator_;
random_number_generator_ = NULL;
-#ifdef ENABLE_DEBUGGER_SUPPORT
delete debugger_;
debugger_ = NULL;
delete debug_;
debug_ = NULL;
-#endif
}
void Isolate::InitializeDebugger() {
-#ifdef ENABLE_DEBUGGER_SUPPORT
LockGuard<RecursiveMutex> lock_guard(debugger_access());
if (NoBarrier_Load(&debugger_initialized_)) return;
InitializeLoggingAndCounters();
debug_ = new Debug(this);
debugger_ = new Debugger(this);
Release_Store(&debugger_initialized_, true);
-#endif
}
}
}
-#ifdef ENABLE_DEBUGGER_SUPPORT
debug_->SetUp(create_heap_objects);
-#endif
// If we are deserializing, read the state into the now-empty heap.
if (!create_heap_objects) {
typedef void* ExternalReferenceRedirectorPointer();
-#ifdef ENABLE_DEBUGGER_SUPPORT
class Debug;
class Debugger;
class DebuggerAgent;
-#endif
#if !defined(__arm__) && V8_TARGET_ARCH_ARM || \
!defined(__aarch64__) && V8_TARGET_ARCH_ARM64 || \
};
-#ifdef ENABLE_DEBUGGER_SUPPORT
-
-#define ISOLATE_DEBUGGER_INIT_LIST(V) \
- V(DebuggerAgent*, debugger_agent_instance, NULL)
-#else
-
-#define ISOLATE_DEBUGGER_INIT_LIST(V)
-
-#endif
-
-
#if V8_TARGET_ARCH_ARM && !defined(__arm__) || \
V8_TARGET_ARCH_ARM64 && !defined(__aarch64__) || \
V8_TARGET_ARCH_MIPS && !defined(__mips__)
V(bool, fp_stubs_generated, false) \
V(int, max_available_threads, 0) \
V(uint32_t, per_isolate_assert_data, 0xFFFFFFFFu) \
- ISOLATE_INIT_SIMULATOR_LIST(V) \
- ISOLATE_DEBUGGER_INIT_LIST(V)
+ V(DebuggerAgent*, debugger_agent_instance, NULL) \
+ ISOLATE_INIT_SIMULATOR_LIST(V)
#define THREAD_LOCAL_TOP_ACCESSOR(type, name) \
inline void set_##name(type v) { thread_local_top_.name##_ = v; } \
inline bool IsCodePreAgingActive();
-#ifdef ENABLE_DEBUGGER_SUPPORT
Debugger* debugger() {
if (!NoBarrier_Load(&debugger_initialized_)) InitializeDebugger();
return debugger_;
if (!NoBarrier_Load(&debugger_initialized_)) InitializeDebugger();
return debug_;
}
-#endif
inline bool IsDebuggerActive();
inline bool DebuggerHasBreakPoints();
JSObject::SpillInformation js_spill_information_;
#endif
-#ifdef ENABLE_DEBUGGER_SUPPORT
Debugger* debugger_;
Debug* debug_;
-#endif
CpuProfiler* cpu_profiler_;
HeapProfiler* heap_profiler_;
FunctionEntryHook function_entry_hook_;
namespace v8 {
namespace internal {
-
-#ifdef ENABLE_DEBUGGER_SUPPORT
-
-
void SetElementSloppy(Handle<JSObject> object,
uint32_t index,
Handle<Object> value) {
return isolate->active_function_info_listener() != NULL;
}
-
-#else // ENABLE_DEBUGGER_SUPPORT
-
-// This ifdef-else-endif section provides working or stub implementation of
-// LiveEditFunctionTracker.
-LiveEditFunctionTracker::LiveEditFunctionTracker(Isolate* isolate,
- FunctionLiteral* fun) {
-}
-
-
-LiveEditFunctionTracker::~LiveEditFunctionTracker() {
-}
-
-
-void LiveEditFunctionTracker::RecordFunctionInfo(
- Handle<SharedFunctionInfo> info, FunctionLiteral* lit,
- Zone* zone) {
-}
-
-
-void LiveEditFunctionTracker::RecordRootFunctionInfo(Handle<Code> code) {
-}
-
-
-bool LiveEditFunctionTracker::IsActive(Isolate* isolate) {
- return false;
-}
-
-#endif // ENABLE_DEBUGGER_SUPPORT
-
-
-
} } // namespace v8::internal
static bool IsActive(Isolate* isolate);
private:
-#ifdef ENABLE_DEBUGGER_SUPPORT
Isolate* isolate_;
-#endif
};
-#ifdef ENABLE_DEBUGGER_SUPPORT
class LiveEdit : AllStatic {
public:
friend class JSArrayBasedStruct<SharedInfoWrapper>;
};
-#endif // ENABLE_DEBUGGER_SUPPORT
-
-
} } // namespace v8::internal
#endif /* V*_LIVEEDIT_H_ */
void MarkCompactCollector::EnableCodeFlushing(bool enable) {
-#ifdef ENABLE_DEBUGGER_SUPPORT
if (isolate()->debug()->IsLoaded() ||
isolate()->debug()->has_break_points()) {
enable = false;
}
-#endif
if (enable) {
if (code_flusher_ != NULL) return;
visitor->VisitExternalReference(this);
} else if (RelocInfo::IsCodeAgeSequence(mode)) {
visitor->VisitCodeAgeSequence(this);
-#ifdef ENABLE_DEBUGGER_SUPPORT
} else if (((RelocInfo::IsJSReturn(mode) &&
IsPatchedReturnSequence()) ||
(RelocInfo::IsDebugBreakSlot(mode) &&
IsPatchedDebugBreakSlotSequence())) &&
isolate->debug()->has_break_points()) {
visitor->VisitDebugTarget(this);
-#endif
} else if (RelocInfo::IsRuntimeEntry(mode)) {
visitor->VisitRuntimeEntry(this);
}
StaticVisitor::VisitExternalReference(this);
} else if (RelocInfo::IsCodeAgeSequence(mode)) {
StaticVisitor::VisitCodeAgeSequence(heap, this);
-#ifdef ENABLE_DEBUGGER_SUPPORT
} else if (heap->isolate()->debug()->has_break_points() &&
((RelocInfo::IsJSReturn(mode) &&
IsPatchedReturnSequence()) ||
(RelocInfo::IsDebugBreakSlot(mode) &&
IsPatchedDebugBreakSlotSequence()))) {
StaticVisitor::VisitDebugTarget(heap, this);
-#endif
} else if (RelocInfo::IsRuntimeEntry(mode)) {
StaticVisitor::VisitRuntimeEntry(this);
}
// the preconditions is not met, the code bails out to the runtime call.
if (FLAG_inline_new) {
Label undo_allocation;
-#ifdef ENABLE_DEBUGGER_SUPPORT
ExternalReference debug_step_in_fp =
ExternalReference::debug_step_in_fp_address(isolate);
__ li(a2, Operand(debug_step_in_fp));
__ lw(a2, MemOperand(a2));
__ Branch(&rt_call, ne, a2, Operand(zero_reg));
-#endif
// Load the initial map and verify that it is in fact a map.
// a1: constructor function
namespace v8 {
namespace internal {
-#ifdef ENABLE_DEBUGGER_SUPPORT
-
bool BreakLocationIterator::IsDebugBreakAtReturn() {
return Debug::IsDebugBreakAtReturn(rinfo());
}
#undef __
-
-#endif // ENABLE_DEBUGGER_SUPPORT
-
} } // namespace v8::internal
#endif // V8_TARGET_ARCH_MIPS
}
-#ifdef ENABLE_DEBUGGER_SUPPORT
-
void MacroAssembler::DebugBreak() {
PrepareCEntryArgs(0);
PrepareCEntryFunction(ExternalReference(Runtime::kDebugBreak, isolate()));
Call(ces.GetCode(), RelocInfo::DEBUG_BREAK);
}
-#endif // ENABLE_DEBUGGER_SUPPORT
-
// ---------------------------------------------------------------------------
// Exception handling.
Register scratch,
Label* fail);
-#ifdef ENABLE_DEBUGGER_SUPPORT
// -------------------------------------------------------------------------
// Debugger Support.
void DebugBreak();
-#endif
-
// -------------------------------------------------------------------------
// Exception handling.
}
-#ifdef ENABLE_DEBUGGER_SUPPORT
void DebugInfo::DebugInfoVerify() {
CHECK(IsDebugInfo());
VerifyPointer(shared());
statement_position()->SmiVerify();
VerifyPointer(break_point_objects());
}
-#endif // ENABLE_DEBUGGER_SUPPORT
#endif // VERIFY_HEAP
#ifdef DEBUG
}
-#ifdef ENABLE_DEBUGGER_SUPPORT
ACCESSORS(DebugInfo, shared, SharedFunctionInfo, kSharedFunctionInfoIndex)
ACCESSORS(DebugInfo, original_code, Code, kOriginalCodeIndex)
ACCESSORS(DebugInfo, code, Code, kPatchedCodeIndex)
ACCESSORS_TO_SMI(BreakPointInfo, source_position, kSourcePositionIndex)
ACCESSORS_TO_SMI(BreakPointInfo, statement_position, kStatementPositionIndex)
ACCESSORS(BreakPointInfo, break_point_objects, Object, kBreakPointObjectsIndex)
-#endif
ACCESSORS(SharedFunctionInfo, name, Object, kNameOffset)
ACCESSORS(SharedFunctionInfo, optimized_code_map, Object,
}
-#ifdef ENABLE_DEBUGGER_SUPPORT
void DebugInfo::DebugInfoPrint(FILE* out) {
HeapObject::PrintHeader(out, "DebugInfo");
PrintF(out, "\n - shared: ");
PrintF(out, "\n - break_point_objects: ");
break_point_objects()->ShortPrint(out);
}
-#endif // ENABLE_DEBUGGER_SUPPORT
void DescriptorArray::PrintDescriptors(FILE* out) {
Handle<Object> receiver,
Handle<JSReceiver> getter) {
Isolate* isolate = getter->GetIsolate();
-#ifdef ENABLE_DEBUGGER_SUPPORT
Debug* debug = isolate->debug();
// Handle stepping into a getter if step into is active.
// TODO(rossberg): should this apply to getters that are function proxies?
debug->HandleStepIn(
Handle<JSFunction>::cast(getter), Handle<Object>::null(), 0, false);
}
-#endif
return Execution::Call(isolate, getter, receiver, 0, NULL, true);
}
Handle<Object> value) {
Isolate* isolate = object->GetIsolate();
-#ifdef ENABLE_DEBUGGER_SUPPORT
Debug* debug = isolate->debug();
// Handle stepping into a setter if step into is active.
// TODO(rossberg): should this apply to getters that are function proxies?
debug->HandleStepIn(
Handle<JSFunction>::cast(setter), Handle<Object>::null(), 0, false);
}
-#endif
Handle<Object> argv[] = { value };
RETURN_ON_EXCEPTION(
}
-#ifdef ENABLE_DEBUGGER_SUPPORT
// Check if there is a break point at this code position.
bool DebugInfo::HasBreakPoint(int code_position) {
// Get the break point info object for this code position.
// Multiple break points.
return FixedArray::cast(break_point_objects())->length();
}
-#endif // ENABLE_DEBUGGER_SUPPORT
Object* JSDate::GetField(Object* object, Smi* index) {
// Note that for subtle reasons related to the ordering or numerical values of
// type tags, elements in this list have to be added to the INSTANCE_TYPE_LIST
// manually.
-#define STRUCT_LIST_ALL(V) \
+#define STRUCT_LIST(V) \
V(BOX, Box, box) \
V(DECLARED_ACCESSOR_DESCRIPTOR, \
DeclaredAccessorDescriptor, \
V(CODE_CACHE, CodeCache, code_cache) \
V(POLYMORPHIC_CODE_CACHE, PolymorphicCodeCache, polymorphic_code_cache) \
V(TYPE_FEEDBACK_INFO, TypeFeedbackInfo, type_feedback_info) \
- V(ALIASED_ARGUMENTS_ENTRY, AliasedArgumentsEntry, aliased_arguments_entry)
-
-#ifdef ENABLE_DEBUGGER_SUPPORT
-#define STRUCT_LIST_DEBUGGER(V) \
+ V(ALIASED_ARGUMENTS_ENTRY, AliasedArgumentsEntry, aliased_arguments_entry) \
V(DEBUG_INFO, DebugInfo, debug_info) \
V(BREAK_POINT_INFO, BreakPointInfo, break_point_info)
-#else
-#define STRUCT_LIST_DEBUGGER(V)
-#endif
-
-#define STRUCT_LIST(V) \
- STRUCT_LIST_ALL(V) \
- STRUCT_LIST_DEBUGGER(V)
// We use the full 8 bits of the instance_type field to encode heap object
// instance types. The high-order bit (bit 7) is set if the object is not a
TYPE_FEEDBACK_INFO_TYPE,
ALIASED_ARGUMENTS_ENTRY_TYPE,
BOX_TYPE,
- // The following two instance types are only used when ENABLE_DEBUGGER_SUPPORT
- // is defined. However as include/v8.h contain some of the instance type
- // constants always having them avoids them getting different numbers
- // depending on whether ENABLE_DEBUGGER_SUPPORT is defined or not.
DEBUG_INFO_TYPE,
BREAK_POINT_INFO_TYPE,
};
-#ifdef ENABLE_DEBUGGER_SUPPORT
// The DebugInfo class holds additional information for a function being
// debugged.
class DebugInfo: public Struct {
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(BreakPointInfo);
};
-#endif // ENABLE_DEBUGGER_SUPPORT
#undef DECL_BOOLEAN_ACCESSORS
// Check whether debugger and is about to step into the callback that is passed
// to a built-in function such as Array.forEach.
RUNTIME_FUNCTION(Runtime_DebugCallbackSupportsStepping) {
-#ifdef ENABLE_DEBUGGER_SUPPORT
ASSERT(args.length() == 1);
if (!isolate->IsDebuggerActive() || !isolate->debug()->StepInActive()) {
return isolate->heap()->false_value();
// We do not step into the callback if it's a builtin or not even a function.
return isolate->heap()->ToBoolean(
callback->IsJSFunction() && !JSFunction::cast(callback)->IsBuiltin());
-#else
- return isolate->heap()->false_value();
-#endif // ENABLE_DEBUGGER_SUPPORT
}
// Set one shot breakpoints for the callback function that is passed to a
// built-in function such as Array.forEach to enable stepping into the callback.
RUNTIME_FUNCTION(Runtime_DebugPrepareStepInIfStepping) {
-#ifdef ENABLE_DEBUGGER_SUPPORT
ASSERT(args.length() == 1);
Debug* debug = isolate->debug();
if (!debug->IsStepping()) return isolate->heap()->undefined_value();
// again, we need to clear the step out at this point.
debug->ClearStepOut();
debug->FloodWithOneShot(callback);
-#endif // ENABLE_DEBUGGER_SUPPORT
return isolate->heap()->undefined_value();
}
// Notify the debugger if an expcetion in a promise is not caught (yet).
RUNTIME_FUNCTION(Runtime_DebugPendingExceptionInPromise) {
-#ifdef ENABLE_DEBUGGER_SUPPORT
ASSERT(args.length() == 2);
HandleScope scope(isolate);
CONVERT_ARG_HANDLE_CHECKED(Object, exception, 0);
CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 1);
isolate->debugger()->OnException(exception, true, promise);
-#endif // ENABLE_DEBUGGER_SUPPORT
return isolate->heap()->undefined_value();
}
return isolate->Throw(*type_error);
}
-#ifdef ENABLE_DEBUGGER_SUPPORT
Debug* debug = isolate->debug();
// Handle stepping into constructors if step into is active.
if (debug->StepInActive()) {
debug->HandleStepIn(function, Handle<Object>::null(), 0, true);
}
-#endif
if (function->has_initial_map()) {
if (function->initial_map()->instance_type() == JS_FUNCTION_TYPE) {
}
-#ifdef ENABLE_DEBUGGER_SUPPORT
RUNTIME_FUNCTION(Runtime_DebugBreak) {
SealHandleScope shs(isolate);
ASSERT(args.length() == 0);
return Smi::FromInt(usage);
}
-#endif // ENABLE_DEBUGGER_SUPPORT
-
#ifdef V8_I18N_SUPPORT
RUNTIME_FUNCTION(Runtime_CanonicalizeLanguageTag) {
F(IsAccessCheckNeeded, 1, 1)
-#ifdef ENABLE_DEBUGGER_SUPPORT
-#define RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) \
+#define RUNTIME_FUNCTION_LIST_DEBUGGER(F) \
/* Debugger support*/ \
F(DebugBreak, 0, 1) \
F(SetDebugEventListener, 2, 1) \
F(CollectGarbage, 1, 1) \
F(GetHeapUsage, 0, 1) \
-#else
-#define RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F)
-#endif
-
#ifdef V8_I18N_SUPPORT
#define RUNTIME_FUNCTION_LIST_I18N_SUPPORT(F) \
RUNTIME_FUNCTION_LIST_ALWAYS_1(F) \
RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \
RUNTIME_FUNCTION_LIST_DEBUG(F) \
- RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) \
+ RUNTIME_FUNCTION_LIST_DEBUGGER(F) \
RUNTIME_FUNCTION_LIST_I18N_SUPPORT(F)
// RUNTIME_HIDDEN_FUNCTION_LIST defines all runtime functions accessed
isolate);
}
-#ifdef ENABLE_DEBUGGER_SUPPORT
// Debug addresses
Add(Debug_Address(Debug::k_after_break_target_address).address(isolate),
DEBUG_ADDRESS,
DEBUG_ADDRESS,
Debug::k_restarter_frame_function_pointer << kDebugIdShift,
"Debug::restarter_frame_function_pointer_address()");
-#endif
// Stat counters
struct StatsRefTableEntry {
UNCLASSIFIED,
15,
"Heap::NewSpaceAllocationTopAddress()");
-#ifdef ENABLE_DEBUGGER_SUPPORT
Add(ExternalReference::debug_break(isolate).address(),
UNCLASSIFIED,
16,
UNCLASSIFIED,
17,
"Debug::step_in_fp_addr()");
-#endif
Add(ExternalReference::mod_two_doubles_operation(isolate).address(),
UNCLASSIFIED,
22,
from = isolate_->handle_scope_implementer()->RestoreThread(from);
from = isolate_->RestoreThread(from);
from = Relocatable::RestoreState(isolate_, from);
-#ifdef ENABLE_DEBUGGER_SUPPORT
from = isolate_->debug()->RestoreDebug(from);
-#endif
from = isolate_->stack_guard()->RestoreStackGuard(from);
from = isolate_->regexp_stack()->RestoreStack(from);
from = isolate_->bootstrapper()->RestoreState(from);
static int ArchiveSpacePerThread() {
return HandleScopeImplementer::ArchiveSpacePerThread() +
Isolate::ArchiveSpacePerThread() +
-#ifdef ENABLE_DEBUGGER_SUPPORT
Debug::ArchiveSpacePerThread() +
-#endif
StackGuard::ArchiveSpacePerThread() +
RegExpStack::ArchiveSpacePerThread() +
Bootstrapper::ArchiveSpacePerThread() +
to = isolate_->handle_scope_implementer()->ArchiveThread(to);
to = isolate_->ArchiveThread(to);
to = Relocatable::ArchiveState(isolate_, to);
-#ifdef ENABLE_DEBUGGER_SUPPORT
to = isolate_->debug()->ArchiveDebug(to);
-#endif
to = isolate_->stack_guard()->ArchiveStackGuard(to);
to = isolate_->regexp_stack()->ArchiveStack(to);
to = isolate_->bootstrapper()->ArchiveState(to);
void ThreadManager::FreeThreadResources() {
isolate_->handle_scope_implementer()->FreeThreadResources();
isolate_->FreeThreadResources();
-#ifdef ENABLE_DEBUGGER_SUPPORT
isolate_->debug()->FreeThreadResources();
-#endif
isolate_->stack_guard()->FreeThreadResources();
isolate_->regexp_stack()->FreeThreadResources();
isolate_->bootstrapper()->FreeThreadResources();
// movq(rsp, rbp); pop(rbp); ret(n); int3 *6
// The 11th byte is int3 (0xCC) in the return sequence and
// REX.WB (0x48+register bit) for the call sequence.
-#ifdef ENABLE_DEBUGGER_SUPPORT
return pc_[Assembler::kMoveAddressIntoScratchRegisterInstructionLength] !=
0xCC;
-#else
- return false;
-#endif
}
CPU::FlushICache(pc_, sizeof(Address));
} else if (RelocInfo::IsCodeAgeSequence(mode)) {
visitor->VisitCodeAgeSequence(this);
-#ifdef ENABLE_DEBUGGER_SUPPORT
} else if (((RelocInfo::IsJSReturn(mode) &&
IsPatchedReturnSequence()) ||
(RelocInfo::IsDebugBreakSlot(mode) &&
IsPatchedDebugBreakSlotSequence())) &&
isolate->debug()->has_break_points()) {
visitor->VisitDebugTarget(this);
-#endif
} else if (RelocInfo::IsRuntimeEntry(mode)) {
visitor->VisitRuntimeEntry(this);
}
CPU::FlushICache(pc_, sizeof(Address));
} else if (RelocInfo::IsCodeAgeSequence(mode)) {
StaticVisitor::VisitCodeAgeSequence(heap, this);
-#ifdef ENABLE_DEBUGGER_SUPPORT
} else if (heap->isolate()->debug()->has_break_points() &&
((RelocInfo::IsJSReturn(mode) &&
IsPatchedReturnSequence()) ||
(RelocInfo::IsDebugBreakSlot(mode) &&
IsPatchedDebugBreakSlotSequence()))) {
StaticVisitor::VisitDebugTarget(heap, this);
-#endif
} else if (RelocInfo::IsRuntimeEntry(mode)) {
StaticVisitor::VisitRuntimeEntry(this);
}
if (FLAG_inline_new) {
Label undo_allocation;
-#ifdef ENABLE_DEBUGGER_SUPPORT
ExternalReference debug_step_in_fp =
ExternalReference::debug_step_in_fp_address(masm->isolate());
__ Move(kScratchRegister, debug_step_in_fp);
__ cmpp(Operand(kScratchRegister, 0), Immediate(0));
__ j(not_equal, &rt_call);
-#endif
// Verified that the constructor is a JSFunction.
// Load the initial map and verify that it is in fact a map.
namespace v8 {
namespace internal {
-#ifdef ENABLE_DEBUGGER_SUPPORT
-
bool BreakLocationIterator::IsDebugBreakAtReturn() {
return Debug::IsDebugBreakAtReturn(rinfo());
}
#undef __
-#endif // ENABLE_DEBUGGER_SUPPORT
-
} } // namespace v8::internal
#endif // V8_TARGET_ARCH_X64
int arguments_bytes = (info_->scope()->num_parameters() + 1) * kPointerSize;
__ Ret(arguments_bytes, rcx);
-#ifdef ENABLE_DEBUGGER_SUPPORT
// Add padding that will be overwritten by a debugger breakpoint. We
// have just generated at least 7 bytes: "movp rsp, rbp; pop rbp; ret k"
// (3 + 1 + 3) for x64 and at least 6 (2 + 1 + 3) bytes for x32.
// for the debugger's requirements.
ASSERT(Assembler::kJSReturnSequenceLength <=
masm_->SizeOfCodeGeneratedSince(&check_exit_codesize));
-#endif
+
info_->AddNoFrameRange(no_frame_start, masm_->pc_offset());
}
}
}
-#ifdef ENABLE_DEBUGGER_SUPPORT
void MacroAssembler::DebugBreak() {
Set(rax, 0); // No arguments.
LoadAddress(rbx, ExternalReference(Runtime::kDebugBreak, isolate()));
ASSERT(AllowThisStubCall(&ces));
Call(ces.GetCode(), RelocInfo::DEBUG_BREAK);
}
-#endif // ENABLE_DEBUGGER_SUPPORT
void MacroAssembler::InvokeCode(Register code,
RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
SmiCheck smi_check = INLINE_SMI_CHECK);
-#ifdef ENABLE_DEBUGGER_SUPPORT
// ---------------------------------------------------------------------------
// Debugger Support
void DebugBreak();
-#endif
// Generates function and stub prologue code.
void Prologue(PrologueFrameMode frame_mode);
stackTrace->GetFrame(0));
checkStackFrame(origin, "baz", 8, 3, false, true,
stackTrace->GetFrame(1));
-#ifdef ENABLE_DEBUGGER_SUPPORT
bool is_eval = true;
-#else // ENABLE_DEBUGGER_SUPPORT
- bool is_eval = false;
-#endif // ENABLE_DEBUGGER_SUPPORT
-
// This is the source string inside the eval which has the call to baz.
checkStackFrame(NULL, "", 1, 5, is_eval, false,
stackTrace->GetFrame(2));
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifdef ENABLE_DEBUGGER_SUPPORT
-
#include <stdlib.h>
#include "v8.h"
v8::Debug::SetDebugEventListener2(NULL);
CheckDebuggerUnloaded();
}
-
-
-#endif // ENABLE_DEBUGGER_SUPPORT
__ jmp(&L1);
__ jmp(Operand(ebx, ecx, times_4, 10000));
-#ifdef ENABLE_DEBUGGER_SUPPORT
ExternalReference after_break_target =
ExternalReference(Debug_Address::AfterBreakTarget(), isolate);
__ jmp(Operand::StaticVariable(after_break_target));
-#endif // ENABLE_DEBUGGER_SUPPORT
__ jmp(ic, RelocInfo::CODE_TARGET);
__ nop();
__ jmp(&L1);
// TODO(mstarzinger): The following is protected.
// __ jmp(Operand(rbx, rcx, times_4, 10000));
-#ifdef ENABLE_DEBUGGER_SUPPORT
ExternalReference after_break_target =
ExternalReference(Debug_Address::AfterBreakTarget(), isolate);
USE(after_break_target);
-#endif // ENABLE_DEBUGGER_SUPPORT
__ jmp(ic, RelocInfo::CODE_TARGET);
__ nop();
0);
CHECK_NE(0, func_pos);
-#ifdef ENABLE_DEBUGGER_SUPPORT
// Obtain SharedFunctionInfo for the function.
isolate->debug()->PrepareForBreakPoints();
Object* shared_func_info_ptr =
SmartArrayPointer<char> inferred_name =
shared_func_info->inferred_name()->ToCString();
CHECK_EQ(ref_inferred_name, inferred_name.get());
-#endif // ENABLE_DEBUGGER_SUPPORT
}
}
-#ifdef ENABLE_DEBUGGER_SUPPORT
TEST(NoDebugObjectInSnapshot) {
LocalContext env;
v8::HandleScope scope(env->GetIsolate());
}
CHECK_EQ(1, globals_count);
}
-#endif // ENABLE_DEBUGGER_SUPPORT
TEST(AllStrongGcRootsHaveNames) {
// code flushing candidate.
SimulateIncrementalMarking();
-#ifdef ENABLE_DEBUGGER_SUPPORT
// Enable the debugger and add a breakpoint while incremental marking
// is running so that incremental marking aborts and code flushing is
// disabled.
Handle<Object> breakpoint_object(Smi::FromInt(0), isolate);
isolate->debug()->SetBreakPoint(function, breakpoint_object, &position);
isolate->debug()->ClearAllBreakPoints();
-#endif // ENABLE_DEBUGGER_SUPPORT
// Force optimization now that code flushing is disabled.
{ v8::HandleScope scope(CcTest::isolate());
// explicitly enqueued.
SimulateIncrementalMarking();
-#ifdef ENABLE_DEBUGGER_SUPPORT
// Now enable the debugger which in turn will disable code flushing.
CHECK(isolate->debug()->Load());
-#endif // ENABLE_DEBUGGER_SUPPORT
// This cycle will bust the heap and subsequent cycles will go ballistic.
heap->CollectAllGarbage(Heap::kNoGCFlags);
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifdef ENABLE_DEBUGGER_SUPPORT
-
#include <stdlib.h>
#include "v8.h"
CompareStrings("abbabababababaaabbabababababbabbbbbbbababa",
"bbbbabababbbabababbbabababababbabbababa");
}
-
-#endif // ENABLE_DEBUGGER_SUPPORT
ExternalReference::address_of_real_stack_limit(isolate);
CHECK_EQ(make_code(UNCLASSIFIED, 5),
encoder.Encode(real_stack_limit_address.address()));
-#ifdef ENABLE_DEBUGGER_SUPPORT
CHECK_EQ(make_code(UNCLASSIFIED, 16),
encoder.Encode(ExternalReference::debug_break(isolate).address()));
-#endif // ENABLE_DEBUGGER_SUPPORT
CHECK_EQ(make_code(UNCLASSIFIED, 10),
encoder.Encode(
ExternalReference::new_space_start(isolate).address()));
decoder.Decode(make_code(UNCLASSIFIED, 4)));
CHECK_EQ(ExternalReference::address_of_real_stack_limit(isolate).address(),
decoder.Decode(make_code(UNCLASSIFIED, 5)));
-#ifdef ENABLE_DEBUGGER_SUPPORT
CHECK_EQ(ExternalReference::debug_break(isolate).address(),
decoder.Decode(make_code(UNCLASSIFIED, 16)));
-#endif // ENABLE_DEBUGGER_SUPPORT
CHECK_EQ(ExternalReference::new_space_start(isolate).address(),
decoder.Decode(make_code(UNCLASSIFIED, 10)));
}
#include <google_breakpad/processor/minidump.h>
-#define ENABLE_DEBUGGER_SUPPORT
-
#include <v8.h>
namespace {