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

Unified Diff: src/runtime.cc

Issue 11377158: Fire 'stack' getter of error objects after GC. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: use hidden properties to mark oneshot getter Created 8 years 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/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index de74f2ca6240d69f13fbd45df4d232a833ba3759..71d4387684f21445b5b1e05643119e2d27357465 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -12921,6 +12921,17 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CollectStackTrace) {
}
+// Mark a function to recognize when called after GC to format the stack trace.
+RUNTIME_FUNCTION(MaybeObject*, Runtime_MarkOneShotGetter) {
+ ASSERT_EQ(args.length(), 1);
+ CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0);
+ HandleScope scope(isolate);
+ Handle<String> key = isolate->factory()->hidden_stack_trace_symbol();
+ JSObject::SetHiddenProperty(fun, key, key);
+ return *fun;
+}
+
+
// Retrieve the raw stack trace collected on stack overflow and delete
// it since it is used only once to avoid keeping it alive.
RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOverflowedRawStackTrace) {
« src/messages.js ('K') | « src/runtime.h ('k') | test/cctest/test-decls.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698