| 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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 | 308 |
| 309 void VirtualFrame::MergeMoveRegistersToRegisters(VirtualFrame* expected) { | 309 void VirtualFrame::MergeMoveRegistersToRegisters(VirtualFrame* expected) { |
| 310 // We have already done X-to-memory moves. | 310 // We have already done X-to-memory moves. |
| 311 ASSERT(stack_pointer_ >= expected->stack_pointer_); | 311 ASSERT(stack_pointer_ >= expected->stack_pointer_); |
| 312 | 312 |
| 313 for (int i = 0; i < kNumRegisters; i++) { | 313 for (int i = 0; i < kNumRegisters; i++) { |
| 314 // Move the right value into register i if it is currently in a register. | 314 // Move the right value into register i if it is currently in a register. |
| 315 int index = expected->register_locations_[i]; | 315 int index = expected->register_locations_[i]; |
| 316 int use_index = register_locations_[i]; | 316 int use_index = register_locations_[i]; |
| 317 // Fast check if register is unused in target or already correct | 317 // Fast check if register is unused in target or already correct |
| 318 if (index != kIllegalIndex | 318 if (index != kIllegalIndex |
| 319 && index != use_index | 319 && index != use_index |
| 320 && elements_[index].is_register()) { | 320 && elements_[index].is_register()) { |
| 321 Register source = elements_[index].reg(); | 321 Register source = elements_[index].reg(); |
| 322 Register target = { i }; | 322 Register target = { i }; |
| 323 if (use_index == kIllegalIndex) { // Target is currently unused. | 323 if (use_index == kIllegalIndex) { // Target is currently unused. |
| 324 // Copy contents of source from source to target. | 324 // Copy contents of source from source to target. |
| 325 // Set frame element register to target. | 325 // Set frame element register to target. |
| 326 elements_[index].set_reg(target); | 326 elements_[index].set_reg(target); |
| 327 Use(target, index); | 327 Use(target, index); |
| 328 Unuse(source); | 328 Unuse(source); |
| (...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1039 ASSERT(stack_pointer_ == elements_.length() - 1); | 1039 ASSERT(stack_pointer_ == elements_.length() - 1); |
| 1040 elements_.Add(FrameElement::MemoryElement()); | 1040 elements_.Add(FrameElement::MemoryElement()); |
| 1041 stack_pointer_++; | 1041 stack_pointer_++; |
| 1042 __ push(immediate); | 1042 __ push(immediate); |
| 1043 } | 1043 } |
| 1044 | 1044 |
| 1045 | 1045 |
| 1046 #undef __ | 1046 #undef __ |
| 1047 | 1047 |
| 1048 } } // namespace v8::internal | 1048 } } // namespace v8::internal |
| OLD | NEW |