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

Unified Diff: src/deoptimizer.h

Issue 7343005: Support scope information and evaluation in optimized frames (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 5 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 | « no previous file | src/mirror-debugger.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/deoptimizer.h
diff --git a/src/deoptimizer.h b/src/deoptimizer.h
index 9265905366bb6e3921f0f803d92e83c6e5175a07..5e998d055d2edb66fe4964352b9a3e414d598f30 100644
--- a/src/deoptimizer.h
+++ b/src/deoptimizer.h
@@ -717,6 +717,44 @@ class DeoptimizedFrameInfo : public Malloced {
friend class Deoptimizer;
};
+
+
+// Scoped version of DeoptimizedFrameInfo.
+class ScopedDeoptimizedFrameInfo {
Sven Panne 2011/07/12 13:40:32 This class looks a bits strange: If the frame pass
Søren Thygesen Gjesse 2011/07/12 14:20:36 That is true, but it was the simplest way to have
+ public:
+ ScopedDeoptimizedFrameInfo(JavaScriptFrame* frame,
+ int inlined_frame_index,
+ Isolate* isolate)
+ : deoptimized_frame_(NULL), isolate_(isolate) {
+ // Calculate the deoptimized frame.
+ if (frame->is_optimized()) {
+ deoptimized_frame_ = Deoptimizer::DebuggerInspectableFrame(
+ frame, inlined_frame_index, isolate);
+ }
+ }
+
+ ~ScopedDeoptimizedFrameInfo() {
+ // Get rid of the calculated deoptimized frame if any.
+ if (deoptimized_frame_ != NULL) {
+ Deoptimizer::DeleteDebuggerInspectableFrame(deoptimized_frame_,
+ isolate_);
+ }
+ }
+
+ int parameters_count() { return deoptimized_frame_->parameters_count(); }
+ int expression_count() { return deoptimized_frame_->expression_count(); }
+ JSFunction* GetFunction() { return deoptimized_frame_->GetFunction(); }
+ Object* GetParameter(int index) {
+ return deoptimized_frame_->GetParameter(index);
+ }
+ Object* GetExpression(int index) {
+ return deoptimized_frame_->GetExpression(index);
+ }
+
+ private:
+ DeoptimizedFrameInfo* deoptimized_frame_;
+ Isolate* isolate_;
+};
#endif
} } // namespace v8::internal
« no previous file with comments | « no previous file | src/mirror-debugger.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698