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 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 Result fresh = cgen_->allocator()->Allocate(); | 531 Result fresh = cgen_->allocator()->Allocate(); |
532 ASSERT(fresh.is_valid()); | 532 ASSERT(fresh.is_valid()); |
533 Use(fresh.reg(), new_backing_index); | 533 Use(fresh.reg(), new_backing_index); |
534 backing_reg = fresh.reg(); | 534 backing_reg = fresh.reg(); |
535 __ mov(backing_reg, Operand(ebp, fp_relative(index))); | 535 __ mov(backing_reg, Operand(ebp, fp_relative(index))); |
536 } else { | 536 } else { |
537 // The original was in a register. | 537 // The original was in a register. |
538 backing_reg = original.reg(); | 538 backing_reg = original.reg(); |
539 register_locations_[backing_reg.code()] = new_backing_index; | 539 register_locations_[backing_reg.code()] = new_backing_index; |
540 } | 540 } |
| 541 // Invalidate the element at index. |
| 542 elements_[index] = FrameElement::InvalidElement(); |
| 543 // Set the new backing element. |
541 if (elements_[new_backing_index].is_synced()) { | 544 if (elements_[new_backing_index].is_synced()) { |
542 elements_[new_backing_index] = | 545 elements_[new_backing_index] = |
543 FrameElement::RegisterElement(backing_reg, FrameElement::SYNCED); | 546 FrameElement::RegisterElement(backing_reg, FrameElement::SYNCED); |
544 } else { | 547 } else { |
545 elements_[new_backing_index] = | 548 elements_[new_backing_index] = |
546 FrameElement::RegisterElement(backing_reg, FrameElement::NOT_SYNCED); | 549 FrameElement::RegisterElement(backing_reg, FrameElement::NOT_SYNCED); |
547 } | 550 } |
548 // Update the other copies. | 551 // Update the other copies. |
549 for (int i = new_backing_index + 1; i < elements_.length(); i++) { | 552 for (int i = new_backing_index + 1; i < elements_.length(); i++) { |
550 if (elements_[i].is_copy() && elements_[i].index() == index) { | 553 if (elements_[i].is_copy() && elements_[i].index() == index) { |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
948 ASSERT(stack_pointer_ == elements_.length() - 1); | 951 ASSERT(stack_pointer_ == elements_.length() - 1); |
949 elements_.Add(FrameElement::MemoryElement()); | 952 elements_.Add(FrameElement::MemoryElement()); |
950 stack_pointer_++; | 953 stack_pointer_++; |
951 __ push(immediate); | 954 __ push(immediate); |
952 } | 955 } |
953 | 956 |
954 | 957 |
955 #undef __ | 958 #undef __ |
956 | 959 |
957 } } // namespace v8::internal | 960 } } // namespace v8::internal |
OLD | NEW |