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

Side by Side Diff: src/builtins/builtins-error.cc

Issue 2452543003: Don't wrap roots in Handle just to dereference immediately. (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « src/bootstrapper.cc ('k') | src/builtins/builtins-math.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/builtins/builtins.h" 5 #include "src/builtins/builtins.h"
6 #include "src/builtins/builtins-utils.h" 6 #include "src/builtins/builtins-utils.h"
7 7
8 #include "src/messages.h" 8 #include "src/messages.h"
9 #include "src/property-descriptor.h" 9 #include "src/property-descriptor.h"
10 #include "src/string-builder.h" 10 #include "src/string-builder.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 // Collect the stack trace. 49 // Collect the stack trace.
50 50
51 RETURN_FAILURE_ON_EXCEPTION(isolate, 51 RETURN_FAILURE_ON_EXCEPTION(isolate,
52 isolate->CaptureAndSetDetailedStackTrace(object)); 52 isolate->CaptureAndSetDetailedStackTrace(object));
53 53
54 // Eagerly format the stack trace and set the stack property. 54 // Eagerly format the stack trace and set the stack property.
55 55
56 Handle<Object> stack_trace = 56 Handle<Object> stack_trace =
57 isolate->CaptureSimpleStackTrace(object, mode, caller); 57 isolate->CaptureSimpleStackTrace(object, mode, caller);
58 if (!stack_trace->IsJSArray()) return *isolate->factory()->undefined_value(); 58 if (!stack_trace->IsJSArray()) return isolate->heap()->undefined_value();
59 59
60 Handle<Object> formatted_stack_trace; 60 Handle<Object> formatted_stack_trace;
61 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 61 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
62 isolate, formatted_stack_trace, 62 isolate, formatted_stack_trace,
63 ErrorUtils::FormatStackTrace(isolate, object, stack_trace)); 63 ErrorUtils::FormatStackTrace(isolate, object, stack_trace));
64 64
65 PropertyDescriptor desc; 65 PropertyDescriptor desc;
66 desc.set_configurable(true); 66 desc.set_configurable(true);
67 desc.set_writable(true); 67 desc.set_writable(true);
68 desc.set_value(formatted_stack_trace); 68 desc.set_value(formatted_stack_trace);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 Handle<Object> undefined = isolate->factory()->undefined_value(); 126 Handle<Object> undefined = isolate->factory()->undefined_value();
127 const int template_index = MessageTemplate::kURIMalformed; 127 const int template_index = MessageTemplate::kURIMalformed;
128 RETURN_RESULT_OR_FAILURE( 128 RETURN_RESULT_OR_FAILURE(
129 isolate, 129 isolate,
130 ErrorUtils::MakeGenericError(isolate, constructor, template_index, 130 ErrorUtils::MakeGenericError(isolate, constructor, template_index,
131 undefined, undefined, undefined, SKIP_NONE)); 131 undefined, undefined, undefined, SKIP_NONE));
132 } 132 }
133 133
134 } // namespace internal 134 } // namespace internal
135 } // namespace v8 135 } // namespace v8
OLDNEW
« no previous file with comments | « src/bootstrapper.cc ('k') | src/builtins/builtins-math.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698