| 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 // The element must be on the physical stack, or the first | 189 // The element must be on the physical stack, or the first |
| 190 // element below the stack pointer (created by a single push). | 190 // element below the stack pointer (created by a single push). |
| 191 void VirtualFrame::RawSyncElementAt(int index) { | 191 void VirtualFrame::RawSyncElementAt(int index) { |
| 192 FrameElement element = elements_[index]; | 192 FrameElement element = elements_[index]; |
| 193 | 193 |
| 194 if (!element.is_synced()) { | 194 if (!element.is_synced()) { |
| 195 if (index <= stack_pointer_) { | 195 if (index <= stack_pointer_) { |
| 196 // Write elements below the stack pointer to their (already allocated) | 196 // Write elements below the stack pointer to their (already allocated) |
| 197 // actual frame location. | 197 // actual frame location. |
| 198 if (element.is_constant()) { | 198 if (element.is_constant()) { |
| 199 __ Set(Operand(ebp, fp_relative(index)), Immediate(element.handle())); | 199 __ mov(Operand(ebp, fp_relative(index)), Immediate(element.handle())); |
| 200 } else { | 200 } else { |
| 201 ASSERT(element.is_register()); | 201 ASSERT(element.is_register()); |
| 202 __ mov(Operand(ebp, fp_relative(index)), element.reg()); | 202 __ mov(Operand(ebp, fp_relative(index)), element.reg()); |
| 203 } | 203 } |
| 204 } else { | 204 } else { |
| 205 // Push elements above the stack pointer to allocate space and sync | 205 // Push elements above the stack pointer to allocate space and sync |
| 206 // them. Space should have already been allocated in the actual frame | 206 // them. Space should have already been allocated in the actual frame |
| 207 // for all the elements below this one. | 207 // for all the elements below this one. |
| 208 ASSERT(index == stack_pointer_ + 1); | 208 ASSERT(index == stack_pointer_ + 1); |
| 209 stack_pointer_++; | 209 stack_pointer_++; |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 } | 358 } |
| 359 } | 359 } |
| 360 | 360 |
| 361 // Perform the moves. | 361 // Perform the moves. |
| 362 for (int i = 0; i < elements_.length(); i++) { | 362 for (int i = 0; i < elements_.length(); i++) { |
| 363 FrameElement source = elements_[i]; | 363 FrameElement source = elements_[i]; |
| 364 FrameElement target = new_elements[i]; | 364 FrameElement target = new_elements[i]; |
| 365 ASSERT(!target.is_valid() || target.is_register() || target.is_memory()); | 365 ASSERT(!target.is_valid() || target.is_register() || target.is_memory()); |
| 366 if (target.is_register()) { | 366 if (target.is_register()) { |
| 367 if (source.is_constant()) { | 367 if (source.is_constant()) { |
| 368 __ Set(target.reg(), Immediate(source.handle())); | 368 __ mov(target.reg(), Immediate(source.handle())); |
| 369 } else if (source.is_register() && !source.reg().is(target.reg())) { | 369 } else if (source.is_register() && !source.reg().is(target.reg())) { |
| 370 __ mov(target.reg(), source.reg()); | 370 __ mov(target.reg(), source.reg()); |
| 371 } | 371 } |
| 372 elements_[i] = target; | 372 elements_[i] = target; |
| 373 } else if (target.is_memory()) { | 373 } else if (target.is_memory()) { |
| 374 if (!source.is_memory()) { | 374 if (!source.is_memory()) { |
| 375 // Spilling a source register would decrement its reference count, | 375 // Spilling a source register would decrement its reference count, |
| 376 // but we have already done that when computing new target elements, | 376 // but we have already done that when computing new target elements, |
| 377 // so we use a raw spill. | 377 // so we use a raw spill. |
| 378 RawSpillElementAt(i); | 378 RawSpillElementAt(i); |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 962 return false; | 962 return false; |
| 963 } | 963 } |
| 964 } | 964 } |
| 965 return true; | 965 return true; |
| 966 } | 966 } |
| 967 #endif | 967 #endif |
| 968 | 968 |
| 969 #undef __ | 969 #undef __ |
| 970 | 970 |
| 971 } } // namespace v8::internal | 971 } } // namespace v8::internal |
| OLD | NEW |