Commit 51a3ffd9 authored by marja's avatar marja Committed by Commit bot

Include only stuff you need, part 8: Fix debug.h -> liveedit.h.

Rebuilding (after touching certain files) is crazy slow because
includes are out of control.

The (last remaining) offending include path is: ast.h <- liveedit.h <-
debug.h <- src/x64/assembler-whatever-port-inl.h <-
src/macro-assembler.h <- everything possible

With this CL, the rebuild steps needed when touching ast-value-factory.h
drops from 365 to 181.

BUG=v8:5294
TBR=bmeurer@chromium.org

Review-Url: https://codereview.chromium.org/2316443002
Cr-Commit-Position: refs/heads/master@{#39195}
parent c071a8f0
......@@ -6,6 +6,7 @@
#include <sstream>
#include "src/ast/ast.h"
#include "src/bootstrapper.h"
#include "src/code-factory.h"
#include "src/code-stub-assembler.h"
......
......@@ -18,6 +18,8 @@
namespace v8 {
namespace internal {
class ObjectLiteral;
// List of code stubs used on all platforms.
#define CODE_STUB_LIST_ALL_PLATFORMS(V) \
/* --- PlatformCodeStubs --- */ \
......
......@@ -2,10 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/compiler/js-generic-lowering.h"
#include "src/ast/ast.h"
#include "src/code-factory.h"
#include "src/code-stubs.h"
#include "src/compiler/common-operator.h"
#include "src/compiler/js-generic-lowering.h"
#include "src/compiler/js-graph.h"
#include "src/compiler/machine-operator.h"
#include "src/compiler/node-matchers.h"
......
......@@ -9,6 +9,7 @@
#include <iosfwd>
#include "src/allocation.h"
#include "src/ast/ast.h"
#include "src/base/bits.h"
#include "src/bit-vector.h"
#include "src/code-stubs.h"
......@@ -36,6 +37,7 @@ class HStoreNamedField;
class HValue;
class LInstruction;
class LChunkBuilder;
class SmallMapList;
#define HYDROGEN_ABSTRACT_INSTRUCTION_LIST(V) \
V(ArithmeticBinaryOperation) \
......
......@@ -8,6 +8,7 @@
#include "src/accessors.h"
#include "src/allocation.h"
#include "src/ast/ast-type-bounds.h"
#include "src/ast/scopes.h"
#include "src/bailout-reason.h"
#include "src/compilation-info.h"
#include "src/compiler.h"
......@@ -31,7 +32,6 @@ class HTracer;
class LAllocator;
class LChunk;
class LiveRange;
class Scope;
class HCompilationJob final : public CompilationJob {
public:
......
......@@ -4,9 +4,11 @@
#if V8_TARGET_ARCH_ARM
#include "src/codegen.h"
#include "src/debug/debug.h"
#include "src/codegen.h"
#include "src/debug/liveedit.h"
namespace v8 {
namespace internal {
......
......@@ -4,9 +4,11 @@
#if V8_TARGET_ARCH_ARM64
#include "src/debug/debug.h"
#include "src/arm64/frames-arm64.h"
#include "src/codegen.h"
#include "src/debug/debug.h"
#include "src/debug/liveedit.h"
namespace v8 {
namespace internal {
......
......@@ -11,6 +11,8 @@
namespace v8 {
namespace internal {
class ParseInfo;
// Iterate over the actual scopes visible from a stack frame or from a closure.
// The iteration proceeds from the innermost visible nested scope outwards.
// All scopes are backed by an actual context except the local scope,
......
......@@ -14,6 +14,7 @@
#include "src/compilation-cache.h"
#include "src/compiler-dispatcher/optimizing-compile-dispatcher.h"
#include "src/compiler.h"
#include "src/debug/liveedit.h"
#include "src/deoptimizer.h"
#include "src/execution.h"
#include "src/frames-inl.h"
......@@ -1576,10 +1577,9 @@ bool Debug::IsBreakAtReturn(JavaScriptFrame* frame) {
return location.IsReturn() || location.IsTailCall();
}
void Debug::FramesHaveBeenDropped(StackFrame::Id new_break_frame_id,
LiveEdit::FrameDropMode mode) {
if (mode != LiveEdit::CURRENTLY_SET_MODE) {
LiveEditFrameDropMode mode) {
if (mode != LIVE_EDIT_CURRENTLY_SET_MODE) {
thread_local_.frame_drop_mode_ = mode;
}
thread_local_.break_frame_id_ = new_break_frame_id;
......
......@@ -11,11 +11,11 @@
#include "src/base/atomicops.h"
#include "src/base/hashmap.h"
#include "src/base/platform/platform.h"
#include "src/debug/liveedit.h"
#include "src/execution.h"
#include "src/factory.h"
#include "src/flags.h"
#include "src/frames.h"
#include "src/globals.h"
#include "src/runtime/runtime.h"
#include "src/source-position-table.h"
#include "src/string-stream.h"
......@@ -489,7 +489,7 @@ class Debug {
// Support for LiveEdit
void FramesHaveBeenDropped(StackFrame::Id new_break_frame_id,
LiveEdit::FrameDropMode mode);
LiveEditFrameDropMode mode);
// Threading support.
char* ArchiveDebug(char* to);
......@@ -704,7 +704,7 @@ class Debug {
// Stores the way how LiveEdit has patched the stack. It is used when
// debugger returns control back to user script.
LiveEdit::FrameDropMode frame_drop_mode_;
LiveEditFrameDropMode frame_drop_mode_;
// Value of accumulator in interpreter frames. In non-interpreter frames
// this value will be the hole.
......
......@@ -4,8 +4,10 @@
#if V8_TARGET_ARCH_IA32
#include "src/codegen.h"
#include "src/debug/debug.h"
#include "src/codegen.h"
#include "src/debug/liveedit.h"
#include "src/ia32/frames-ia32.h"
namespace v8 {
......
......@@ -654,7 +654,7 @@ Handle<SharedFunctionInfo> SharedInfoWrapper::GetInfo() {
void LiveEdit::InitializeThreadLocal(Debug* debug) {
debug->thread_local_.frame_drop_mode_ = LiveEdit::FRAMES_UNTOUCHED;
debug->thread_local_.frame_drop_mode_ = LIVE_EDIT_FRAMES_UNTOUCHED;
}
......@@ -662,20 +662,20 @@ bool LiveEdit::SetAfterBreakTarget(Debug* debug) {
Code* code = NULL;
Isolate* isolate = debug->isolate_;
switch (debug->thread_local_.frame_drop_mode_) {
case FRAMES_UNTOUCHED:
case LIVE_EDIT_FRAMES_UNTOUCHED:
return false;
case FRAME_DROPPED_IN_DEBUG_SLOT_CALL:
case LIVE_EDIT_FRAME_DROPPED_IN_DEBUG_SLOT_CALL:
// Debug break slot stub does not return normally, instead it manually
// cleans the stack and jumps. We should patch the jump address.
code = isolate->builtins()->builtin(Builtins::kFrameDropper_LiveEdit);
break;
case FRAME_DROPPED_IN_DIRECT_CALL:
case LIVE_EDIT_FRAME_DROPPED_IN_DIRECT_CALL:
// Nothing to do, after_break_target is not used here.
return true;
case FRAME_DROPPED_IN_RETURN_CALL:
case LIVE_EDIT_FRAME_DROPPED_IN_RETURN_CALL:
code = isolate->builtins()->builtin(Builtins::kFrameDropper_LiveEdit);
break;
case CURRENTLY_SET_MODE:
case LIVE_EDIT_CURRENTLY_SET_MODE:
UNREACHABLE();
break;
}
......@@ -1302,7 +1302,7 @@ static void SetUpFrameDropperFrame(StackFrame* bottom_js_frame,
// Returns error message or NULL.
static const char* DropFrames(Vector<StackFrame*> frames, int top_frame_index,
int bottom_js_frame_index,
LiveEdit::FrameDropMode* mode) {
LiveEditFrameDropMode* mode) {
if (!LiveEdit::kFrameDropperSupported) {
return "Stack manipulations are not supported in this architecture.";
}
......@@ -1320,22 +1320,22 @@ static const char* DropFrames(Vector<StackFrame*> frames, int top_frame_index,
if (pre_top_frame_code ==
isolate->builtins()->builtin(Builtins::kSlot_DebugBreak)) {
// OK, we can drop debug break slot.
*mode = LiveEdit::FRAME_DROPPED_IN_DEBUG_SLOT_CALL;
*mode = LIVE_EDIT_FRAME_DROPPED_IN_DEBUG_SLOT_CALL;
} else if (pre_top_frame_code ==
isolate->builtins()->builtin(Builtins::kFrameDropper_LiveEdit)) {
// OK, we can drop our own code.
pre_top_frame = frames[top_frame_index - 2];
top_frame = frames[top_frame_index - 1];
*mode = LiveEdit::CURRENTLY_SET_MODE;
*mode = LIVE_EDIT_CURRENTLY_SET_MODE;
frame_has_padding = false;
} else if (pre_top_frame_code ==
isolate->builtins()->builtin(Builtins::kReturn_DebugBreak)) {
*mode = LiveEdit::FRAME_DROPPED_IN_RETURN_CALL;
*mode = LIVE_EDIT_FRAME_DROPPED_IN_RETURN_CALL;
} else if (pre_top_frame_code->kind() == Code::STUB &&
CodeStub::GetMajorKey(pre_top_frame_code) == CodeStub::CEntry) {
// Entry from our unit tests on 'debugger' statement.
// It's fine, we support this case.
*mode = LiveEdit::FRAME_DROPPED_IN_DIRECT_CALL;
*mode = LIVE_EDIT_FRAME_DROPPED_IN_DIRECT_CALL;
// We don't have a padding from 'debugger' statement call.
// Here the stub is CEntry, it's not debug-only and can't be padded.
// If anyone would complain, a proxy padded stub could be added.
......@@ -1347,13 +1347,13 @@ static const char* DropFrames(Vector<StackFrame*> frames, int top_frame_index,
isolate->builtins()->builtin(Builtins::kFrameDropper_LiveEdit));
pre_top_frame = frames[top_frame_index - 3];
top_frame = frames[top_frame_index - 2];
*mode = LiveEdit::CURRENTLY_SET_MODE;
*mode = LIVE_EDIT_CURRENTLY_SET_MODE;
frame_has_padding = false;
} else if (pre_top_frame_code->kind() == Code::BYTECODE_HANDLER) {
// Interpreted bytecode takes up two stack frames, one for the bytecode
// handler and one for the interpreter entry trampoline. Therefore we shift
// up by one frame.
*mode = LiveEdit::FRAME_DROPPED_IN_DIRECT_CALL;
*mode = LIVE_EDIT_FRAME_DROPPED_IN_DIRECT_CALL;
pre_top_frame = frames[top_frame_index - 2];
top_frame = frames[top_frame_index - 1];
} else {
......@@ -1604,7 +1604,7 @@ static const char* DropActivationsInActiveThreadImpl(Isolate* isolate,
return target.GetNotFoundMessage();
}
LiveEdit::FrameDropMode drop_mode = LiveEdit::FRAMES_UNTOUCHED;
LiveEditFrameDropMode drop_mode = LIVE_EDIT_FRAMES_UNTOUCHED;
const char* error_message =
DropFrames(frames, top_frame_index, bottom_js_frame_index, &drop_mode);
......
......@@ -72,20 +72,6 @@ class LiveEditFunctionTracker
class LiveEdit : AllStatic {
public:
// Describes how exactly a frame has been dropped from stack.
enum FrameDropMode {
// No frame has been dropped.
FRAMES_UNTOUCHED,
// The top JS frame had been calling debug break slot stub. Patch the
// address this stub jumps to in the end.
FRAME_DROPPED_IN_DEBUG_SLOT_CALL,
// The top JS frame had been calling some C++ function. The return address
// gets patched automatically.
FRAME_DROPPED_IN_DIRECT_CALL,
FRAME_DROPPED_IN_RETURN_CALL,
CURRENTLY_SET_MODE
};
static void InitializeThreadLocal(Debug* debug);
static bool SetAfterBreakTarget(Debug* debug);
......
......@@ -4,9 +4,11 @@
#if V8_TARGET_ARCH_MIPS
#include "src/codegen.h"
#include "src/debug/debug.h"
#include "src/codegen.h"
#include "src/debug/liveedit.h"
namespace v8 {
namespace internal {
......
......@@ -4,9 +4,11 @@
#if V8_TARGET_ARCH_MIPS64
#include "src/codegen.h"
#include "src/debug/debug.h"
#include "src/codegen.h"
#include "src/debug/liveedit.h"
namespace v8 {
namespace internal {
......
......@@ -4,9 +4,11 @@
#if V8_TARGET_ARCH_PPC
#include "src/codegen.h"
#include "src/debug/debug.h"
#include "src/codegen.h"
#include "src/debug/liveedit.h"
namespace v8 {
namespace internal {
......
......@@ -6,9 +6,11 @@
#if V8_TARGET_ARCH_S390
#include "src/codegen.h"
#include "src/debug/debug.h"
#include "src/codegen.h"
#include "src/debug/liveedit.h"
namespace v8 {
namespace internal {
......
......@@ -4,10 +4,11 @@
#if V8_TARGET_ARCH_X64
#include "src/assembler.h"
#include "src/codegen.h"
#include "src/debug/debug.h"
#include "src/assembler.h"
#include "src/codegen.h"
#include "src/debug/liveedit.h"
namespace v8 {
namespace internal {
......
......@@ -4,8 +4,10 @@
#if V8_TARGET_ARCH_X87
#include "src/codegen.h"
#include "src/debug/debug.h"
#include "src/codegen.h"
#include "src/debug/liveedit.h"
#include "src/x87/frames-x87.h"
namespace v8 {
......
......@@ -8,6 +8,7 @@
#include "src/allocation.h"
#include "src/assert-scope.h"
#include "src/ast/ast.h"
#include "src/ast/scopes.h"
#include "src/bit-vector.h"
#include "src/code-factory.h"
#include "src/code-stubs.h"
......
......@@ -1151,6 +1151,20 @@ class CompareOperationFeedback {
enum { kNone = 0x00, kSignedSmall = 0x01, kNumber = 0x3, kAny = 0x7 };
};
// Describes how exactly a frame has been dropped from stack.
enum LiveEditFrameDropMode {
// No frame has been dropped.
LIVE_EDIT_FRAMES_UNTOUCHED,
// The top JS frame had been calling debug break slot stub. Patch the
// address this stub jumps to in the end.
LIVE_EDIT_FRAME_DROPPED_IN_DEBUG_SLOT_CALL,
// The top JS frame had been calling some C++ function. The return address
// gets patched automatically.
LIVE_EDIT_FRAME_DROPPED_IN_DIRECT_CALL,
LIVE_EDIT_FRAME_DROPPED_IN_RETURN_CALL,
LIVE_EDIT_CURRENTLY_SET_MODE
};
} // namespace internal
} // namespace v8
......
......@@ -6,6 +6,7 @@
#define V8_IC_STATE_H_
#include "src/macro-assembler.h"
#include "src/parsing/token.h"
namespace v8 {
namespace internal {
......
......@@ -4,6 +4,7 @@
#include "src/ic/stub-cache.h"
#include "src/ast/ast.h"
#include "src/base/bits.h"
#include "src/type-info.h"
......
......@@ -10,6 +10,7 @@
namespace v8 {
namespace internal {
class SmallMapList;
// The stub cache is used for megamorphic property accesses.
// It maps (map, name, type) to property access handlers. The cache does not
......
......@@ -4,6 +4,7 @@
#include "src/pending-compilation-error-handler.h"
#include "src/ast/ast-value-factory.h"
#include "src/debug/debug.h"
#include "src/handles.h"
#include "src/isolate.h"
......
......@@ -9,6 +9,7 @@
#include "src/debug/debug-frames.h"
#include "src/debug/debug-scopes.h"
#include "src/debug/debug.h"
#include "src/debug/liveedit.h"
#include "src/frames-inl.h"
#include "src/globals.h"
#include "src/interpreter/bytecodes.h"
......
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