Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(632)

Side by Side Diff: src/frames.cc

Issue 12314124: Visit stored context when iterating stack for optimized stub. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 for (unsigned index = 0; index < stack_slots; index++) { 659 for (unsigned index = 0; index < stack_slots; index++) {
660 int byte_index = index >> kBitsPerByteLog2; 660 int byte_index = index >> kBitsPerByteLog2;
661 int bit_index = index & (kBitsPerByte - 1); 661 int bit_index = index & (kBitsPerByte - 1);
662 if ((safepoint_bits[byte_index] & (1U << bit_index)) != 0) { 662 if ((safepoint_bits[byte_index] & (1U << bit_index)) != 0) {
663 v->VisitPointer(parameters_limit + index); 663 v->VisitPointer(parameters_limit + index);
664 } 664 }
665 } 665 }
666 666
667 // Visit the return address in the callee and incoming arguments. 667 // Visit the return address in the callee and incoming arguments.
668 IteratePc(v, pc_address(), code); 668 IteratePc(v, pc_address(), code);
669
670 // Visit the context in stub frame and JavaScript frame.
671 // Visit the function in JavaScript frame.
672 Object** fixed_base = &Memory::Object_at(
673 fp() + StandardFrameConstants::kMarkerOffset);
674 Object** fixed_limit = &Memory::Object_at(fp());
675 v->VisitPointers(fixed_base, fixed_limit);
669 } 676 }
670 677
671 678
672 void StubFrame::Iterate(ObjectVisitor* v) const { 679 void StubFrame::Iterate(ObjectVisitor* v) const {
673 IterateCompiledFrame(v); 680 IterateCompiledFrame(v);
674 } 681 }
675 682
676 683
677 Code* StubFrame::unchecked_code() const { 684 Code* StubFrame::unchecked_code() const {
678 return static_cast<Code*>(isolate()->heap()->FindCodeObject(pc())); 685 return static_cast<Code*>(isolate()->heap()->FindCodeObject(pc()));
(...skipping 11 matching lines...) Expand all
690 697
691 698
692 void OptimizedFrame::Iterate(ObjectVisitor* v) const { 699 void OptimizedFrame::Iterate(ObjectVisitor* v) const {
693 #ifdef DEBUG 700 #ifdef DEBUG
694 // Make sure that optimized frames do not contain any stack handlers. 701 // Make sure that optimized frames do not contain any stack handlers.
695 StackHandlerIterator it(this, top_handler()); 702 StackHandlerIterator it(this, top_handler());
696 ASSERT(it.done()); 703 ASSERT(it.done());
697 #endif 704 #endif
698 705
699 IterateCompiledFrame(v); 706 IterateCompiledFrame(v);
700
701 // Visit the context and the function.
702 Object** fixed_base = &Memory::Object_at(
703 fp() + JavaScriptFrameConstants::kFunctionOffset);
704 Object** fixed_limit = &Memory::Object_at(fp());
705 v->VisitPointers(fixed_base, fixed_limit);
706 } 707 }
707 708
708 709
709 void JavaScriptFrame::SetParameterValue(int index, Object* value) const { 710 void JavaScriptFrame::SetParameterValue(int index, Object* value) const {
710 Memory::Object_at(GetParameterSlot(index)) = value; 711 Memory::Object_at(GetParameterSlot(index)) = value;
711 } 712 }
712 713
713 714
714 bool JavaScriptFrame::IsConstructor() const { 715 bool JavaScriptFrame::IsConstructor() const {
715 Address fp = caller_fp(); 716 Address fp = caller_fp();
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after
1492 ZoneList<StackFrame*> list(10, zone); 1493 ZoneList<StackFrame*> list(10, zone);
1493 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { 1494 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) {
1494 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); 1495 StackFrame* frame = AllocateFrameCopy(it.frame(), zone);
1495 list.Add(frame, zone); 1496 list.Add(frame, zone);
1496 } 1497 }
1497 return list.ToVector(); 1498 return list.ToVector();
1498 } 1499 }
1499 1500
1500 1501
1501 } } // namespace v8::internal 1502 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698