Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(939)

Side by Side Diff: regexp2000/src/utils.h

Issue 11599: * Fixed bug in unaligned writing (Store16, Store32) on ARM. (Closed)
Patch Set: Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698