OLD | NEW |
---|---|
1 // Copyright 2008-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2008-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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
55 void RegExpMacroAssemblerIrregexp::Emit16(uint32_t word) { | 55 void RegExpMacroAssemblerIrregexp::Emit16(uint32_t word) { |
56 ASSERT(pc_ <= buffer_.length()); | 56 ASSERT(pc_ <= buffer_.length()); |
57 if (pc_ + 1 >= buffer_.length()) { | 57 if (pc_ + 1 >= buffer_.length()) { |
58 Expand(); | 58 Expand(); |
59 } | 59 } |
60 *reinterpret_cast<uint16_t*>(buffer_.start() + pc_) = word; | 60 *reinterpret_cast<uint16_t*>(buffer_.start() + pc_) = word; |
61 pc_ += 2; | 61 pc_ += 2; |
62 } | 62 } |
63 | 63 |
64 | 64 |
65 void RegExpMacroAssemblerIrregexp::Emit8(uint32_t word) { | |
66 ASSERT(pc_ <= buffer_.length()); | |
67 if (pc_ + 1 >= buffer_.length()) { | |
ulan
2012/03/27 11:02:43
I think we want to expand only if pc_ == buffer.le
Erik Corry
2012/03/28 09:40:26
Done.
| |
68 Expand(); | |
69 } | |
70 *reinterpret_cast<unsigned char*>(buffer_.start() + pc_) = word; | |
71 pc_ += 1; | |
72 } | |
73 | |
74 | |
65 void RegExpMacroAssemblerIrregexp::Emit32(uint32_t word) { | 75 void RegExpMacroAssemblerIrregexp::Emit32(uint32_t word) { |
66 ASSERT(pc_ <= buffer_.length()); | 76 ASSERT(pc_ <= buffer_.length()); |
67 if (pc_ + 3 >= buffer_.length()) { | 77 if (pc_ + 3 >= buffer_.length()) { |
68 Expand(); | 78 Expand(); |
69 } | 79 } |
70 *reinterpret_cast<uint32_t*>(buffer_.start() + pc_) = word; | 80 *reinterpret_cast<uint32_t*>(buffer_.start() + pc_) = word; |
71 pc_ += 4; | 81 pc_ += 4; |
72 } | 82 } |
73 | 83 |
74 #endif // V8_INTERPRETED_REGEXP | 84 #endif // V8_INTERPRETED_REGEXP |
75 | 85 |
76 } } // namespace v8::internal | 86 } } // namespace v8::internal |
77 | 87 |
78 #endif // V8_REGEXP_MACRO_ASSEMBLER_IRREGEXP_INL_H_ | 88 #endif // V8_REGEXP_MACRO_ASSEMBLER_IRREGEXP_INL_H_ |
OLD | NEW |