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

Unified Diff: src/isolate.cc

Issue 2191293002: Move FormatStackTrace to C++ (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix compilation in release mode 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
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index 16696e2c98a1c49bde521d55c068a57a96ba9428..c0a5da77bcb3ca88f95a8b399db51aa296951d95 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);
@@ -1923,6 +1935,7 @@ Isolate::Isolate(bool enable_serializer)
deoptimizer_data_(NULL),
deoptimizer_lazy_throw_(false),
materialized_object_store_(NULL),
+ formatting_stack_trace_(false),
capture_stack_trace_for_uncaught_exceptions_(false),
stack_trace_for_uncaught_exceptions_frame_limit_(0),
stack_trace_for_uncaught_exceptions_options_(StackTrace::kOverview),

Powered by Google App Engine
This is Rietveld 408576698