2011-01-18 16:11:01 +00:00
|
|
|
// Copyright 2010 the V8 project authors. All rights reserved.
|
2014-04-29 06:42:26 +00:00
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
2011-01-18 16:11:01 +00:00
|
|
|
|
|
|
|
#ifndef V8_GDB_JIT_H_
|
|
|
|
#define V8_GDB_JIT_H_
|
|
|
|
|
2014-06-03 08:12:43 +00:00
|
|
|
#include "src/allocation.h"
|
2011-05-06 06:50:20 +00:00
|
|
|
|
2011-01-18 16:11:01 +00:00
|
|
|
//
|
|
|
|
// Basic implementation of GDB JIT Interface client.
|
|
|
|
// GBD JIT Interface is supported in GDB 7.0 and above.
|
|
|
|
// Currently on x64 and ia32 architectures and Linux OS are supported.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifdef ENABLE_GDB_JIT_INTERFACE
|
2014-06-03 08:12:43 +00:00
|
|
|
#include "src/v8.h"
|
2014-06-20 08:40:11 +00:00
|
|
|
|
2014-06-03 08:12:43 +00:00
|
|
|
#include "src/factory.h"
|
2011-01-18 16:11:01 +00:00
|
|
|
|
|
|
|
namespace v8 {
|
|
|
|
namespace internal {
|
|
|
|
|
2011-06-30 11:52:00 +00:00
|
|
|
class CompilationInfo;
|
|
|
|
|
2011-01-18 16:11:01 +00:00
|
|
|
class GDBJITInterface: public AllStatic {
|
|
|
|
public:
|
2014-07-11 07:51:25 +00:00
|
|
|
enum CodeTag { NON_FUNCTION, FUNCTION };
|
2011-01-18 16:11:01 +00:00
|
|
|
|
2014-07-10 14:41:06 +00:00
|
|
|
// Main entry point into GDB JIT realized as a JitCodeEventHandler.
|
|
|
|
static void EventHandler(const v8::JitCodeEvent* event);
|
|
|
|
|
2013-03-20 11:29:46 +00:00
|
|
|
static void AddCode(Handle<Name> name,
|
2011-01-18 16:11:01 +00:00
|
|
|
Handle<Script> script,
|
2011-06-30 11:52:00 +00:00
|
|
|
Handle<Code> code,
|
|
|
|
CompilationInfo* info);
|
2011-01-18 16:11:01 +00:00
|
|
|
|
2014-07-11 07:51:25 +00:00
|
|
|
static void RemoveCodeRange(Address start, Address end);
|
2011-01-18 16:11:01 +00:00
|
|
|
|
2014-07-11 07:51:25 +00:00
|
|
|
private:
|
|
|
|
static void AddCode(const char* name, Code* code, CodeTag tag, Script* script,
|
|
|
|
CompilationInfo* info);
|
2011-01-18 16:11:01 +00:00
|
|
|
|
|
|
|
static void RemoveCode(Code* code);
|
|
|
|
};
|
|
|
|
|
|
|
|
#define GDBJIT(action) GDBJITInterface::action
|
|
|
|
|
|
|
|
} } // namespace v8::internal
|
|
|
|
#else
|
|
|
|
#define GDBJIT(action) ((void) 0)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|