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

Unified Diff: src/isolate.cc

Issue 2191293002: Move FormatStackTrace to C++ (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add formatting_stack_trace to ISOLATE_INIT_LIST Created 4 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/isolate.h ('k') | src/js/messages.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index ae165f0431c0afd07de410cae73a3cebf6dc44bf..2a52c6658a96800965ba0d085e493fbdaa8e0157 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -432,6 +432,17 @@ class StackTraceHelper {
bool encountered_strict_function_;
};
+namespace {
+
+// TODO(jgruber): Fix all cases in which frames give us a hole value (e.g. the
+// receiver in RegExp constructor frames.
+Handle<Object> TheHoleToUndefined(Isolate* isolate, Handle<Object> in) {
+ return (in->IsTheHole(isolate))
+ ? Handle<Object>::cast(isolate->factory()->undefined_value())
+ : in;
+}
+}
+
Handle<Object> Isolate::CaptureSimpleStackTrace(Handle<JSReceiver> error_object,
FrameSkipMode mode,
Handle<Object> caller) {
@@ -491,7 +502,7 @@ Handle<Object> Isolate::CaptureSimpleStackTrace(Handle<JSReceiver> error_object,
Handle<Smi> offset(Smi::FromInt(frames[i].code_offset()), this);
elements = MaybeGrow(this, elements, cursor, cursor + 4);
- elements->set(cursor++, *recv);
+ elements->set(cursor++, *TheHoleToUndefined(this, recv));
elements->set(cursor++, *fun);
elements->set(cursor++, *abstract_code);
elements->set(cursor++, *offset);
@@ -966,7 +977,8 @@ Object* Isolate::StackOverflow() {
MessageTemplate::TemplateString(MessageTemplate::kStackOverflow));
Handle<Object> exception;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- this, exception, ConstructError(this, fun, fun, msg, SKIP_NONE, true));
+ this, exception,
+ ErrorUtils::Construct(this, fun, fun, msg, SKIP_NONE, true));
Throw(*exception, nullptr);
« no previous file with comments | « src/isolate.h ('k') | src/js/messages.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698