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

Unified Diff: src/runtime.cc

Issue 19805003: Restore test and behavior prior to deferred stack trace formatting. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: comment addressed Created 7 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 | « src/runtime.h ('k') | test/cctest/cctest.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index c36d453d03e0cb7c8b72dd36ed9aeb379a1b5698..352ca7c744465d5f90461280c81fda1c463f97a9 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -13429,50 +13429,21 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CollectStackTrace) {
}
-// Mark a function to recognize when called after GC to format the stack trace.
-RUNTIME_FUNCTION(MaybeObject*, Runtime_MarkOneShotGetter) {
- HandleScope scope(isolate);
- ASSERT_EQ(args.length(), 1);
- CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0);
- Handle<String> key = isolate->factory()->hidden_stack_trace_string();
- JSObject::SetHiddenProperty(fun, key, key);
- return *fun;
-}
-
-
-// Retrieve the stack trace. This could be the raw stack trace collected
-// on stack overflow or the already formatted stack trace string.
-RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOverflowedStackTrace) {
+// Retrieve the stack trace. This is the raw stack trace that yet has to
+// be formatted. Since we only need this once, clear it afterwards.
+RUNTIME_FUNCTION(MaybeObject*, Runtime_GetAndClearOverflowedStackTrace) {
HandleScope scope(isolate);
ASSERT_EQ(args.length(), 1);
CONVERT_ARG_CHECKED(JSObject, error_object, 0);
String* key = isolate->heap()->hidden_stack_trace_string();
Object* result = error_object->GetHiddenProperty(key);
- if (result->IsTheHole()) result = isolate->heap()->undefined_value();
- RUNTIME_ASSERT(result->IsJSArray() ||
- result->IsString() ||
- result->IsUndefined());
+ if (result->IsTheHole()) return isolate->heap()->undefined_value();
+ RUNTIME_ASSERT(result->IsJSArray() || result->IsUndefined());
+ error_object->DeleteHiddenProperty(key);
return result;
}
-// Set or clear the stack trace attached to an stack overflow error object.
-RUNTIME_FUNCTION(MaybeObject*, Runtime_SetOverflowedStackTrace) {
- HandleScope scope(isolate);
- ASSERT_EQ(args.length(), 2);
- CONVERT_ARG_HANDLE_CHECKED(JSObject, error_object, 0);
- CONVERT_ARG_HANDLE_CHECKED(HeapObject, value, 1);
- Handle<String> key = isolate->factory()->hidden_stack_trace_string();
- if (value->IsUndefined()) {
- error_object->DeleteHiddenProperty(*key);
- } else {
- RUNTIME_ASSERT(value->IsString());
- JSObject::SetHiddenProperty(error_object, key, value);
- }
- return *error_object;
-}
-
-
// Returns V8 version as a string.
RUNTIME_FUNCTION(MaybeObject*, Runtime_GetV8Version) {
SealHandleScope shs(isolate);
« no previous file with comments | « src/runtime.h ('k') | test/cctest/cctest.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698