Move ExitFrame::ComputeStackPointer from frames-<arch>.cc to frames.cc

The method has identical implementation for all architectures. Moved it into frames.cc

Drive-by: deleted SafeStackFrameIterator::is_working_iterator_, SafeStackFrameIterator::iteration_done_ is used instead.

BUG=None
R=loislo@chromium.org, svenpanne@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15293 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
yurys@chromium.org 2013-06-24 13:27:48 +00:00
parent 3aec8269f9
commit 264b7255e1
6 changed files with 13 additions and 35 deletions

View File

@ -32,7 +32,7 @@
#include "assembler.h"
#include "assembler-arm.h"
#include "assembler-arm-inl.h"
#include "frames-inl.h"
#include "frames.h"
#include "macro-assembler.h"
#include "macro-assembler-arm.h"
@ -40,11 +40,6 @@ namespace v8 {
namespace internal {
Address ExitFrame::ComputeStackPointer(Address fp) {
return Memory::Address_at(fp + ExitFrameConstants::kSPOffset);
}
Register JavaScriptFrame::fp_register() { return v8::internal::fp; }
Register JavaScriptFrame::context_register() { return cp; }

View File

@ -289,8 +289,7 @@ SafeStackFrameIterator::SafeStackFrameIterator(
stack_validator_(low_bound, high_bound),
is_valid_top_(IsValidTop(isolate, low_bound, high_bound)),
is_valid_fp_(IsWithinBounds(low_bound, high_bound, fp)),
is_working_iterator_(is_valid_top_ || is_valid_fp_),
iteration_done_(!is_working_iterator_),
iteration_done_(!is_valid_top_ && !is_valid_fp_),
iterator_(isolate, is_valid_top_, is_valid_fp_ ? fp : NULL, sp) {
}
@ -310,7 +309,6 @@ bool SafeStackFrameIterator::IsValidTop(Isolate* isolate,
void SafeStackFrameIterator::Advance() {
ASSERT(is_working_iterator_);
ASSERT(!done());
StackFrame* last_frame = iterator_.frame();
Address last_sp = last_frame->sp(), last_fp = last_frame->fp();
@ -564,6 +562,11 @@ StackFrame::Type ExitFrame::GetStateForFramePointer(Address fp, State* state) {
}
Address ExitFrame::ComputeStackPointer(Address fp) {
return Memory::Address_at(fp + ExitFrameConstants::kSPOffset);
}
void ExitFrame::FillState(Address fp, Address sp, State* state) {
state->sp = sp;
state->fp = fp;

View File

@ -860,7 +860,6 @@ class JavaScriptFrameIterator BASE_EMBEDDED {
// functions in runtime.js.
class StackTraceFrameIterator: public JavaScriptFrameIterator {
public:
StackTraceFrameIterator();
explicit StackTraceFrameIterator(Isolate* isolate);
void Advance();
@ -876,22 +875,22 @@ class SafeStackFrameIterator BASE_EMBEDDED {
Address low_bound, Address high_bound);
StackFrame* frame() const {
ASSERT(is_working_iterator_);
ASSERT(!iteration_done_);
return iterator_.frame();
}
bool done() const { return iteration_done_ ? true : iterator_.done(); }
bool done() const { return iteration_done_ || iterator_.done(); }
void Advance();
static bool is_active(Isolate* isolate);
private:
static bool IsWithinBounds(
Address low_bound, Address high_bound, Address addr) {
return low_bound <= addr && addr <= high_bound;
}
private:
class StackAddressValidator {
public:
StackAddressValidator(Address low_bound, Address high_bound)
@ -941,7 +940,6 @@ class SafeStackFrameIterator BASE_EMBEDDED {
StackAddressValidator stack_validator_;
const bool is_valid_top_;
const bool is_valid_fp_;
const bool is_working_iterator_;
bool iteration_done_;
StackFrameIterator iterator_;
};

View File

@ -32,17 +32,12 @@
#include "assembler.h"
#include "assembler-ia32.h"
#include "assembler-ia32-inl.h"
#include "frames-inl.h"
#include "frames.h"
namespace v8 {
namespace internal {
Address ExitFrame::ComputeStackPointer(Address fp) {
return Memory::Address_at(fp + ExitFrameConstants::kSPOffset);
}
Register JavaScriptFrame::fp_register() { return ebp; }
Register JavaScriptFrame::context_register() { return esi; }

View File

@ -33,20 +33,12 @@
#include "assembler.h"
#include "assembler-mips.h"
#include "assembler-mips-inl.h"
#include "frames-inl.h"
#include "mips/assembler-mips-inl.h"
#include "macro-assembler.h"
#include "macro-assembler-mips.h"
#include "frames.h"
namespace v8 {
namespace internal {
Address ExitFrame::ComputeStackPointer(Address fp) {
return Memory::Address_at(fp + ExitFrameConstants::kSPOffset);
}
Register JavaScriptFrame::fp_register() { return v8::internal::fp; }
Register JavaScriptFrame::context_register() { return cp; }

View File

@ -32,17 +32,12 @@
#include "assembler.h"
#include "assembler-x64.h"
#include "assembler-x64-inl.h"
#include "frames-inl.h"
#include "frames.h"
namespace v8 {
namespace internal {
Address ExitFrame::ComputeStackPointer(Address fp) {
return Memory::Address_at(fp + ExitFrameConstants::kSPOffset);
}
Register JavaScriptFrame::fp_register() { return rbp; }
Register JavaScriptFrame::context_register() { return rsi; }