| 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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 && value->is_register() | 368 && value->is_register() |
| 369 && original.reg().is(value->reg()); | 369 && original.reg().is(value->reg()); |
| 370 bool same_constant = original.is_constant() | 370 bool same_constant = original.is_constant() |
| 371 && value->is_constant() | 371 && value->is_constant() |
| 372 && original.handle().is_identical_to(value->handle()); | 372 && original.handle().is_identical_to(value->handle()); |
| 373 if (same_register || same_constant) { | 373 if (same_register || same_constant) { |
| 374 value->Unuse(); | 374 value->Unuse(); |
| 375 return; | 375 return; |
| 376 } | 376 } |
| 377 | 377 |
| 378 // If the original may be a copy, adjust to preserve the copy-on-write | 378 InvalidateFrameSlotAt(frame_index); |
| 379 // semantics of copied elements. | |
| 380 if (original.is_copied() && | |
| 381 (original.is_register() || original.is_memory())) { | |
| 382 FrameElement ignored = AdjustCopies(frame_index); | |
| 383 } | |
| 384 | |
| 385 // If the original is a register reference, deallocate it. | |
| 386 if (original.is_register()) { | |
| 387 Unuse(original.reg()); | |
| 388 } | |
| 389 | 379 |
| 390 FrameElement new_element; | 380 FrameElement new_element; |
| 391 if (value->is_register()) { | 381 if (value->is_register()) { |
| 392 // There are two cases depending no whether the register already | 382 // There are two cases depending no whether the register already |
| 393 // occurs in the frame or not. | 383 // occurs in the frame or not. |
| 394 if (register_count(value->reg()) == 0) { | 384 if (register_count(value->reg()) == 0) { |
| 395 Use(value->reg()); | 385 Use(value->reg()); |
| 396 elements_[frame_index] = | 386 elements_[frame_index] = |
| 397 FrameElement::RegisterElement(value->reg(), | 387 FrameElement::RegisterElement(value->reg(), |
| 398 FrameElement::NOT_SYNCED); | 388 FrameElement::NOT_SYNCED); |
| 399 } else { | 389 } else { |
| 400 for (int i = 0; i < elements_.length(); i++) { | 390 for (int i = 0; i < elements_.length(); i++) { |
| 401 FrameElement element = elements_[i]; | 391 FrameElement element = elements_[i]; |
| 402 if (element.is_register() && element.reg().is(value->reg())) { | 392 if (element.is_register() && element.reg().is(value->reg())) { |
| 403 // The register backing store is lower in the frame than its | |
| 404 // copy. | |
| 405 if (i < frame_index) { | 393 if (i < frame_index) { |
| 394 // The register backing store is lower in the frame than its |
| 395 // copy. |
| 406 elements_[frame_index] = CopyElementAt(i); | 396 elements_[frame_index] = CopyElementAt(i); |
| 407 } else { | 397 } else { |
| 408 // There was an early bailout for the case of setting a | 398 // There was an early bailout for the case of setting a |
| 409 // register element to itself. | 399 // register element to itself. |
| 410 ASSERT(i != frame_index); | 400 ASSERT(i != frame_index); |
| 411 element.clear_sync(); | 401 element.clear_sync(); |
| 412 elements_[frame_index] = element; | 402 elements_[frame_index] = element; |
| 413 elements_[i] = CopyElementAt(frame_index); | 403 elements_[i] = CopyElementAt(frame_index); |
| 414 } | 404 } |
| 415 // Exit the loop once the appropriate copy is inserted. | 405 // Exit the loop once the appropriate copy is inserted. |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 #endif | 557 #endif |
| 568 if (stack_pointer_ != other->stack_pointer_) return false; | 558 if (stack_pointer_ != other->stack_pointer_) return false; |
| 569 for (int i = 0; i < elements_.length(); i++) { | 559 for (int i = 0; i < elements_.length(); i++) { |
| 570 if (!elements_[i].Equals(other->elements_[i])) return false; | 560 if (!elements_[i].Equals(other->elements_[i])) return false; |
| 571 } | 561 } |
| 572 | 562 |
| 573 return true; | 563 return true; |
| 574 } | 564 } |
| 575 | 565 |
| 576 } } // namespace v8::internal | 566 } } // namespace v8::internal |
| OLD | NEW |