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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 DECLARE_ARGCHECK_VARS(arg); | 283 DECLARE_ARGCHECK_VARS(arg); |
284 | 284 |
285 cgen()->frame()->Push(arg); | 285 cgen()->frame()->Push(arg); |
286 DoBranch(cc, hint); | 286 DoBranch(cc, hint); |
287 *arg = cgen()->frame()->Pop(); | 287 *arg = cgen()->frame()->Pop(); |
288 | 288 |
289 ASSERT_ARGCHECK(arg); | 289 ASSERT_ARGCHECK(arg); |
290 } | 290 } |
291 | 291 |
292 | 292 |
| 293 void JumpTarget::Branch(Condition cc, Result* arg0, Result* arg1, Hint hint) { |
| 294 ASSERT(cgen()->has_valid_frame()); |
| 295 |
| 296 // We want to check that non-frame registers at the call site stay in |
| 297 // the same registers on the fall-through branch. |
| 298 DECLARE_ARGCHECK_VARS(arg0); |
| 299 DECLARE_ARGCHECK_VARS(arg1); |
| 300 |
| 301 cgen()->frame()->Push(arg0); |
| 302 cgen()->frame()->Push(arg1); |
| 303 DoBranch(cc, hint); |
| 304 *arg1 = cgen()->frame()->Pop(); |
| 305 *arg0 = cgen()->frame()->Pop(); |
| 306 |
| 307 ASSERT_ARGCHECK(arg0); |
| 308 ASSERT_ARGCHECK(arg1); |
| 309 } |
| 310 |
| 311 |
293 void BreakTarget::Branch(Condition cc, Result* arg, Hint hint) { | 312 void BreakTarget::Branch(Condition cc, Result* arg, Hint hint) { |
294 ASSERT(cgen()->has_valid_frame()); | 313 ASSERT(cgen()->has_valid_frame()); |
295 | 314 |
296 int count = cgen()->frame()->height() - expected_height_; | 315 int count = cgen()->frame()->height() - expected_height_; |
297 if (count > 0) { | 316 if (count > 0) { |
298 // We negate and branch here rather than using DoBranch's negate | 317 // We negate and branch here rather than using DoBranch's negate |
299 // and branch. This gives us a hook to remove statement state | 318 // and branch. This gives us a hook to remove statement state |
300 // from the frame. | 319 // from the frame. |
301 JumpTarget fall_through; | 320 JumpTarget fall_through; |
302 // Branch to fall through will not negate, because it is a | 321 // Branch to fall through will not negate, because it is a |
(...skipping 21 matching lines...) Expand all Loading... |
324 | 343 |
325 void JumpTarget::Bind(Result* arg) { | 344 void JumpTarget::Bind(Result* arg) { |
326 if (cgen()->has_valid_frame()) { | 345 if (cgen()->has_valid_frame()) { |
327 cgen()->frame()->Push(arg); | 346 cgen()->frame()->Push(arg); |
328 } | 347 } |
329 DoBind(); | 348 DoBind(); |
330 *arg = cgen()->frame()->Pop(); | 349 *arg = cgen()->frame()->Pop(); |
331 } | 350 } |
332 | 351 |
333 | 352 |
| 353 void JumpTarget::Bind(Result* arg0, Result* arg1) { |
| 354 if (cgen()->has_valid_frame()) { |
| 355 cgen()->frame()->Push(arg0); |
| 356 cgen()->frame()->Push(arg1); |
| 357 } |
| 358 DoBind(); |
| 359 *arg1 = cgen()->frame()->Pop(); |
| 360 *arg0 = cgen()->frame()->Pop(); |
| 361 } |
| 362 |
| 363 |
334 void JumpTarget::AddReachingFrame(VirtualFrame* frame) { | 364 void JumpTarget::AddReachingFrame(VirtualFrame* frame) { |
335 ASSERT(reaching_frames_.length() == merge_labels_.length()); | 365 ASSERT(reaching_frames_.length() == merge_labels_.length()); |
336 ASSERT(entry_frame_ == NULL); | 366 ASSERT(entry_frame_ == NULL); |
337 Label fresh; | 367 Label fresh; |
338 merge_labels_.Add(fresh); | 368 merge_labels_.Add(fresh); |
339 reaching_frames_.Add(frame); | 369 reaching_frames_.Add(frame); |
340 } | 370 } |
341 | 371 |
342 | 372 |
343 // ------------------------------------------------------------------------- | 373 // ------------------------------------------------------------------------- |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 temp.CopyTo(this); | 444 temp.CopyTo(this); |
415 temp.Unuse(); | 445 temp.Unuse(); |
416 | 446 |
417 #ifdef DEBUG | 447 #ifdef DEBUG |
418 is_shadowing_ = false; | 448 is_shadowing_ = false; |
419 #endif | 449 #endif |
420 } | 450 } |
421 | 451 |
422 | 452 |
423 } } // namespace v8::internal | 453 } } // namespace v8::internal |
OLD | NEW |