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

Unified Diff: src/debug/debug-frames.h

Issue 1264993002: Debugger: refactor ScopeIterator, FrameInspector and DebugEvaluate. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: readd include Created 5 years, 4 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
Index: src/debug/debug-frames.h
diff --git a/src/debug/debug-frames.h b/src/debug/debug-frames.h
new file mode 100644
index 0000000000000000000000000000000000000000..86e817d47ffef991ce1b51562a9f9e20d9b2d9c3
--- /dev/null
+++ b/src/debug/debug-frames.h
@@ -0,0 +1,81 @@
+// Copyright 2015 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_DEBUG_DEBUG_FRAMES_H_
+#define V8_DEBUG_DEBUG_FRAMES_H_
+
+#include "src/deoptimizer.h"
+#include "src/frames.h"
+#include "src/isolate.h"
+#include "src/objects.h"
+
+namespace v8 {
+namespace internal {
+
+class FrameInspector {
+ public:
+ FrameInspector(JavaScriptFrame* frame, int inlined_jsframe_index,
+ Isolate* isolate);
+
+ ~FrameInspector();
+
+ int GetParametersCount();
+ int expression_count();
+ Object* GetFunction();
+ Object* GetParameter(int index);
+ Object* GetExpression(int index);
+ int GetSourcePosition();
+ bool IsConstructor();
+ Object* GetContext();
+
+ JavaScriptFrame* GetArgumentsFrame() { return frame_; }
+ void SetArgumentsFrame(JavaScriptFrame* frame);
+
+ void MaterializeStackLocals(Handle<JSObject> target,
+ Handle<ScopeInfo> scope_info);
+
+ void MaterializeStackLocals(Handle<JSObject> target,
+ Handle<JSFunction> function);
+
+ void UpdateStackLocalsFromMaterializedObject(Handle<JSObject> object,
+ Handle<ScopeInfo> scope_info);
+
+ private:
+ bool ParameterIsShadowedByContextLocal(Handle<ScopeInfo> info,
+ Handle<String> parameter_name);
+
+ JavaScriptFrame* frame_;
+ DeoptimizedFrameInfo* deoptimized_frame_;
+ Isolate* isolate_;
+ bool is_optimized_;
+ bool is_bottommost_;
+ bool has_adapted_arguments_;
+
+ DISALLOW_COPY_AND_ASSIGN(FrameInspector);
+};
+
+
+class DebugFrameHelper : public AllStatic {
+ public:
+ static SaveContext* FindSavedContextForFrame(Isolate* isolate,
+ JavaScriptFrame* frame);
+ // Advances the iterator to the frame that matches the index and returns the
+ // inlined frame index, or -1 if not found. Skips native JS functions.
+ static int FindIndexedNonNativeFrame(JavaScriptFrameIterator* it, int index);
+
+ // Helper functions for wrapping and unwrapping stack frame ids.
+ static Smi* WrapFrameId(StackFrame::Id id) {
+ DCHECK(IsAligned(OffsetFrom(id), static_cast<intptr_t>(4)));
+ return Smi::FromInt(id >> 2);
+ }
+
+ static StackFrame::Id UnwrapFrameId(int wrapped) {
+ return static_cast<StackFrame::Id>(wrapped << 2);
+ }
+};
+
+} // namespace internal
+} // namespace v8
+
+#endif // V8_DEBUG_DEBUG_FRAMES_H_

Powered by Google App Engine
This is Rietveld 408576698