| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 | 610 |
| 611 bool StandardFrame::IsExpressionInsideHandler(int n) const { | 611 bool StandardFrame::IsExpressionInsideHandler(int n) const { |
| 612 Address address = GetExpressionAddress(n); | 612 Address address = GetExpressionAddress(n); |
| 613 for (StackHandlerIterator it(this, top_handler()); !it.done(); it.Advance()) { | 613 for (StackHandlerIterator it(this, top_handler()); !it.done(); it.Advance()) { |
| 614 if (it.handler()->includes(address)) return true; | 614 if (it.handler()->includes(address)) return true; |
| 615 } | 615 } |
| 616 return false; | 616 return false; |
| 617 } | 617 } |
| 618 | 618 |
| 619 | 619 |
| 620 void CompiledFrame::Iterate(ObjectVisitor* v) const { | 620 void StandardFrame::IterateCompiledFrame(ObjectVisitor* v) const { |
| 621 #ifdef DEBUG | |
| 622 // Make sure that optimized frames do not contain any stack handlers. | |
| 623 StackHandlerIterator it(this, top_handler()); | |
| 624 ASSERT(it.done()); | |
| 625 #endif | |
| 626 | |
| 627 // Make sure that we're not doing "safe" stack frame iteration. We cannot | 621 // Make sure that we're not doing "safe" stack frame iteration. We cannot |
| 628 // possibly find pointers in optimized frames in that state. | 622 // possibly find pointers in optimized frames in that state. |
| 629 ASSERT(!SafeStackFrameIterator::is_active(isolate())); | 623 ASSERT(!SafeStackFrameIterator::is_active(isolate())); |
| 630 | 624 |
| 631 // Compute the safepoint information. | 625 // Compute the safepoint information. |
| 632 unsigned stack_slots = 0; | 626 unsigned stack_slots = 0; |
| 633 SafepointEntry safepoint_entry; | 627 SafepointEntry safepoint_entry; |
| 634 Code* code = StackFrame::GetSafepointData( | 628 Code* code = StackFrame::GetSafepointData( |
| 635 isolate(), pc(), &safepoint_entry, &stack_slots); | 629 isolate(), pc(), &safepoint_entry, &stack_slots); |
| 636 unsigned slot_space = stack_slots * kPointerSize; | 630 unsigned slot_space = stack_slots * kPointerSize; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 v->VisitPointer(parameters_limit + index); | 674 v->VisitPointer(parameters_limit + index); |
| 681 } | 675 } |
| 682 } | 676 } |
| 683 | 677 |
| 684 // Visit the return address in the callee and incoming arguments. | 678 // Visit the return address in the callee and incoming arguments. |
| 685 IteratePc(v, pc_address(), code); | 679 IteratePc(v, pc_address(), code); |
| 686 } | 680 } |
| 687 | 681 |
| 688 | 682 |
| 689 void StubFrame::Iterate(ObjectVisitor* v) const { | 683 void StubFrame::Iterate(ObjectVisitor* v) const { |
| 690 CompiledFrame::Iterate(v); | 684 IterateCompiledFrame(v); |
| 685 } |
| 686 |
| 687 |
| 688 Code* StubFrame::unchecked_code() const { |
| 689 return static_cast<Code*>(isolate()->heap()->FindCodeObject(pc())); |
| 690 } |
| 691 |
| 692 |
| 693 Address StubFrame::GetCallerStackPointer() const { |
| 694 return fp() + ExitFrameConstants::kCallerSPDisplacement; |
| 695 } |
| 696 |
| 697 |
| 698 int StubFrame::GetNumberOfIncomingArguments() const { |
| 699 return 0; |
| 691 } | 700 } |
| 692 | 701 |
| 693 | 702 |
| 694 void OptimizedFrame::Iterate(ObjectVisitor* v) const { | 703 void OptimizedFrame::Iterate(ObjectVisitor* v) const { |
| 695 CompiledFrame::Iterate(v); | 704 #ifdef DEBUG |
| 705 // Make sure that optimized frames do not contain any stack handlers. |
| 706 StackHandlerIterator it(this, top_handler()); |
| 707 ASSERT(it.done()); |
| 708 #endif |
| 709 |
| 710 IterateCompiledFrame(v); |
| 696 | 711 |
| 697 // Visit the context and the function. | 712 // Visit the context and the function. |
| 698 Object** fixed_base = &Memory::Object_at( | 713 Object** fixed_base = &Memory::Object_at( |
| 699 fp() + JavaScriptFrameConstants::kFunctionOffset); | 714 fp() + JavaScriptFrameConstants::kFunctionOffset); |
| 700 Object** fixed_limit = &Memory::Object_at(fp()); | 715 Object** fixed_limit = &Memory::Object_at(fp()); |
| 701 v->VisitPointers(fixed_base, fixed_limit); | 716 v->VisitPointers(fixed_base, fixed_limit); |
| 702 } | 717 } |
| 703 | 718 |
| 704 | 719 |
| 705 void JavaScriptFrame::SetParameterValue(int index, Object* value) const { | 720 void JavaScriptFrame::SetParameterValue(int index, Object* value) const { |
| (...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1451 ZoneList<StackFrame*> list(10, zone); | 1466 ZoneList<StackFrame*> list(10, zone); |
| 1452 for (StackFrameIterator it; !it.done(); it.Advance()) { | 1467 for (StackFrameIterator it; !it.done(); it.Advance()) { |
| 1453 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); | 1468 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); |
| 1454 list.Add(frame, zone); | 1469 list.Add(frame, zone); |
| 1455 } | 1470 } |
| 1456 return list.ToVector(); | 1471 return list.ToVector(); |
| 1457 } | 1472 } |
| 1458 | 1473 |
| 1459 | 1474 |
| 1460 } } // namespace v8::internal | 1475 } } // namespace v8::internal |
| OLD | NEW |