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

Unified Diff: runtime/vm/reusable_handles.h

Issue 264933006: Fix edge case where profiler would miss the caller of the top frame (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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 | « runtime/vm/profiler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/reusable_handles.h
diff --git a/runtime/vm/reusable_handles.h b/runtime/vm/reusable_handles.h
index db2752e0b4aa81fc4f4afb480f98c920e00f61cb..ef04f6ce803edfba9828cc8f846f0ad16bfb6da1 100644
--- a/runtime/vm/reusable_handles.h
+++ b/runtime/vm/reusable_handles.h
@@ -11,19 +11,24 @@
namespace dart {
-// The class ReusableHandleScope is used in regions of the
-// virtual machine where isolate specific reusable handles are used.
-// This class asserts that we do not add code that will result in recursive
-// uses of reusable handles.
-// It is used as follows:
+// Classes registered in REUSABLE_HANDLE_LIST have an isolate specific reusable
+// handle. A guard class (Reusable*ClassName*HandleScope) should be used in
+// regions of the virtual machine where the isolate specific reusable handle
+// of that type is used. The class asserts that we do not add code that will
+// result in recursive uses of the class's reusable handle.
+//
+// Below is an example of a reusable array handle via the
+// REUSABLE_*CLASSNAME*_HANDLESCOPE macro:
+//
// {
-// ReusableHandleScope reused_handles(isolate);
+// REUSABLE_ARRAY_HANDLESCOPE(isolate);
// ....
-// .....
-// code that uses isolate specific reusable handles.
-// Array& funcs = reused_handles.ArrayHandle();
+// ....
+// Array& funcs = reused_array_handle.Handle();
+// code that uses funcs
// ....
// }
+//
#if defined(DEBUG)
#define REUSABLE_SCOPE(name) \
@@ -76,28 +81,31 @@ namespace dart {
REUSABLE_HANDLE_LIST(REUSABLE_SCOPE)
#undef REUSABLE_SCOPE
-#define REUSABLE_OBJECT_HANDLESCOPE(isolate) \
- ReusableObjectHandleScope reused_object_handle(isolate);
-#define REUSABLE_ERROR_HANDLESCOPE(isolate) \
- ReusableErrorHandleScope reused_error_handle(isolate);
+#define REUSABLE_ABSTRACT_TYPE_HANDLESCOPE(isolate) \
+ ReusableAbstractTypeHandleScope reused_abstract_type(isolate);
#define REUSABLE_ARRAY_HANDLESCOPE(isolate) \
ReusableArrayHandleScope reused_array_handle(isolate);
-#define REUSABLE_STRING_HANDLESCOPE(isolate) \
- ReusableStringHandleScope reused_string_handle(isolate);
-#define REUSABLE_INSTANCE_HANDLESCOPE(isolate) \
- ReusableInstanceHandleScope reused_instance_handle(isolate);
-#define REUSABLE_FUNCTION_HANDLESCOPE(isolate) \
- ReusableFunctionHandleScope reused_function_handle(isolate);
-#define REUSABLE_FIELD_HANDLESCOPE(isolate) \
- ReusableFieldHandleScope reused_field_handle(isolate);
#define REUSABLE_CLASS_HANDLESCOPE(isolate) \
ReusableClassHandleScope reused_class_handle(isolate);
-#define REUSABLE_ABSTRACT_TYPE_HANDLESCOPE(isolate) \
- ReusableAbstractTypeHandleScope reused_abstract_type(isolate);
-#define REUSABLE_TYPE_PARAMETER_HANDLESCOPE(isolate) \
- ReusableTypeParameterHandleScope reused_type_parameter(isolate);
+#define REUSABLE_CODE_HANDLESCOPE(isolate) \
+ ReusableCodeHandleScope reused_code_handle(isolate);
+#define REUSABLE_ERROR_HANDLESCOPE(isolate) \
+ ReusableErrorHandleScope reused_error_handle(isolate);
+#define REUSABLE_FIELD_HANDLESCOPE(isolate) \
+ ReusableFieldHandleScope reused_field_handle(isolate);
+#define REUSABLE_FUNCTION_HANDLESCOPE(isolate) \
+ ReusableFunctionHandleScope reused_function_handle(isolate);
+#define REUSABLE_INSTANCE_HANDLESCOPE(isolate) \
+ ReusableInstanceHandleScope reused_instance_handle(isolate);
+#define REUSABLE_OBJECT_HANDLESCOPE(isolate) \
+ ReusableObjectHandleScope reused_object_handle(isolate);
+#define REUSABLE_STRING_HANDLESCOPE(isolate) \
+ ReusableStringHandleScope reused_string_handle(isolate);
#define REUSABLE_TYPE_ARGUMENTS_HANDLESCOPE(isolate) \
ReusableTypeArgumentsHandleScope reused_type_arguments_handle(isolate);
+#define REUSABLE_TYPE_PARAMETER_HANDLESCOPE(isolate) \
+ ReusableTypeParameterHandleScope reused_type_parameter(isolate);
+
} // namespace dart
« no previous file with comments | « runtime/vm/profiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698