Add GC handling for new field in DeoptimizedFrameInfo.

Review URL: https://chromiumcodereview.appspot.com/9301030

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10564 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
yangguo@chromium.org 2012-01-31 12:08:33 +00:00
parent 664669cf17
commit c1f95cca94
3 changed files with 15 additions and 10 deletions

View File

@ -1604,7 +1604,11 @@ DeoptimizedFrameInfo::DeoptimizedFrameInfo(
SetFunction(output_frame->GetFunction());
expression_count_ = output_frame->GetExpressionCount();
expression_stack_ = new Object*[expression_count_];
pc_ = output_frame->GetPc();
// Get the source position using the unoptimized code.
Address pc = reinterpret_cast<Address>(output_frame->GetPc());
Code* code = Code::cast(Isolate::Current()->heap()->FindCodeObject(pc));
source_position_ = code->SourcePosition(pc);
for (int i = 0; i < expression_count_; i++) {
SetExpression(i, output_frame->GetExpression(i));
}
@ -1627,6 +1631,7 @@ DeoptimizedFrameInfo::~DeoptimizedFrameInfo() {
delete[] parameters_;
}
void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) {
v->VisitPointer(BitCast<Object**>(&function_));
v->VisitPointers(parameters_, parameters_ + parameters_count_);

View File

@ -749,8 +749,8 @@ class DeoptimizedFrameInfo : public Malloced {
return expression_stack_[index];
}
Address GetPc() {
return reinterpret_cast<Address>(pc_);
int GetSourcePosition() {
return source_position_;
}
private:
@ -776,7 +776,7 @@ class DeoptimizedFrameInfo : public Malloced {
int expression_count_;
Object** parameters_;
Object** expression_stack_;
intptr_t pc_;
int source_position_;
friend class Deoptimizer;
};

View File

@ -10747,10 +10747,10 @@ class FrameInspector {
? deoptimized_frame_->GetExpression(index)
: frame_->GetExpression(index);
}
Address GetPc() {
int GetSourcePosition() {
return is_optimized_
? deoptimized_frame_->GetPc()
: frame_->pc();
? deoptimized_frame_->GetSourcePosition()
: frame_->LookupCode()->SourcePosition(frame_->pc());
}
// To inspect all the provided arguments the frame might need to be
@ -10858,15 +10858,15 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetFrameDetails) {
Handle<Object> frame_id(WrapFrameId(it.frame()->id()), isolate);
// Find source position in unoptimized code.
Handle<JSFunction> function(JSFunction::cast(frame_inspector.GetFunction()));
Handle<SharedFunctionInfo> shared(function->shared());
int position = shared->code()->SourcePosition(frame_inspector.GetPc());
int position = frame_inspector.GetSourcePosition();
// Check for constructor frame. Inlined frames cannot be construct calls.
bool inlined_frame = is_optimized && inlined_jsframe_index != 0;
bool constructor = !inlined_frame && it.frame()->IsConstructor();
// Get scope info and read from it for local variable information.
Handle<JSFunction> function(JSFunction::cast(frame_inspector.GetFunction()));
Handle<SharedFunctionInfo> shared(function->shared());
Handle<ScopeInfo> scope_info(shared->scope_info());
ASSERT(*scope_info != ScopeInfo::Empty());