OLD | NEW |
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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 DECLARE_ARGCHECK_VARS(arg); | 261 DECLARE_ARGCHECK_VARS(arg); |
262 | 262 |
263 cgen()->frame()->Push(arg); | 263 cgen()->frame()->Push(arg); |
264 DoBranch(cc, hint); | 264 DoBranch(cc, hint); |
265 *arg = cgen()->frame()->Pop(); | 265 *arg = cgen()->frame()->Pop(); |
266 | 266 |
267 ASSERT_ARGCHECK(arg); | 267 ASSERT_ARGCHECK(arg); |
268 } | 268 } |
269 | 269 |
270 | 270 |
271 void JumpTarget::Branch(Condition cc, Result* arg0, Result* arg1, Hint hint) { | |
272 ASSERT(cgen()->frame() != NULL); | |
273 | |
274 // We want to check that non-frame registers at the call site stay in | |
275 // the same registers on the fall-through branch. | |
276 DECLARE_ARGCHECK_VARS(arg0); | |
277 DECLARE_ARGCHECK_VARS(arg1); | |
278 | |
279 cgen()->frame()->Push(arg0); | |
280 cgen()->frame()->Push(arg1); | |
281 DoBranch(cc, hint); | |
282 *arg1 = cgen()->frame()->Pop(); | |
283 *arg0 = cgen()->frame()->Pop(); | |
284 | |
285 ASSERT_ARGCHECK(arg0); | |
286 ASSERT_ARGCHECK(arg1); | |
287 } | |
288 | |
289 | |
290 void BreakTarget::Branch(Condition cc, Result* arg, Hint hint) { | 271 void BreakTarget::Branch(Condition cc, Result* arg, Hint hint) { |
291 ASSERT(cgen()->has_valid_frame()); | 272 ASSERT(cgen()->has_valid_frame()); |
292 | 273 |
293 int count = cgen()->frame()->height() - expected_height_; | 274 int count = cgen()->frame()->height() - expected_height_; |
294 if (count > 0) { | 275 if (count > 0) { |
295 // We negate and branch here rather than using DoBranch's negate | 276 // We negate and branch here rather than using DoBranch's negate |
296 // and branch. This gives us a hook to remove statement state | 277 // and branch. This gives us a hook to remove statement state |
297 // from the frame. | 278 // from the frame. |
298 JumpTarget fall_through; | 279 JumpTarget fall_through; |
299 // Branch to fall through will not negate, because it is a | 280 // Branch to fall through will not negate, because it is a |
(...skipping 21 matching lines...) Expand all Loading... |
321 | 302 |
322 void JumpTarget::Bind(Result* arg) { | 303 void JumpTarget::Bind(Result* arg) { |
323 if (cgen()->has_valid_frame()) { | 304 if (cgen()->has_valid_frame()) { |
324 cgen()->frame()->Push(arg); | 305 cgen()->frame()->Push(arg); |
325 } | 306 } |
326 DoBind(); | 307 DoBind(); |
327 *arg = cgen()->frame()->Pop(); | 308 *arg = cgen()->frame()->Pop(); |
328 } | 309 } |
329 | 310 |
330 | 311 |
331 void JumpTarget::Bind(Result* arg0, Result* arg1) { | |
332 if (cgen()->has_valid_frame()) { | |
333 cgen()->frame()->Push(arg0); | |
334 cgen()->frame()->Push(arg1); | |
335 } | |
336 DoBind(); | |
337 *arg1 = cgen()->frame()->Pop(); | |
338 *arg0 = cgen()->frame()->Pop(); | |
339 } | |
340 | |
341 | |
342 void JumpTarget::AddReachingFrame(VirtualFrame* frame) { | 312 void JumpTarget::AddReachingFrame(VirtualFrame* frame) { |
343 ASSERT(reaching_frames_.length() == merge_labels_.length()); | 313 ASSERT(reaching_frames_.length() == merge_labels_.length()); |
344 ASSERT(entry_frame_ == NULL); | 314 ASSERT(entry_frame_ == NULL); |
345 Label fresh; | 315 Label fresh; |
346 merge_labels_.Add(fresh); | 316 merge_labels_.Add(fresh); |
347 reaching_frames_.Add(frame); | 317 reaching_frames_.Add(frame); |
348 } | 318 } |
349 | 319 |
350 | 320 |
351 // ------------------------------------------------------------------------- | 321 // ------------------------------------------------------------------------- |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 temp.CopyTo(this); | 453 temp.CopyTo(this); |
484 temp.Unuse(); | 454 temp.Unuse(); |
485 | 455 |
486 #ifdef DEBUG | 456 #ifdef DEBUG |
487 is_shadowing_ = false; | 457 is_shadowing_ = false; |
488 #endif | 458 #endif |
489 } | 459 } |
490 | 460 |
491 | 461 |
492 } } // namespace v8::internal | 462 } } // namespace v8::internal |
OLD | NEW |