Revision: 9506
Author: [email protected]
Date: Mon Oct 3 04:13:20 2011
Log: Remove #include "isolate-inl.h" from v8.h.
Include it only in the .cc files where it's needed.
[email protected]
BUG=
TEST=
Review URL: http://codereview.chromium.org/8117001
http://code.google.com/p/v8/source/detail?r=9506
Modified:
/branches/bleeding_edge/src/bootstrapper.cc
/branches/bleeding_edge/src/code-stubs.cc
/branches/bleeding_edge/src/code-stubs.h
/branches/bleeding_edge/src/compiler.cc
/branches/bleeding_edge/src/debug.cc
/branches/bleeding_edge/src/debug.h
/branches/bleeding_edge/src/execution.cc
/branches/bleeding_edge/src/frames-inl.h
/branches/bleeding_edge/src/frames.cc
/branches/bleeding_edge/src/frames.h
/branches/bleeding_edge/src/isolate-inl.h
/branches/bleeding_edge/src/isolate.h
/branches/bleeding_edge/src/jsregexp.h
/branches/bleeding_edge/src/runtime-profiler.cc
/branches/bleeding_edge/src/runtime.cc
/branches/bleeding_edge/src/v8.h
=======================================
--- /branches/bleeding_edge/src/bootstrapper.cc Mon Sep 26 01:42:01 2011
+++ /branches/bleeding_edge/src/bootstrapper.cc Mon Oct 3 04:13:20 2011
@@ -34,6 +34,7 @@
#include "debug.h"
#include "execution.h"
#include "global-handles.h"
+#include "isolate-inl.h"
#include "macro-assembler.h"
#include "natives.h"
#include "objects-visiting.h"
=======================================
--- /branches/bleeding_edge/src/code-stubs.cc Thu Sep 29 05:53:27 2011
+++ /branches/bleeding_edge/src/code-stubs.cc Mon Oct 3 04:13:20 2011
@@ -193,6 +193,11 @@
return NULL;
}
}
+
+
+void CodeStub::PrintName(StringStream* stream) {
+ stream->Add("%s", MajorName(MajorKey(), false));
+}
int ICCompareStub::MinorKey() {
=======================================
--- /branches/bleeding_edge/src/code-stubs.h Thu Sep 29 05:53:27 2011
+++ /branches/bleeding_edge/src/code-stubs.h Mon Oct 3 04:13:20 2011
@@ -202,9 +202,7 @@
// Returns a name for logging/debugging purposes.
SmartArrayPointer<const char> GetName();
- virtual void PrintName(StringStream* stream) {
- stream->Add("%s", MajorName(MajorKey(), false));
- }
+ virtual void PrintName(StringStream* stream);
// Returns whether the code generated for this stub needs to be
allocated as
// a fixed (non-moveable) code object.
=======================================
--- /branches/bleeding_edge/src/compiler.cc Sat Oct 1 01:47:12 2011
+++ /branches/bleeding_edge/src/compiler.cc Mon Oct 3 04:13:20 2011
@@ -36,6 +36,7 @@
#include "full-codegen.h"
#include "gdb-jit.h"
#include "hydrogen.h"
+#include "isolate-inl.h"
#include "lithium.h"
#include "liveedit.h"
#include "parser.h"
=======================================
--- /branches/bleeding_edge/src/debug.cc Sat Oct 1 01:47:12 2011
+++ /branches/bleeding_edge/src/debug.cc Mon Oct 3 04:13:20 2011
@@ -40,6 +40,7 @@
#include "global-handles.h"
#include "ic.h"
#include "ic-inl.h"
+#include "isolate-inl.h"
#include "list.h"
#include "messages.h"
#include "natives.h"
@@ -2935,6 +2936,94 @@
handler();
}
}
+
+
+EnterDebugger::EnterDebugger()
+ : isolate_(Isolate::Current()),
+ prev_(isolate_->debug()->debugger_entry()),
+ it_(isolate_),
+ has_js_frames_(!it_.done()),
+ save_(isolate_) {
+ Debug* debug = isolate_->debug();
+ ASSERT(prev_ != NULL || !debug->is_interrupt_pending(PREEMPT));
+ ASSERT(prev_ != NULL || !debug->is_interrupt_pending(DEBUGBREAK));
+
+ // Link recursive debugger entry.
+ debug->set_debugger_entry(this);
+
+ // Store the previous break id and frame id.
+ break_id_ = debug->break_id();
+ break_frame_id_ = debug->break_frame_id();
+
+ // Create the new break info. If there is no JavaScript frames there is
no
+ // break frame id.
+ if (has_js_frames_) {
+ debug->NewBreak(it_.frame()->id());
+ } else {
+ debug->NewBreak(StackFrame::NO_ID);
+ }
+
+ // Make sure that debugger is loaded and enter the debugger context.
+ load_failed_ = !debug->Load();
+ if (!load_failed_) {
+ // NOTE the member variable save which saves the previous context
before
+ // this change.
+ isolate_->set_context(*debug->debug_context());
+ }
+}
+
+
+EnterDebugger::~EnterDebugger() {
+ ASSERT(Isolate::Current() == isolate_);
+ Debug* debug = isolate_->debug();
+
+ // Restore to the previous break state.
+ debug->SetBreak(break_frame_id_, break_id_);
+
+ // Check for leaving the debugger.
+ if (prev_ == NULL) {
+ // Clear mirror cache when leaving the debugger. Skip this if there is
a
+ // pending exception as clearing the mirror cache calls back into
+ // JavaScript. This can happen if the v8::Debug::Call is used in which
+ // case the exception should end up in the calling code.
+ if (!isolate_->has_pending_exception()) {
+ // Try to avoid any pending debug break breaking in the clear mirror
+ // cache JavaScript code.
+ if (isolate_->stack_guard()->IsDebugBreak()) {
+ debug->set_interrupts_pending(DEBUGBREAK);
+ isolate_->stack_guard()->Continue(DEBUGBREAK);
+ }
+ debug->ClearMirrorCache();
+ }
+
+ // Request preemption and debug break when leaving the last debugger
entry
+ // if any of these where recorded while debugging.
+ if (debug->is_interrupt_pending(PREEMPT)) {
+ // This re-scheduling of preemption is to avoid starvation in some
+ // debugging scenarios.
+ debug->clear_interrupt_pending(PREEMPT);
+ isolate_->stack_guard()->Preempt();
+ }
+ if (debug->is_interrupt_pending(DEBUGBREAK)) {
+ debug->clear_interrupt_pending(DEBUGBREAK);
+ isolate_->stack_guard()->DebugBreak();
+ }
+
+ // If there are commands in the queue when leaving the debugger request
+ // that these commands are processed.
+ if (isolate_->debugger()->HasCommands()) {
+ isolate_->stack_guard()->DebugCommand();
+ }
+
+ // If leaving the debugger with the debugger no longer active unload
it.
+ if (!isolate_->debugger()->IsDebuggerActive()) {
+ isolate_->debugger()->UnloadDebugger();
+ }
+ }
+
+ // Leaving this debugger entry.
+ debug->set_debugger_entry(prev_);
+}
MessageImpl MessageImpl::NewEvent(DebugEvent event,
=======================================
--- /branches/bleeding_edge/src/debug.h Sat Oct 1 01:47:12 2011
+++ /branches/bleeding_edge/src/debug.h Mon Oct 3 04:13:20 2011
@@ -869,91 +869,8 @@
// some reason could not be entered FailedToEnter will return true.
class EnterDebugger BASE_EMBEDDED {
public:
- EnterDebugger()
- : isolate_(Isolate::Current()),
- prev_(isolate_->debug()->debugger_entry()),
- it_(isolate_),
- has_js_frames_(!it_.done()),
- save_(isolate_) {
- Debug* debug = isolate_->debug();
- ASSERT(prev_ != NULL || !debug->is_interrupt_pending(PREEMPT));
- ASSERT(prev_ != NULL || !debug->is_interrupt_pending(DEBUGBREAK));
-
- // Link recursive debugger entry.
- debug->set_debugger_entry(this);
-
- // Store the previous break id and frame id.
- break_id_ = debug->break_id();
- break_frame_id_ = debug->break_frame_id();
-
- // Create the new break info. If there is no JavaScript frames there
is no
- // break frame id.
- if (has_js_frames_) {
- debug->NewBreak(it_.frame()->id());
- } else {
- debug->NewBreak(StackFrame::NO_ID);
- }
-
- // Make sure that debugger is loaded and enter the debugger context.
- load_failed_ = !debug->Load();
- if (!load_failed_) {
- // NOTE the member variable save which saves the previous context
before
- // this change.
- isolate_->set_context(*debug->debug_context());
- }
- }
-
- ~EnterDebugger() {
- ASSERT(Isolate::Current() == isolate_);
- Debug* debug = isolate_->debug();
-
- // Restore to the previous break state.
- debug->SetBreak(break_frame_id_, break_id_);
-
- // Check for leaving the debugger.
- if (prev_ == NULL) {
- // Clear mirror cache when leaving the debugger. Skip this if there
is a
- // pending exception as clearing the mirror cache calls back into
- // JavaScript. This can happen if the v8::Debug::Call is used in
which
- // case the exception should end up in the calling code.
- if (!isolate_->has_pending_exception()) {
- // Try to avoid any pending debug break breaking in the clear
mirror
- // cache JavaScript code.
- if (isolate_->stack_guard()->IsDebugBreak()) {
- debug->set_interrupts_pending(DEBUGBREAK);
- isolate_->stack_guard()->Continue(DEBUGBREAK);
- }
- debug->ClearMirrorCache();
- }
-
- // Request preemption and debug break when leaving the last debugger
entry
- // if any of these where recorded while debugging.
- if (debug->is_interrupt_pending(PREEMPT)) {
- // This re-scheduling of preemption is to avoid starvation in some
- // debugging scenarios.
- debug->clear_interrupt_pending(PREEMPT);
- isolate_->stack_guard()->Preempt();
- }
- if (debug->is_interrupt_pending(DEBUGBREAK)) {
- debug->clear_interrupt_pending(DEBUGBREAK);
- isolate_->stack_guard()->DebugBreak();
- }
-
- // If there are commands in the queue when leaving the debugger
request
- // that these commands are processed.
- if (isolate_->debugger()->HasCommands()) {
- isolate_->stack_guard()->DebugCommand();
- }
-
- // If leaving the debugger with the debugger no longer active unload
it.
- if (!isolate_->debugger()->IsDebuggerActive()) {
- isolate_->debugger()->UnloadDebugger();
- }
- }
-
- // Leaving this debugger entry.
- debug->set_debugger_entry(prev_);
- }
+ EnterDebugger();
+ ~EnterDebugger();
// Check whether the debugger could be entered.
inline bool FailedToEnter() { return load_failed_; }
=======================================
--- /branches/bleeding_edge/src/execution.cc Tue Sep 27 03:42:32 2011
+++ /branches/bleeding_edge/src/execution.cc Mon Oct 3 04:13:20 2011
@@ -33,6 +33,7 @@
#include "bootstrapper.h"
#include "codegen.h"
#include "debug.h"
+#include "isolate-inl.h"
#include "runtime-profiler.h"
#include "simulator.h"
#include "v8threads.h"
=======================================
--- /branches/bleeding_edge/src/frames-inl.h Tue Sep 20 03:08:39 2011
+++ /branches/bleeding_edge/src/frames-inl.h Mon Oct 3 04:13:20 2011
@@ -75,6 +75,21 @@
inline StackHandler* StackHandler::FromAddress(Address address) {
return reinterpret_cast<StackHandler*>(address);
}
+
+
+inline bool StackHandler::is_entry() const {
+ return state() == ENTRY;
+}
+
+
+inline bool StackHandler::is_try_catch() const {
+ return state() == TRY_CATCH;
+}
+
+
+inline bool StackHandler::is_try_finally() const {
+ return state() == TRY_FINALLY;
+}
inline StackHandler::State StackHandler::state() const {
@@ -103,11 +118,36 @@
inline StackHandler* StackFrame::top_handler() const {
return iterator_->handler();
}
+
+
+inline Code* StackFrame::LookupCode() const {
+ return GetContainingCode(isolate(), pc());
+}
inline Code* StackFrame::GetContainingCode(Isolate* isolate, Address pc) {
return isolate->inner_pointer_to_code_cache()->GetCacheEntry(pc)->code;
}
+
+
+inline EntryFrame::EntryFrame(StackFrameIterator* iterator)
+ : StackFrame(iterator) {
+}
+
+
+inline EntryConstructFrame::EntryConstructFrame(StackFrameIterator*
iterator)
+ : EntryFrame(iterator) {
+}
+
+
+inline ExitFrame::ExitFrame(StackFrameIterator* iterator)
+ : StackFrame(iterator) {
+}
+
+
+inline StandardFrame::StandardFrame(StackFrameIterator* iterator)
+ : StackFrame(iterator) {
+}
inline Object* StandardFrame::GetExpression(int index) const {
@@ -153,6 +193,11 @@
Memory::Object_at(fp + StandardFrameConstants::kMarkerOffset);
return marker == Smi::FromInt(CONSTRUCT);
}
+
+
+inline JavaScriptFrame::JavaScriptFrame(StackFrameIterator* iterator)
+ : StandardFrame(iterator) {
+}
Address JavaScriptFrame::GetParameterSlot(int index) const {
@@ -188,6 +233,26 @@
ASSERT(result->IsJSFunction());
return result;
}
+
+
+inline OptimizedFrame::OptimizedFrame(StackFrameIterator* iterator)
+ : JavaScriptFrame(iterator) {
+}
+
+
+inline ArgumentsAdaptorFrame::ArgumentsAdaptorFrame(
+ StackFrameIterator* iterator) : JavaScriptFrame(iterator) {
+}
+
+
+inline InternalFrame::InternalFrame(StackFrameIterator* iterator)
+ : StandardFrame(iterator) {
+}
+
+
+inline ConstructFrame::ConstructFrame(StackFrameIterator* iterator)
+ : InternalFrame(iterator) {
+}
template<typename Iterator>
=======================================
--- /branches/bleeding_edge/src/frames.cc Tue Sep 20 06:36:52 2011
+++ /branches/bleeding_edge/src/frames.cc Mon Oct 3 04:13:20 2011
@@ -886,6 +886,11 @@
}
}
}
+
+
+int ArgumentsAdaptorFrame::GetNumberOfIncomingArguments() const {
+ return Smi::cast(GetExpression(0))->value();
+}
Address ArgumentsAdaptorFrame::GetCallerStackPointer() const {
=======================================
--- /branches/bleeding_edge/src/frames.h Tue Sep 20 03:08:39 2011
+++ /branches/bleeding_edge/src/frames.h Mon Oct 3 04:13:20 2011
@@ -106,9 +106,9 @@
static inline StackHandler* FromAddress(Address address);
// Testers
- bool is_entry() { return state() == ENTRY; }
- bool is_try_catch() { return state() == TRY_CATCH; }
- bool is_try_finally() { return state() == TRY_FINALLY; }
+ inline bool is_entry() const;
+ inline bool is_try_catch() const;
+ inline bool is_try_finally() const;
private:
// Accessors.
@@ -218,9 +218,7 @@
virtual Code* unchecked_code() const = 0;
// Get the code associated with this frame.
- Code* LookupCode() const {
- return GetContainingCode(isolate(), pc());
- }
+ inline Code* LookupCode() const;
// Get the code object that contains the given pc.
static inline Code* GetContainingCode(Isolate* isolate, Address pc);
@@ -302,7 +300,7 @@
virtual void SetCallerFp(Address caller_fp);
protected:
- explicit EntryFrame(StackFrameIterator* iterator) : StackFrame(iterator)
{ }
+ inline explicit EntryFrame(StackFrameIterator* iterator);
// The caller stack pointer for entry frames is always zero. The
// real information about the caller frame is available through the
@@ -329,8 +327,7 @@
}
protected:
- explicit EntryConstructFrame(StackFrameIterator* iterator)
- : EntryFrame(iterator) { }
+ inline explicit EntryConstructFrame(StackFrameIterator* iterator);
private:
friend class StackFrameIterator;
@@ -364,7 +361,7 @@
static void FillState(Address fp, Address sp, State* state);
protected:
- explicit ExitFrame(StackFrameIterator* iterator) : StackFrame(iterator)
{ }
+ inline explicit ExitFrame(StackFrameIterator* iterator);
virtual Address GetCallerStackPointer() const;
@@ -397,8 +394,7 @@
}
protected:
- explicit StandardFrame(StackFrameIterator* iterator)
- : StackFrame(iterator) { }
+ inline explicit StandardFrame(StackFrameIterator* iterator);
virtual void ComputeCallerState(State* state) const;
@@ -517,8 +513,7 @@
}
protected:
- explicit JavaScriptFrame(StackFrameIterator* iterator)
- : StandardFrame(iterator) { }
+ inline explicit JavaScriptFrame(StackFrameIterator* iterator);
virtual Address GetCallerStackPointer() const;
@@ -555,8 +550,7 @@
DeoptimizationInputData* GetDeoptimizationData(int* deopt_index);
protected:
- explicit OptimizedFrame(StackFrameIterator* iterator)
- : JavaScriptFrame(iterator) { }
+ inline explicit OptimizedFrame(StackFrameIterator* iterator);
private:
friend class StackFrameIterator;
@@ -584,12 +578,9 @@
int index) const;
protected:
- explicit ArgumentsAdaptorFrame(StackFrameIterator* iterator)
- : JavaScriptFrame(iterator) { }
-
- virtual int GetNumberOfIncomingArguments() const {
- return Smi::cast(GetExpression(0))->value();
- }
+ inline explicit ArgumentsAdaptorFrame(StackFrameIterator* iterator);
+
+ virtual int GetNumberOfIncomingArguments() const;
virtual Address GetCallerStackPointer() const;
@@ -614,8 +605,7 @@
}
protected:
- explicit InternalFrame(StackFrameIterator* iterator)
- : StandardFrame(iterator) { }
+ inline explicit InternalFrame(StackFrameIterator* iterator);
virtual Address GetCallerStackPointer() const;
@@ -636,8 +626,7 @@
}
protected:
- explicit ConstructFrame(StackFrameIterator* iterator)
- : InternalFrame(iterator) { }
+ inline explicit ConstructFrame(StackFrameIterator* iterator);
private:
friend class StackFrameIterator;
@@ -718,15 +707,19 @@
inline JavaScriptFrameIteratorTemp(Isolate* isolate, StackFrame::Id id);
- JavaScriptFrameIteratorTemp(Address fp, Address sp,
- Address low_bound, Address high_bound) :
+ JavaScriptFrameIteratorTemp(Address fp,
+ Address sp,
+ Address low_bound,
+ Address high_bound) :
iterator_(fp, sp, low_bound, high_bound) {
if (!done()) Advance();
}
JavaScriptFrameIteratorTemp(Isolate* isolate,
- Address fp, Address sp,
- Address low_bound, Address high_bound) :
+ Address fp,
+ Address sp,
+ Address low_bound,
+ Address high_bound) :
iterator_(isolate, fp, sp, low_bound, high_bound) {
if (!done()) Advance();
}
=======================================
--- /branches/bleeding_edge/src/isolate-inl.h Tue Apr 26 06:53:19 2011
+++ /branches/bleeding_edge/src/isolate-inl.h Mon Oct 3 04:13:20 2011
@@ -36,6 +36,21 @@
namespace internal {
+SaveContext::SaveContext(Isolate* isolate) :
prev_(isolate->save_context()) {
+ if (isolate->context() != NULL) {
+ context_ = Handle<Context>(isolate->context());
+#if __GNUC_VERSION__ >= 40100 && __GNUC_VERSION__ < 40300
+ dummy_ = Handle<Context>(isolate->context());
+#endif
+ }
+ isolate->set_save_context(this);
+
+ // If there is no JS frame under the current C frame, use the value 0.
+ JavaScriptFrameIterator it(isolate);
+ js_sp_ = it.done() ? 0 : it.frame()->sp();
+}
+
+
bool Isolate::DebuggerHasBreakPoints() {
#ifdef ENABLE_DEBUGGER_SUPPORT
return debug()->has_break_points();
=======================================
--- /branches/bleeding_edge/src/isolate.h Tue Sep 20 03:08:39 2011
+++ /branches/bleeding_edge/src/isolate.h Mon Oct 3 04:13:20 2011
@@ -1219,19 +1219,7 @@
// versions of GCC. See V8 issue 122 for details.
class SaveContext BASE_EMBEDDED {
public:
- explicit SaveContext(Isolate* isolate) : prev_(isolate->save_context()) {
- if (isolate->context() != NULL) {
- context_ = Handle<Context>(isolate->context());
-#if __GNUC_VERSION__ >= 40100 && __GNUC_VERSION__ < 40300
- dummy_ = Handle<Context>(isolate->context());
-#endif
- }
- isolate->set_save_context(this);
-
- // If there is no JS frame under the current C frame, use the value 0.
- JavaScriptFrameIterator it(isolate);
- js_sp_ = it.done() ? 0 : it.frame()->sp();
- }
+ inline explicit SaveContext(Isolate* isolate);
~SaveContext() {
if (context_.is_null()) {
=======================================
--- /branches/bleeding_edge/src/jsregexp.h Thu Sep 8 12:57:14 2011
+++ /branches/bleeding_edge/src/jsregexp.h Mon Oct 3 04:13:20 2011
@@ -1,4 +1,4 @@
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Copyright 2011 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
@@ -29,6 +29,7 @@
#define V8_JSREGEXP_H_
#include "allocation.h"
+#include "assembler.h"
#include "zone-inl.h"
namespace v8 {
=======================================
--- /branches/bleeding_edge/src/runtime-profiler.cc Mon Sep 19 11:36:47 2011
+++ /branches/bleeding_edge/src/runtime-profiler.cc Mon Oct 3 04:13:20 2011
@@ -35,6 +35,7 @@
#include "deoptimizer.h"
#include "execution.h"
#include "global-handles.h"
+#include "isolate-inl.h"
#include "mark-compact.h"
#include "platform.h"
#include "scopeinfo.h"
=======================================
--- /branches/bleeding_edge/src/runtime.cc Mon Oct 3 02:15:58 2011
+++ /branches/bleeding_edge/src/runtime.cc Mon Oct 3 04:13:20 2011
@@ -42,6 +42,7 @@
#include "deoptimizer.h"
#include "execution.h"
#include "global-handles.h"
+#include "isolate-inl.h"
#include "jsregexp.h"
#include "json-parser.h"
#include "liveedit.h"
=======================================
--- /branches/bleeding_edge/src/v8.h Mon Sep 19 11:36:47 2011
+++ /branches/bleeding_edge/src/v8.h Mon Oct 3 04:13:20 2011
@@ -65,7 +65,6 @@
#include "log-inl.h"
#include "cpu-profiler-inl.h"
#include "handles-inl.h"
-#include "isolate-inl.h"
namespace v8 {
namespace internal {
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev