OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/ast/prettyprinter.h" | 8 #include "src/ast/prettyprinter.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 return *isolate->factory()->NewFillerObject(size, double_align, space); | 256 return *isolate->factory()->NewFillerObject(size, double_align, space); |
257 } | 257 } |
258 | 258 |
259 | 259 |
260 // Collect the raw data for a stack trace. Returns an array of 4 | 260 // Collect the raw data for a stack trace. Returns an array of 4 |
261 // element segments each containing a receiver, function, code and | 261 // element segments each containing a receiver, function, code and |
262 // native code offset. | 262 // native code offset. |
263 RUNTIME_FUNCTION(Runtime_CollectStackTrace) { | 263 RUNTIME_FUNCTION(Runtime_CollectStackTrace) { |
264 HandleScope scope(isolate); | 264 HandleScope scope(isolate); |
265 DCHECK(args.length() == 2); | 265 DCHECK(args.length() == 2); |
266 CONVERT_ARG_HANDLE_CHECKED(JSObject, error_object, 0); | 266 CONVERT_ARG_HANDLE_CHECKED(JSReceiver, error_object, 0); |
267 CONVERT_ARG_HANDLE_CHECKED(Object, caller, 1); | 267 CONVERT_ARG_HANDLE_CHECKED(Object, caller, 1); |
268 | 268 |
269 if (!isolate->bootstrapper()->IsActive()) { | 269 if (!isolate->bootstrapper()->IsActive()) { |
270 // Optionally capture a more detailed stack trace for the message. | 270 // Optionally capture a more detailed stack trace for the message. |
271 RETURN_FAILURE_ON_EXCEPTION( | 271 RETURN_FAILURE_ON_EXCEPTION( |
272 isolate, isolate->CaptureAndSetDetailedStackTrace(error_object)); | 272 isolate, isolate->CaptureAndSetDetailedStackTrace(error_object)); |
273 // Capture a simple stack trace for the stack property. | 273 // Capture a simple stack trace for the stack property. |
274 RETURN_FAILURE_ON_EXCEPTION( | 274 RETURN_FAILURE_ON_EXCEPTION( |
275 isolate, isolate->CaptureAndSetSimpleStackTrace(error_object, caller)); | 275 isolate, isolate->CaptureAndSetSimpleStackTrace(error_object, caller)); |
276 } | 276 } |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 std::stringstream stats_stream; | 469 std::stringstream stats_stream; |
470 isolate->counters()->runtime_call_stats()->Print(stats_stream); | 470 isolate->counters()->runtime_call_stats()->Print(stats_stream); |
471 Handle<String> result = | 471 Handle<String> result = |
472 isolate->factory()->NewStringFromAsciiChecked(stats_stream.str().c_str()); | 472 isolate->factory()->NewStringFromAsciiChecked(stats_stream.str().c_str()); |
473 isolate->counters()->runtime_call_stats()->Reset(); | 473 isolate->counters()->runtime_call_stats()->Reset(); |
474 return *result; | 474 return *result; |
475 } | 475 } |
476 | 476 |
477 } // namespace internal | 477 } // namespace internal |
478 } // namespace v8 | 478 } // namespace v8 |
OLD | NEW |