| OLD | NEW |
| 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/frames.h" | 5 #include "src/frames.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "src/ast/ast.h" | 9 #include "src/ast/ast.h" |
| 10 #include "src/ast/scopeinfo.h" | 10 #include "src/ast/scopeinfo.h" |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 ReturnAddressLocationResolver resolver) { | 393 ReturnAddressLocationResolver resolver) { |
| 394 DCHECK(return_address_location_resolver_ == NULL); | 394 DCHECK(return_address_location_resolver_ == NULL); |
| 395 return_address_location_resolver_ = resolver; | 395 return_address_location_resolver_ = resolver; |
| 396 } | 396 } |
| 397 | 397 |
| 398 static bool IsInterpreterFramePc(Isolate* isolate, Address pc) { | 398 static bool IsInterpreterFramePc(Isolate* isolate, Address pc) { |
| 399 Code* interpreter_entry_trampoline = | 399 Code* interpreter_entry_trampoline = |
| 400 isolate->builtins()->builtin(Builtins::kInterpreterEntryTrampoline); | 400 isolate->builtins()->builtin(Builtins::kInterpreterEntryTrampoline); |
| 401 Code* interpreter_bytecode_dispatch = | 401 Code* interpreter_bytecode_dispatch = |
| 402 isolate->builtins()->builtin(Builtins::kInterpreterEnterBytecodeDispatch); | 402 isolate->builtins()->builtin(Builtins::kInterpreterEnterBytecodeDispatch); |
| 403 Code* interpreter_baseline_on_return = |
| 404 isolate->builtins()->builtin(Builtins::kInterpreterMarkBaselineOnReturn); |
| 403 | 405 |
| 404 return (pc >= interpreter_entry_trampoline->instruction_start() && | 406 return (pc >= interpreter_entry_trampoline->instruction_start() && |
| 405 pc < interpreter_entry_trampoline->instruction_end()) || | 407 pc < interpreter_entry_trampoline->instruction_end()) || |
| 406 (pc >= interpreter_bytecode_dispatch->instruction_start() && | 408 (pc >= interpreter_bytecode_dispatch->instruction_start() && |
| 407 pc < interpreter_bytecode_dispatch->instruction_end()); | 409 pc < interpreter_bytecode_dispatch->instruction_end()) || |
| 410 (pc >= interpreter_baseline_on_return->instruction_start() && |
| 411 pc < interpreter_baseline_on_return->instruction_end()); |
| 408 } | 412 } |
| 409 | 413 |
| 410 StackFrame::Type StackFrame::ComputeType(const StackFrameIteratorBase* iterator, | 414 StackFrame::Type StackFrame::ComputeType(const StackFrameIteratorBase* iterator, |
| 411 State* state) { | 415 State* state) { |
| 412 DCHECK(state->fp != NULL); | 416 DCHECK(state->fp != NULL); |
| 413 | 417 |
| 414 #if defined(USE_SIMULATOR) | 418 #if defined(USE_SIMULATOR) |
| 415 MSAN_MEMORY_IS_INITIALIZED( | 419 MSAN_MEMORY_IS_INITIALIZED( |
| 416 state->fp + CommonFrameConstants::kContextOrFrameTypeOffset, | 420 state->fp + CommonFrameConstants::kContextOrFrameTypeOffset, |
| 417 kPointerSize); | 421 kPointerSize); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 438 return INTERPRETED; | 442 return INTERPRETED; |
| 439 } else { | 443 } else { |
| 440 return JAVA_SCRIPT; | 444 return JAVA_SCRIPT; |
| 441 } | 445 } |
| 442 } | 446 } |
| 443 } else { | 447 } else { |
| 444 // Look up the code object to figure out the type of the stack frame. | 448 // Look up the code object to figure out the type of the stack frame. |
| 445 Code* code_obj = | 449 Code* code_obj = |
| 446 GetContainingCode(iterator->isolate(), *(state->pc_address)); | 450 GetContainingCode(iterator->isolate(), *(state->pc_address)); |
| 447 if (code_obj != nullptr) { | 451 if (code_obj != nullptr) { |
| 448 if (code_obj->is_interpreter_entry_trampoline() || | 452 if (code_obj->is_interpreter_trampoline_builtin()) { |
| 449 code_obj->is_interpreter_enter_bytecode_dispatch()) { | |
| 450 return INTERPRETED; | 453 return INTERPRETED; |
| 451 } | 454 } |
| 452 switch (code_obj->kind()) { | 455 switch (code_obj->kind()) { |
| 453 case Code::BUILTIN: | 456 case Code::BUILTIN: |
| 454 if (marker->IsSmi()) break; | 457 if (marker->IsSmi()) break; |
| 455 // We treat frames for BUILTIN Code objects as OptimizedFrame for now | 458 // We treat frames for BUILTIN Code objects as OptimizedFrame for now |
| 456 // (all the builtins with JavaScript linkage are actually generated | 459 // (all the builtins with JavaScript linkage are actually generated |
| 457 // with TurboFan currently, so this is sound). | 460 // with TurboFan currently, so this is sound). |
| 458 return OPTIMIZED; | 461 return OPTIMIZED; |
| 459 case Code::FUNCTION: | 462 case Code::FUNCTION: |
| (...skipping 1331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1791 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { | 1794 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { |
| 1792 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); | 1795 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); |
| 1793 list.Add(frame, zone); | 1796 list.Add(frame, zone); |
| 1794 } | 1797 } |
| 1795 return list.ToVector(); | 1798 return list.ToVector(); |
| 1796 } | 1799 } |
| 1797 | 1800 |
| 1798 | 1801 |
| 1799 } // namespace internal | 1802 } // namespace internal |
| 1800 } // namespace v8 | 1803 } // namespace v8 |
| OLD | NEW |