| 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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 stack_pointer_ = expected->stack_pointer_; | 417 stack_pointer_ = expected->stack_pointer_; |
| 418 } else if (stack_pointer_ < expected->stack_pointer_) { | 418 } else if (stack_pointer_ < expected->stack_pointer_) { |
| 419 // Put valid data on the stack, that will only be accessed by GC. | 419 // Put valid data on the stack, that will only be accessed by GC. |
| 420 while (stack_pointer_ < expected->stack_pointer_) { | 420 while (stack_pointer_ < expected->stack_pointer_) { |
| 421 __ push(Immediate(Smi::FromInt(0))); | 421 __ push(Immediate(Smi::FromInt(0))); |
| 422 stack_pointer_++; | 422 stack_pointer_++; |
| 423 } | 423 } |
| 424 } | 424 } |
| 425 | 425 |
| 426 // At this point, the frames should be identical. | 426 // At this point, the frames should be identical. |
| 427 // TODO(): Consider an "equals" method for frames. | 427 // TODO(208): Consider an "equals" method for frames. |
| 428 ASSERT(stack_pointer_ == expected->stack_pointer_); | 428 ASSERT(stack_pointer_ == expected->stack_pointer_); |
| 429 #ifdef DEBUG | 429 #ifdef DEBUG |
| 430 for (int i = 0; i < elements_.length(); i++) { | 430 for (int i = 0; i < elements_.length(); i++) { |
| 431 FrameElement expect = expected->elements_[i]; | 431 FrameElement expect = expected->elements_[i]; |
| 432 if (!expect.is_valid()) { | 432 if (!expect.is_valid()) { |
| 433 ASSERT(!elements_[i].is_valid()); | 433 ASSERT(!elements_[i].is_valid()); |
| 434 } else if (expect.is_memory()) { | 434 } else if (expect.is_memory()) { |
| 435 ASSERT(elements_[i].is_memory()); | 435 ASSERT(elements_[i].is_memory()); |
| 436 ASSERT(elements_[i].is_synced() && expect.is_synced()); | 436 ASSERT(elements_[i].is_synced() && expect.is_synced()); |
| 437 } else if (expect.is_register()) { | 437 } else if (expect.is_register()) { |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 FrameElement top = elements_[elements_.length() - 1]; | 812 FrameElement top = elements_[elements_.length() - 1]; |
| 813 | 813 |
| 814 if (elements_[index].is_register()) { | 814 if (elements_[index].is_register()) { |
| 815 Unuse(elements_[index].reg()); | 815 Unuse(elements_[index].reg()); |
| 816 } | 816 } |
| 817 // The virtual frame slot will be of the same type and have the same value | 817 // The virtual frame slot will be of the same type and have the same value |
| 818 // as the frame top. | 818 // as the frame top. |
| 819 elements_[index] = top; | 819 elements_[index] = top; |
| 820 | 820 |
| 821 if (top.is_memory()) { | 821 if (top.is_memory()) { |
| 822 // TODO(): consider allocating the slot to a register. | 822 // TODO(209): consider allocating the slot to a register. |
| 823 // | 823 // |
| 824 // Emit code to store memory values into the required frame slot. | 824 // Emit code to store memory values into the required frame slot. |
| 825 Result temp = cgen_->allocator()->Allocate(); | 825 Result temp = cgen_->allocator()->Allocate(); |
| 826 ASSERT(temp.is_valid()); | 826 ASSERT(temp.is_valid()); |
| 827 __ mov(temp.reg(), Top()); | 827 __ mov(temp.reg(), Top()); |
| 828 __ mov(Operand(ebp, fp_relative(index)), temp.reg()); | 828 __ mov(Operand(ebp, fp_relative(index)), temp.reg()); |
| 829 } else { | 829 } else { |
| 830 // We have not actually written the value to memory. | 830 // We have not actually written the value to memory. |
| 831 elements_[index].clear_sync(); | 831 elements_[index].clear_sync(); |
| 832 | 832 |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1057 return false; | 1057 return false; |
| 1058 } | 1058 } |
| 1059 } | 1059 } |
| 1060 return true; | 1060 return true; |
| 1061 } | 1061 } |
| 1062 #endif | 1062 #endif |
| 1063 | 1063 |
| 1064 #undef __ | 1064 #undef __ |
| 1065 | 1065 |
| 1066 } } // namespace v8::internal | 1066 } } // namespace v8::internal |
| OLD | NEW |