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

Side by Side Diff: src/jump-target.cc

Issue 113764: Add an elements_.length() accessor to the VirtualFrame class and use... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 7 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 | « src/ia32/virtual-frame-ia32.cc ('k') | src/virtual-frame.cc » ('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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 } 66 }
67 ASSERT(!all_identical || all_identical); 67 ASSERT(!all_identical || all_identical);
68 } 68 }
69 #endif 69 #endif
70 70
71 // Choose an initial frame. 71 // Choose an initial frame.
72 VirtualFrame* initial_frame = reaching_frames_[0]; 72 VirtualFrame* initial_frame = reaching_frames_[0];
73 73
74 // A list of pointers to frame elements in the entry frame. NULL 74 // A list of pointers to frame elements in the entry frame. NULL
75 // indicates that the element has not yet been determined. 75 // indicates that the element has not yet been determined.
76 int length = initial_frame->elements_.length(); 76 int length = initial_frame->element_count();
77 ZoneList<FrameElement*> elements(length); 77 ZoneList<FrameElement*> elements(length);
78 78
79 // Convert the number of mergable elements (counted from the top 79 // Convert the number of mergable elements (counted from the top
80 // down) to a frame high-water mark (counted from the bottom up). 80 // down) to a frame high-water mark (counted from the bottom up).
81 // Elements strictly above the high-water index will be mergable in 81 // Elements strictly above the high-water index will be mergable in
82 // entry frames for bidirectional jump targets. 82 // entry frames for bidirectional jump targets.
83 int high_water_mark = (mergable_elements == kAllElements) 83 int high_water_mark = (mergable_elements == kAllElements)
84 ? VirtualFrame::kIllegalIndex // All frame indices are above this. 84 ? VirtualFrame::kIllegalIndex // All frame indices are above this.
85 : length - mergable_elements - 1; // Top index if m_e == 0. 85 : length - mergable_elements - 1; // Top index if m_e == 0.
86 86
(...skipping 29 matching lines...) Expand all
116 } 116 }
117 elements[i] = element; 117 elements[i] = element;
118 } 118 }
119 } 119 }
120 120
121 // Build the new frame. A freshly allocated frame has memory elements 121 // Build the new frame. A freshly allocated frame has memory elements
122 // for the parameters and some platform-dependent elements (e.g., 122 // for the parameters and some platform-dependent elements (e.g.,
123 // return address). Replace those first. 123 // return address). Replace those first.
124 entry_frame_ = new VirtualFrame(); 124 entry_frame_ = new VirtualFrame();
125 int index = 0; 125 int index = 0;
126 for (; index < entry_frame_->elements_.length(); index++) { 126 for (; index < entry_frame_->element_count(); index++) {
127 FrameElement* target = elements[index]; 127 FrameElement* target = elements[index];
128 // If the element is determined, set it now. Count registers. Mark 128 // If the element is determined, set it now. Count registers. Mark
129 // elements as copied exactly when they have a copy. Undetermined 129 // elements as copied exactly when they have a copy. Undetermined
130 // elements are initially recorded as if in memory. 130 // elements are initially recorded as if in memory.
131 if (target != NULL) { 131 if (target != NULL) {
132 entry_frame_->elements_[index] = *target; 132 entry_frame_->elements_[index] = *target;
133 InitializeEntryElement(index, target); 133 InitializeEntryElement(index, target);
134 } 134 }
135 } 135 }
136 // Then fill in the rest of the frame with new elements. 136 // Then fill in the rest of the frame with new elements.
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 temp.CopyTo(this); 602 temp.CopyTo(this);
603 temp.Unuse(); 603 temp.Unuse();
604 604
605 #ifdef DEBUG 605 #ifdef DEBUG
606 is_shadowing_ = false; 606 is_shadowing_ = false;
607 #endif 607 #endif
608 } 608 }
609 609
610 610
611 } } // namespace v8::internal 611 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/virtual-frame-ia32.cc ('k') | src/virtual-frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698