| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 3075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3086 // Swap elements. Use object and temp as scratch registers. | 3086 // Swap elements. Use object and temp as scratch registers. |
| 3087 __ mov(object, Operand(index_1, 0)); | 3087 __ mov(object, Operand(index_1, 0)); |
| 3088 __ mov(temp, Operand(index_2, 0)); | 3088 __ mov(temp, Operand(index_2, 0)); |
| 3089 __ mov(Operand(index_2, 0), object); | 3089 __ mov(Operand(index_2, 0), object); |
| 3090 __ mov(Operand(index_1, 0), temp); | 3090 __ mov(Operand(index_1, 0), temp); |
| 3091 | 3091 |
| 3092 Label new_space; | 3092 Label new_space; |
| 3093 __ InNewSpace(elements, temp, equal, &new_space); | 3093 __ InNewSpace(elements, temp, equal, &new_space); |
| 3094 | 3094 |
| 3095 __ mov(object, elements); | 3095 __ mov(object, elements); |
| 3096 __ RecordWriteHelper(object, index_1, temp, kDontSaveFPRegs); | 3096 // Since we are swapping two objects, the incremental marker is not disturbed, |
| 3097 __ RecordWriteHelper(elements, index_2, temp, kDontSaveFPRegs); | 3097 // so we don't call the stub that handles this. TODO(gc): Optimize by |
| 3098 // checking the scan_on_scavenge flag, probably by calling the stub. |
| 3099 __ RememberedSetHelper(object, index_1, temp, kDontSaveFPRegs); |
| 3100 __ RememberedSetHelper(elements, index_2, temp, kDontSaveFPRegs); |
| 3098 | 3101 |
| 3099 __ bind(&new_space); | 3102 __ bind(&new_space); |
| 3100 | 3103 |
| 3101 // We are done. Drop elements from the stack, and return undefined. | 3104 // We are done. Drop elements from the stack, and return undefined. |
| 3102 __ add(Operand(esp), Immediate(3 * kPointerSize)); | 3105 __ add(Operand(esp), Immediate(3 * kPointerSize)); |
| 3103 __ mov(eax, Factory::undefined_value()); | 3106 __ mov(eax, Factory::undefined_value()); |
| 3104 __ jmp(&done); | 3107 __ jmp(&done); |
| 3105 | 3108 |
| 3106 __ bind(&slow_case); | 3109 __ bind(&slow_case); |
| 3107 __ CallRuntime(Runtime::kSwapElements, 3); | 3110 __ CallRuntime(Runtime::kSwapElements, 3); |
| (...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4263 // And return. | 4266 // And return. |
| 4264 __ ret(0); | 4267 __ ret(0); |
| 4265 } | 4268 } |
| 4266 | 4269 |
| 4267 | 4270 |
| 4268 #undef __ | 4271 #undef __ |
| 4269 | 4272 |
| 4270 } } // namespace v8::internal | 4273 } } // namespace v8::internal |
| 4271 | 4274 |
| 4272 #endif // V8_TARGET_ARCH_IA32 | 4275 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |