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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 // You should hold the ExecutionAccess lock when you call this. | 427 // You should hold the ExecutionAccess lock when you call this. |
428 if (stored_limit != 0) { | 428 if (stored_limit != 0) { |
429 SetStackLimit(stored_limit); | 429 SetStackLimit(stored_limit); |
430 } | 430 } |
431 } | 431 } |
432 | 432 |
433 | 433 |
434 // --- C a l l s t o n a t i v e s --- | 434 // --- C a l l s t o n a t i v e s --- |
435 | 435 |
436 | 436 |
437 Handle<String> Execution::GetStackTraceLine(Handle<Object> recv, | |
438 Handle<JSFunction> fun, | |
439 Handle<Object> pos, | |
440 Handle<Object> is_global) { | |
441 Isolate* isolate = fun->GetIsolate(); | |
442 Handle<Object> strict_mode = isolate->factory()->ToBoolean(false); | |
443 | |
444 MaybeHandle<Object> maybe_callsite = | |
445 CallSiteUtils::Construct(isolate, recv, fun, pos, strict_mode); | |
446 if (maybe_callsite.is_null()) { | |
447 isolate->clear_pending_exception(); | |
448 return isolate->factory()->empty_string(); | |
449 } | |
450 | |
451 MaybeHandle<String> maybe_to_string = | |
452 CallSiteUtils::ToString(isolate, maybe_callsite.ToHandleChecked()); | |
453 if (maybe_to_string.is_null()) { | |
454 isolate->clear_pending_exception(); | |
455 return isolate->factory()->empty_string(); | |
456 } | |
457 | |
458 return maybe_to_string.ToHandleChecked(); | |
459 } | |
460 | |
461 | |
462 void StackGuard::HandleGCInterrupt() { | 437 void StackGuard::HandleGCInterrupt() { |
463 if (CheckAndClearInterrupt(GC_REQUEST)) { | 438 if (CheckAndClearInterrupt(GC_REQUEST)) { |
464 isolate_->heap()->HandleGCRequest(); | 439 isolate_->heap()->HandleGCRequest(); |
465 } | 440 } |
466 } | 441 } |
467 | 442 |
468 | 443 |
469 Object* StackGuard::HandleInterrupts() { | 444 Object* StackGuard::HandleInterrupts() { |
470 if (FLAG_verify_predictable) { | 445 if (FLAG_verify_predictable) { |
471 // Advance synthetic time by making a time request. | 446 // Advance synthetic time by making a time request. |
(...skipping 28 matching lines...) Expand all Loading... |
500 | 475 |
501 isolate_->counters()->stack_interrupts()->Increment(); | 476 isolate_->counters()->stack_interrupts()->Increment(); |
502 isolate_->counters()->runtime_profiler_ticks()->Increment(); | 477 isolate_->counters()->runtime_profiler_ticks()->Increment(); |
503 isolate_->runtime_profiler()->MarkCandidatesForOptimization(); | 478 isolate_->runtime_profiler()->MarkCandidatesForOptimization(); |
504 | 479 |
505 return isolate_->heap()->undefined_value(); | 480 return isolate_->heap()->undefined_value(); |
506 } | 481 } |
507 | 482 |
508 } // namespace internal | 483 } // namespace internal |
509 } // namespace v8 | 484 } // namespace v8 |
OLD | NEW |