Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(289)

Unified Diff: src/frames.cc

Issue 7230045: Support debugger inspection of locals in optimized frames (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/frames.h ('k') | src/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/frames.cc
diff --git a/src/frames.cc b/src/frames.cc
index d81d5afaaa7370f4198afb8881d91a6bfd73c020..4e67463f1fb75c31e29d32d39480470944c58c06 100644
--- a/src/frames.cc
+++ b/src/frames.cc
@@ -528,6 +528,17 @@ Address StandardFrame::GetExpressionAddress(int n) const {
}
+Object* StandardFrame::GetExpression(Address fp, int index) {
+ return Memory::Object_at(GetExpressionAddress(fp, index));
+}
+
+
+Address StandardFrame::GetExpressionAddress(Address fp, int n) {
+ const int offset = StandardFrameConstants::kExpressionsOffset;
+ return fp + offset - n * kPointerSize;
+}
+
+
int StandardFrame::ComputeExpressionsCount() const {
const int offset =
StandardFrameConstants::kExpressionsOffset + kPointerSize;
@@ -646,6 +657,16 @@ bool JavaScriptFrame::IsConstructor() const {
}
+int JavaScriptFrame::GetArgumentsLength() const {
+ // If there is an arguments adaptor frame get the arguments length from it.
+ if (has_adapted_arguments()) {
+ return Smi::cast(GetExpression(caller_fp(), 0))->value();
+ } else {
+ return GetNumberOfIncomingArguments();
+ }
+}
+
+
Code* JavaScriptFrame::unchecked_code() const {
JSFunction* function = JSFunction::cast(this->function());
return function->unchecked_code();
@@ -812,6 +833,22 @@ DeoptimizationInputData* OptimizedFrame::GetDeoptimizationData(
}
+int OptimizedFrame::GetInlineCount() {
+ ASSERT(is_optimized());
+
+ int deopt_index = Safepoint::kNoDeoptimizationIndex;
+ DeoptimizationInputData* data = GetDeoptimizationData(&deopt_index);
+
+ TranslationIterator it(data->TranslationByteArray(),
+ data->TranslationIndex(deopt_index)->value());
+ Translation::Opcode opcode = static_cast<Translation::Opcode>(it.Next());
+ ASSERT(opcode == Translation::BEGIN);
+ USE(opcode);
+ int frame_count = it.Next();
+ return frame_count;
+}
+
+
void OptimizedFrame::GetFunctions(List<JSFunction*>* functions) {
ASSERT(functions->length() == 0);
ASSERT(is_optimized());
« no previous file with comments | « src/frames.h ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698