| 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/execution.h" | 5 #include "src/execution.h" |
| 6 | 6 |
| 7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
| 8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
| 9 #include "src/isolate-inl.h" | 9 #include "src/isolate-inl.h" |
| 10 #include "src/messages.h" | 10 #include "src/messages.h" |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 | 424 |
| 425 | 425 |
| 426 // --- C a l l s t o n a t i v e s --- | 426 // --- C a l l s t o n a t i v e s --- |
| 427 | 427 |
| 428 | 428 |
| 429 Handle<String> Execution::GetStackTraceLine(Handle<Object> recv, | 429 Handle<String> Execution::GetStackTraceLine(Handle<Object> recv, |
| 430 Handle<JSFunction> fun, | 430 Handle<JSFunction> fun, |
| 431 Handle<Object> pos, | 431 Handle<Object> pos, |
| 432 Handle<Object> is_global) { | 432 Handle<Object> is_global) { |
| 433 Isolate* isolate = fun->GetIsolate(); | 433 Isolate* isolate = fun->GetIsolate(); |
| 434 Handle<Object> args[] = { recv, fun, pos, is_global }; | 434 |
| 435 MaybeHandle<Object> maybe_result = | 435 Handle<JSFunction> ctor = |
| 436 TryCall(isolate, isolate->get_stack_trace_line_fun(), | 436 handle(isolate->native_context()->callsite_function(), isolate); |
| 437 isolate->factory()->undefined_value(), arraysize(args), args); | 437 Handle<Object> strict_mode = isolate->factory()->ToBoolean(false); |
| 438 Handle<Object> result; | 438 |
| 439 if (!maybe_result.ToHandle(&result) || !result->IsString()) { | 439 MaybeHandle<Object> maybe_callsite = CallSiteUtils::Construct( |
| 440 isolate, ctor, ctor, recv, fun, pos, strict_mode); |
| 441 if (maybe_callsite.is_null()) { |
| 442 isolate->clear_pending_exception(); |
| 440 return isolate->factory()->empty_string(); | 443 return isolate->factory()->empty_string(); |
| 441 } | 444 } |
| 442 | 445 |
| 443 return Handle<String>::cast(result); | 446 MaybeHandle<String> maybe_to_string = |
| 447 CallSiteUtils::ToString(isolate, maybe_callsite.ToHandleChecked()); |
| 448 if (maybe_to_string.is_null()) { |
| 449 isolate->clear_pending_exception(); |
| 450 return isolate->factory()->empty_string(); |
| 451 } |
| 452 |
| 453 return maybe_to_string.ToHandleChecked(); |
| 444 } | 454 } |
| 445 | 455 |
| 446 | 456 |
| 447 void StackGuard::HandleGCInterrupt() { | 457 void StackGuard::HandleGCInterrupt() { |
| 448 if (CheckAndClearInterrupt(GC_REQUEST)) { | 458 if (CheckAndClearInterrupt(GC_REQUEST)) { |
| 449 isolate_->heap()->HandleGCRequest(); | 459 isolate_->heap()->HandleGCRequest(); |
| 450 } | 460 } |
| 451 } | 461 } |
| 452 | 462 |
| 453 | 463 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 | 495 |
| 486 isolate_->counters()->stack_interrupts()->Increment(); | 496 isolate_->counters()->stack_interrupts()->Increment(); |
| 487 isolate_->counters()->runtime_profiler_ticks()->Increment(); | 497 isolate_->counters()->runtime_profiler_ticks()->Increment(); |
| 488 isolate_->runtime_profiler()->MarkCandidatesForOptimization(); | 498 isolate_->runtime_profiler()->MarkCandidatesForOptimization(); |
| 489 | 499 |
| 490 return isolate_->heap()->undefined_value(); | 500 return isolate_->heap()->undefined_value(); |
| 491 } | 501 } |
| 492 | 502 |
| 493 } // namespace internal | 503 } // namespace internal |
| 494 } // namespace v8 | 504 } // namespace v8 |
| OLD | NEW |