| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 word |= pc[0] << 24; | 531 word |= pc[0] << 24; |
| 532 return word; | 532 return word; |
| 533 #endif | 533 #endif |
| 534 } | 534 } |
| 535 | 535 |
| 536 | 536 |
| 537 static inline void Store16(byte* pc, uint16_t value) { | 537 static inline void Store16(byte* pc, uint16_t value) { |
| 538 #ifdef CAN_READ_UNALIGNED | 538 #ifdef CAN_READ_UNALIGNED |
| 539 *reinterpret_cast<uint16_t*>(pc) = value; | 539 *reinterpret_cast<uint16_t*>(pc) = value; |
| 540 #else | 540 #else |
| 541 uint16_t word; | |
| 542 pc[1] = value; | 541 pc[1] = value; |
| 543 pc[0] = value >> 8; | 542 pc[0] = value >> 8; |
| 544 #endif | 543 #endif |
| 545 } | 544 } |
| 546 | 545 |
| 547 | 546 |
| 548 static inline void Store32(byte* pc, uint32_t value) { | 547 static inline void Store32(byte* pc, uint32_t value) { |
| 549 #ifdef CAN_READ_UNALIGNED | 548 #ifdef CAN_READ_UNALIGNED |
| 550 *reinterpret_cast<uint32_t*>(pc) = value; | 549 *reinterpret_cast<uint32_t*>(pc) = value; |
| 551 #else | 550 #else |
| 552 uint32_t word; | |
| 553 pc[3] = value; | 551 pc[3] = value; |
| 554 pc[2] = value >> 8; | 552 pc[2] = value >> 8; |
| 555 pc[1] = value >> 16; | 553 pc[1] = value >> 16; |
| 556 pc[0] = value >> 24; | 554 pc[0] = value >> 24; |
| 557 return word; | |
| 558 #endif | 555 #endif |
| 559 } | 556 } |
| 560 | 557 |
| 561 | 558 |
| 562 | 559 |
| 563 | 560 |
| 564 | 561 |
| 565 } } // namespace v8::internal | 562 } } // namespace v8::internal |
| 566 | 563 |
| 567 #endif // V8_UTILS_H_ | 564 #endif // V8_UTILS_H_ |
| OLD | NEW |