OLD | NEW |
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 // it explicitly here. The only merging necessary is to drop extra | 166 // it explicitly here. The only merging necessary is to drop extra |
167 // statement state from the stack. | 167 // statement state from the stack. |
168 ASSERT(cgen()->has_valid_frame()); | 168 ASSERT(cgen()->has_valid_frame()); |
169 int count = cgen()->frame()->height() - expected_height_; | 169 int count = cgen()->frame()->height() - expected_height_; |
170 cgen()->frame()->Drop(count); | 170 cgen()->frame()->Drop(count); |
171 DoJump(); | 171 DoJump(); |
172 } | 172 } |
173 | 173 |
174 | 174 |
175 void BreakTarget::Jump(Result* arg) { | 175 void BreakTarget::Jump(Result* arg) { |
176 // On ARM we do not currently emit merge code for jumps, so we need to do | 176 UNIMPLEMENTED(); |
177 // it explicitly here. The only merging necessary is to drop extra | |
178 // statement state from the stack. | |
179 ASSERT(cgen()->has_valid_frame()); | |
180 int count = cgen()->frame()->height() - expected_height_; | |
181 cgen()->frame()->Drop(count); | |
182 cgen()->frame()->Push(arg); | |
183 DoJump(); | |
184 } | 177 } |
185 | 178 |
186 | 179 |
187 void BreakTarget::Bind() { | 180 void BreakTarget::Bind() { |
188 #ifdef DEBUG | 181 #ifdef DEBUG |
189 // All the forward-reaching frames should have been adjusted at the | 182 // All the forward-reaching frames should have been adjusted at the |
190 // jumps to this target. | 183 // jumps to this target. |
191 for (int i = 0; i < reaching_frames_.length(); i++) { | 184 for (int i = 0; i < reaching_frames_.length(); i++) { |
192 ASSERT(reaching_frames_[i] == NULL || | 185 ASSERT(reaching_frames_[i] == NULL || |
193 reaching_frames_[i]->height() == expected_height_); | 186 reaching_frames_[i]->height() == expected_height_); |
194 } | 187 } |
195 #endif | 188 #endif |
196 // Drop leftover statement state from the frame before merging, even | 189 // Drop leftover statement state from the frame before merging, even |
197 // on the fall through. This is so we can bind the return target | 190 // on the fall through. This is so we can bind the return target |
198 // with state on the frame. | 191 // with state on the frame. |
199 if (cgen()->has_valid_frame()) { | 192 if (cgen()->has_valid_frame()) { |
200 int count = cgen()->frame()->height() - expected_height_; | 193 int count = cgen()->frame()->height() - expected_height_; |
201 // On ARM we do not currently emit merge code at binding sites, so we need | 194 // On ARM we do not currently emit merge code at binding sites, so we need |
202 // to do it explicitly here. The only merging necessary is to drop extra | 195 // to do it explicitly here. The only merging necessary is to drop extra |
203 // statement state from the stack. | 196 // statement state from the stack. |
204 cgen()->frame()->Drop(count); | 197 cgen()->frame()->Drop(count); |
205 } | 198 } |
206 | 199 |
207 DoBind(); | 200 DoBind(); |
208 } | 201 } |
209 | 202 |
210 | 203 |
211 void BreakTarget::Bind(Result* arg) { | 204 void BreakTarget::Bind(Result* arg) { |
212 #ifdef DEBUG | 205 UNREACHABLE(); |
213 // All the forward-reaching frames should have been adjusted at the | |
214 // jumps to this target. | |
215 for (int i = 0; i < reaching_frames_.length(); i++) { | |
216 ASSERT(reaching_frames_[i] == NULL || | |
217 reaching_frames_[i]->height() == expected_height_ + 1); | |
218 } | |
219 #endif | |
220 // Drop leftover statement state from the frame before merging, even | |
221 // on the fall through. This is so we can bind the return target | |
222 // with state on the frame. | |
223 if (cgen()->has_valid_frame()) { | |
224 int count = cgen()->frame()->height() - expected_height_; | |
225 // On ARM we do not currently emit merge code at binding sites, so we need | |
226 // to do it explicitly here. The only merging necessary is to drop extra | |
227 // statement state from the stack. | |
228 cgen()->frame()->ForgetElements(count); | |
229 cgen()->frame()->Push(arg); | |
230 } | |
231 DoBind(); | |
232 *arg = cgen()->frame()->Pop(); | |
233 } | 206 } |
234 | 207 |
235 | 208 |
236 #undef __ | 209 #undef __ |
237 | 210 |
238 | 211 |
239 } } // namespace v8::internal | 212 } } // namespace v8::internal |
OLD | NEW |