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

Side by Side Diff: src/accessors.cc

Issue 2164903004: Eagerly format traces in captureStackTrace (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/builtins/builtins-error.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/accessors.h" 5 #include "src/accessors.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/contexts.h" 8 #include "src/contexts.h"
9 #include "src/deoptimizer.h" 9 #include "src/deoptimizer.h"
10 #include "src/execution.h" 10 #include "src/execution.h"
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1125 MaybeHandle<JSReceiver> ClearInternalStackTrace(Isolate* isolate, 1125 MaybeHandle<JSReceiver> ClearInternalStackTrace(Isolate* isolate,
1126 Handle<JSObject> error) { 1126 Handle<JSObject> error) {
1127 RETURN_ON_EXCEPTION( 1127 RETURN_ON_EXCEPTION(
1128 isolate, 1128 isolate,
1129 JSReceiver::SetProperty(error, isolate->factory()->stack_trace_symbol(), 1129 JSReceiver::SetProperty(error, isolate->factory()->stack_trace_symbol(),
1130 isolate->factory()->undefined_value(), STRICT), 1130 isolate->factory()->undefined_value(), STRICT),
1131 JSReceiver); 1131 JSReceiver);
1132 return error; 1132 return error;
1133 } 1133 }
1134 1134
1135 MaybeHandle<Object> FormatStackTrace(Isolate* isolate, Handle<JSObject> error,
1136 Handle<Object> stack_trace) {
1137 // TODO(jgruber): Port FormatStackTrace from JS.
1138 Handle<JSFunction> fun = isolate->error_format_stack_trace();
1139
1140 int argc = 2;
1141 ScopedVector<Handle<Object>> argv(argc);
1142 argv[0] = error;
1143 argv[1] = stack_trace;
1144
1145 Handle<Object> formatted_stack_trace;
1146 ASSIGN_RETURN_ON_EXCEPTION(
1147 isolate, formatted_stack_trace,
1148 Execution::Call(isolate, fun, error, argc, argv.start()), Object);
1149
1150 return formatted_stack_trace;
1151 }
1152
1153 bool IsAccessor(Handle<Object> receiver, Handle<Name> name, 1135 bool IsAccessor(Handle<Object> receiver, Handle<Name> name,
1154 Handle<JSObject> holder) { 1136 Handle<JSObject> holder) {
1155 LookupIterator it(receiver, name, holder, 1137 LookupIterator it(receiver, name, holder,
1156 LookupIterator::OWN_SKIP_INTERCEPTOR); 1138 LookupIterator::OWN_SKIP_INTERCEPTOR);
1157 // Skip any access checks we might hit. This accessor should never hit in a 1139 // Skip any access checks we might hit. This accessor should never hit in a
1158 // situation where the caller does not have access. 1140 // situation where the caller does not have access.
1159 if (it.state() == LookupIterator::ACCESS_CHECK) { 1141 if (it.state() == LookupIterator::ACCESS_CHECK) {
1160 CHECK(it.HasAccess()); 1142 CHECK(it.HasAccess());
1161 it.Next(); 1143 it.Next();
1162 } 1144 }
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
1245 Handle<AccessorInfo> Accessors::ErrorStackInfo(Isolate* isolate, 1227 Handle<AccessorInfo> Accessors::ErrorStackInfo(Isolate* isolate,
1246 PropertyAttributes attributes) { 1228 PropertyAttributes attributes) {
1247 Handle<AccessorInfo> info = 1229 Handle<AccessorInfo> info =
1248 MakeAccessor(isolate, isolate->factory()->stack_string(), 1230 MakeAccessor(isolate, isolate->factory()->stack_string(),
1249 &ErrorStackGetter, &ErrorStackSetter, attributes); 1231 &ErrorStackGetter, &ErrorStackSetter, attributes);
1250 return info; 1232 return info;
1251 } 1233 }
1252 1234
1253 } // namespace internal 1235 } // namespace internal
1254 } // namespace v8 1236 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/builtins/builtins-error.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698