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.h" | 9 #include "src/ast.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
432 Code* code_obj = GetContainingCode(iterator->isolate(), *(state->pc_address)); | 432 Code* code_obj = GetContainingCode(iterator->isolate(), *(state->pc_address)); |
433 | 433 |
434 Object* marker = | 434 Object* marker = |
435 Memory::Object_at(state->fp + StandardFrameConstants::kMarkerOffset); | 435 Memory::Object_at(state->fp + StandardFrameConstants::kMarkerOffset); |
436 if (code_obj != nullptr) { | 436 if (code_obj != nullptr) { |
437 switch (code_obj->kind()) { | 437 switch (code_obj->kind()) { |
438 case Code::FUNCTION: | 438 case Code::FUNCTION: |
439 return JAVA_SCRIPT; | 439 return JAVA_SCRIPT; |
440 case Code::OPTIMIZED_FUNCTION: | 440 case Code::OPTIMIZED_FUNCTION: |
441 return OPTIMIZED; | 441 return OPTIMIZED; |
442 case Code::BUILTIN: | |
titzer
2015/10/15 17:01:55
Are interpreter frames really only identifiable th
rmcilroy
2015/10/15 19:47:47
The marker is not a SMI (it's a tagged JSFunction
| |
443 if (!marker->IsSmi()) { | |
444 if (StandardFrame::IsArgumentsAdaptorFrame(state->fp)) { | |
445 // An adapter frame has a special SMI constant for the context and | |
446 // is not distinguished through the marker. | |
447 return ARGUMENTS_ADAPTOR; | |
448 } else { | |
449 // The interpreter entry trampoline has a non-SMI marker. | |
450 DCHECK(code_obj->is_interpreter_entry_trampoline()); | |
451 return INTERPRETED; | |
452 } | |
453 } | |
454 break; // Marker encodes the frame type. | |
442 case Code::HANDLER: | 455 case Code::HANDLER: |
443 if (!marker->IsSmi()) { | 456 if (!marker->IsSmi()) { |
444 // Only hydrogen code stub handlers can have a non-SMI marker. | 457 // Only hydrogen code stub handlers can have a non-SMI marker. |
445 DCHECK(code_obj->is_hydrogen_stub()); | 458 DCHECK(code_obj->is_hydrogen_stub()); |
446 return OPTIMIZED; | 459 return OPTIMIZED; |
447 } | 460 } |
448 break; // Marker encodes the frame type. | 461 break; // Marker encodes the frame type. |
449 default: | 462 default: |
450 break; // Marker encodes the frame type. | 463 break; // Marker encodes the frame type. |
451 } | 464 } |
452 } | 465 } |
453 | 466 |
454 if (StandardFrame::IsArgumentsAdaptorFrame(state->fp)) { | |
455 // An adapter frame has a special SMI constant for the context and | |
456 // is not distinguished through the marker. | |
457 return ARGUMENTS_ADAPTOR; | |
458 } | |
459 | |
460 // Didn't find a code object, or the code kind wasn't specific enough. | 467 // Didn't find a code object, or the code kind wasn't specific enough. |
461 // The marker should encode the frame type. | 468 // The marker should encode the frame type. |
462 return static_cast<StackFrame::Type>(Smi::cast(marker)->value()); | 469 return static_cast<StackFrame::Type>(Smi::cast(marker)->value()); |
463 } | 470 } |
464 | 471 |
465 | 472 |
466 #ifdef DEBUG | 473 #ifdef DEBUG |
467 bool StackFrame::can_access_heap_objects() const { | 474 bool StackFrame::can_access_heap_objects() const { |
468 return iterator_->can_access_heap_objects_; | 475 return iterator_->can_access_heap_objects_; |
469 } | 476 } |
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1585 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { | 1592 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { |
1586 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); | 1593 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); |
1587 list.Add(frame, zone); | 1594 list.Add(frame, zone); |
1588 } | 1595 } |
1589 return list.ToVector(); | 1596 return list.ToVector(); |
1590 } | 1597 } |
1591 | 1598 |
1592 | 1599 |
1593 } // namespace internal | 1600 } // namespace internal |
1594 } // namespace v8 | 1601 } // namespace v8 |
OLD | NEW |