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

Side by Side Diff: src/frames.cc

Issue 10701054: Enable stub generation using Hydrogen/Lithium (again) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merge with latest Created 8 years 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 | « src/frames.h ('k') | src/frames-inl.h » ('j') | 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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 OptimizedFrame::Iterate(ObjectVisitor* v) const { 620 void CompiledFrame::Iterate(ObjectVisitor* v) const {
621 #ifdef DEBUG 621 #ifdef DEBUG
622 // Make sure that optimized frames do not contain any stack handlers. 622 // Make sure that optimized frames do not contain any stack handlers.
623 StackHandlerIterator it(this, top_handler()); 623 StackHandlerIterator it(this, top_handler());
624 ASSERT(it.done()); 624 ASSERT(it.done());
625 #endif 625 #endif
626 626
627 // Make sure that we're not doing "safe" stack frame iteration. We cannot 627 // Make sure that we're not doing "safe" stack frame iteration. We cannot
628 // possibly find pointers in optimized frames in that state. 628 // possibly find pointers in optimized frames in that state.
629 ASSERT(!SafeStackFrameIterator::is_active(isolate())); 629 ASSERT(!SafeStackFrameIterator::is_active(isolate()));
630 630
(...skipping 11 matching lines...) Expand all
642 642
643 // Visit the parameters that may be on top of the saved registers. 643 // Visit the parameters that may be on top of the saved registers.
644 if (safepoint_entry.argument_count() > 0) { 644 if (safepoint_entry.argument_count() > 0) {
645 v->VisitPointers(parameters_base, 645 v->VisitPointers(parameters_base,
646 parameters_base + safepoint_entry.argument_count()); 646 parameters_base + safepoint_entry.argument_count());
647 parameters_base += safepoint_entry.argument_count(); 647 parameters_base += safepoint_entry.argument_count();
648 } 648 }
649 649
650 // Skip saved double registers. 650 // Skip saved double registers.
651 if (safepoint_entry.has_doubles()) { 651 if (safepoint_entry.has_doubles()) {
652 parameters_base += DoubleRegister::kNumAllocatableRegisters * 652 parameters_base += DoubleRegister::NumAllocatableRegisters() *
653 kDoubleSize / kPointerSize; 653 kDoubleSize / kPointerSize;
654 } 654 }
655 655
656 // Visit the registers that contain pointers if any. 656 // Visit the registers that contain pointers if any.
657 if (safepoint_entry.HasRegisters()) { 657 if (safepoint_entry.HasRegisters()) {
658 for (int i = kNumSafepointRegisters - 1; i >=0; i--) { 658 for (int i = kNumSafepointRegisters - 1; i >=0; i--) {
659 if (safepoint_entry.HasRegisterAt(i)) { 659 if (safepoint_entry.HasRegisterAt(i)) {
660 int reg_stack_index = MacroAssembler::SafepointRegisterStackIndex(i); 660 int reg_stack_index = MacroAssembler::SafepointRegisterStackIndex(i);
661 v->VisitPointer(parameters_base + reg_stack_index); 661 v->VisitPointer(parameters_base + reg_stack_index);
662 } 662 }
(...skipping 11 matching lines...) Expand all
674 674
675 // Visit pointer spill slots and locals. 675 // Visit pointer spill slots and locals.
676 for (unsigned index = 0; index < stack_slots; index++) { 676 for (unsigned index = 0; index < stack_slots; index++) {
677 int byte_index = index >> kBitsPerByteLog2; 677 int byte_index = index >> kBitsPerByteLog2;
678 int bit_index = index & (kBitsPerByte - 1); 678 int bit_index = index & (kBitsPerByte - 1);
679 if ((safepoint_bits[byte_index] & (1U << bit_index)) != 0) { 679 if ((safepoint_bits[byte_index] & (1U << bit_index)) != 0) {
680 v->VisitPointer(parameters_limit + index); 680 v->VisitPointer(parameters_limit + index);
681 } 681 }
682 } 682 }
683 683
684 // Visit the return address in the callee and incoming arguments.
685 IteratePc(v, pc_address(), code);
686 }
687
688
689 void StubFrame::Iterate(ObjectVisitor* v) const {
690 CompiledFrame::Iterate(v);
691 }
692
693
694 void OptimizedFrame::Iterate(ObjectVisitor* v) const {
695 CompiledFrame::Iterate(v);
696
684 // Visit the context and the function. 697 // Visit the context and the function.
685 Object** fixed_base = &Memory::Object_at( 698 Object** fixed_base = &Memory::Object_at(
686 fp() + JavaScriptFrameConstants::kFunctionOffset); 699 fp() + JavaScriptFrameConstants::kFunctionOffset);
687 Object** fixed_limit = &Memory::Object_at(fp()); 700 Object** fixed_limit = &Memory::Object_at(fp());
688 v->VisitPointers(fixed_base, fixed_limit); 701 v->VisitPointers(fixed_base, fixed_limit);
689
690 // Visit the return address in the callee and incoming arguments.
691 IteratePc(v, pc_address(), code);
692 } 702 }
693 703
694 704
695 bool JavaScriptFrame::IsConstructor() const { 705 bool JavaScriptFrame::IsConstructor() const {
696 Address fp = caller_fp(); 706 Address fp = caller_fp();
697 if (has_adapted_arguments()) { 707 if (has_adapted_arguments()) {
698 // Skip the arguments adaptor frame and look at the real caller. 708 // Skip the arguments adaptor frame and look at the real caller.
699 fp = Memory::Address_at(fp + StandardFrameConstants::kCallerFPOffset); 709 fp = Memory::Address_at(fp + StandardFrameConstants::kCallerFPOffset);
700 } 710 }
701 return IsConstructFrame(fp); 711 return IsConstructFrame(fp);
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
1436 ZoneList<StackFrame*> list(10, zone); 1446 ZoneList<StackFrame*> list(10, zone);
1437 for (StackFrameIterator it; !it.done(); it.Advance()) { 1447 for (StackFrameIterator it; !it.done(); it.Advance()) {
1438 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); 1448 StackFrame* frame = AllocateFrameCopy(it.frame(), zone);
1439 list.Add(frame, zone); 1449 list.Add(frame, zone);
1440 } 1450 }
1441 return list.ToVector(); 1451 return list.ToVector();
1442 } 1452 }
1443 1453
1444 1454
1445 } } // namespace v8::internal 1455 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/frames.h ('k') | src/frames-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698