| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 } | 62 } |
| 63 | 63 |
| 64 | 64 |
| 65 void RegExpMacroAssemblerRe2k::PushRegister(int register_index) { | 65 void RegExpMacroAssemblerRe2k::PushRegister(int register_index) { |
| 66 assembler_->PushRegister(register_index); | 66 assembler_->PushRegister(register_index); |
| 67 } | 67 } |
| 68 | 68 |
| 69 | 69 |
| 70 void RegExpMacroAssemblerRe2k::WriteCurrentPositionToRegister( | 70 void RegExpMacroAssemblerRe2k::WriteCurrentPositionToRegister( |
| 71 int register_index) { | 71 int register_index) { |
| 72 assembler_->SetRegisterToCurrentPosition(register_index); | 72 assembler_->WriteCurrentPositionToRegister(register_index); |
| 73 } |
| 74 |
| 75 |
| 76 void RegExpMacroAssemblerRe2k::SetCurrentPositionFromRegister( |
| 77 int register_index) { |
| 78 assembler_->SetCurrentPositionFromRegister(register_index); |
| 79 } |
| 80 |
| 81 |
| 82 void RegExpMacroAssemblerRe2k::WriteStackPointerToRegister(int register_index) { |
| 83 assembler_->WriteStackPointerToRegister(register_index); |
| 84 } |
| 85 |
| 86 |
| 87 void RegExpMacroAssemblerRe2k::SetStackPointerFromRegister(int register_index) { |
| 88 assembler_->SetStackPointerFromRegister(register_index); |
| 73 } | 89 } |
| 74 | 90 |
| 75 | 91 |
| 76 void RegExpMacroAssemblerRe2k::SetRegister(int register_index, int to) { | 92 void RegExpMacroAssemblerRe2k::SetRegister(int register_index, int to) { |
| 77 assembler_->SetRegister(register_index, to); | 93 assembler_->SetRegister(register_index, to); |
| 78 } | 94 } |
| 79 | 95 |
| 80 | 96 |
| 81 void RegExpMacroAssemblerRe2k::AdvanceRegister(int register_index, int by) { | 97 void RegExpMacroAssemblerRe2k::AdvanceRegister(int register_index, int by) { |
| 82 assembler_->AdvanceRegister(register_index, by); | 98 assembler_->AdvanceRegister(register_index, by); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 UNREACHABLE(); | 146 UNREACHABLE(); |
| 131 } | 147 } |
| 132 | 148 |
| 133 | 149 |
| 134 void RegExpMacroAssemblerRe2k::LoadCurrentCharacter(int cp_offset, | 150 void RegExpMacroAssemblerRe2k::LoadCurrentCharacter(int cp_offset, |
| 135 Label* on_failure) { | 151 Label* on_failure) { |
| 136 assembler_->LoadCurrentChar(cp_offset, on_failure); | 152 assembler_->LoadCurrentChar(cp_offset, on_failure); |
| 137 } | 153 } |
| 138 | 154 |
| 139 | 155 |
| 140 void RegExpMacroAssemblerRe2k::CheckCharacterLT(uc16 limit, | 156 void RegExpMacroAssemblerRe2k::CheckCharacterLT(uc16 limit, Label* on_less) { |
| 141 Label* on_less) { | |
| 142 assembler_->CheckCharacterLT(limit, on_less); | 157 assembler_->CheckCharacterLT(limit, on_less); |
| 143 } | 158 } |
| 144 | 159 |
| 145 | 160 |
| 146 void RegExpMacroAssemblerRe2k::CheckCharacterGT(uc16 limit, | 161 void RegExpMacroAssemblerRe2k::CheckCharacterGT(uc16 limit, Label* on_greater) { |
| 147 Label* on_greater) { | |
| 148 assembler_->CheckCharacterGT(limit, on_greater); | 162 assembler_->CheckCharacterGT(limit, on_greater); |
| 149 } | 163 } |
| 150 | 164 |
| 151 | 165 |
| 166 void RegExpMacroAssemblerRe2k::CheckCharacter(uc16 c, Label* on_equal) { |
| 167 assembler_->CheckCharacter(c, on_equal); |
| 168 } |
| 169 |
| 170 |
| 171 void RegExpMacroAssemblerRe2k::CheckNotCharacter(uc16 c, Label* on_not_equal) { |
| 172 assembler_->CheckNotCharacter(c, on_not_equal); |
| 173 } |
| 174 |
| 175 |
| 152 void RegExpMacroAssemblerRe2k::CheckBitmap(uc16 start, | 176 void RegExpMacroAssemblerRe2k::CheckBitmap(uc16 start, |
| 153 Label* bitmap, | 177 Label* bitmap, |
| 154 Label* on_zero) { | 178 Label* on_zero) { |
| 155 assembler_->LookupMap1(start, bitmap, on_zero); | 179 assembler_->LookupMap1(start, bitmap, on_zero); |
| 156 } | 180 } |
| 157 | 181 |
| 158 | 182 |
| 159 void RegExpMacroAssemblerRe2k::DispatchHalfNibbleMap( | 183 void RegExpMacroAssemblerRe2k::DispatchHalfNibbleMap( |
| 160 uc16 start, | 184 uc16 start, |
| 161 Label* half_nibble_map, | 185 Label* half_nibble_map, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 178 assembler_->LookupHighMap8(start, byte_map, table); | 202 assembler_->LookupHighMap8(start, byte_map, table); |
| 179 } | 203 } |
| 180 | 204 |
| 181 | 205 |
| 182 void RegExpMacroAssemblerRe2k::CheckCharacters( | 206 void RegExpMacroAssemblerRe2k::CheckCharacters( |
| 183 Vector<const uc16> str, | 207 Vector<const uc16> str, |
| 184 int cp_offset, | 208 int cp_offset, |
| 185 Label* on_failure) { | 209 Label* on_failure) { |
| 186 for (int i = str.length() - 1; i >= 0; i--) { | 210 for (int i = str.length() - 1; i >= 0; i--) { |
| 187 assembler_->LoadCurrentChar(cp_offset + i, on_failure); | 211 assembler_->LoadCurrentChar(cp_offset + i, on_failure); |
| 188 assembler_->CheckChar(str[i], on_failure); | 212 assembler_->CheckNotCharacter(str[i], on_failure); |
| 189 } | 213 } |
| 190 } | 214 } |
| 191 | 215 |
| 192 | 216 |
| 193 void RegExpMacroAssemblerRe2k::IfRegisterLT(int register_index, | 217 void RegExpMacroAssemblerRe2k::IfRegisterLT(int register_index, |
| 194 int comparand, | 218 int comparand, |
| 195 Label* if_less_than) { | 219 Label* if_less_than) { |
| 196 ASSERT(comparand >= 0 && comparand <= 65535); | 220 ASSERT(comparand >= 0 && comparand <= 65535); |
| 197 assembler_->CheckRegisterLT(register_index, comparand, if_less_than); | 221 assembler_->CheckRegisterLT(register_index, comparand, if_less_than); |
| 198 } | 222 } |
| 199 | 223 |
| 200 | 224 |
| 201 void RegExpMacroAssemblerRe2k::IfRegisterGE(int register_index, | 225 void RegExpMacroAssemblerRe2k::IfRegisterGE(int register_index, |
| 202 int comparand, | 226 int comparand, |
| 203 Label* if_greater_or_equal) { | 227 Label* if_greater_or_equal) { |
| 204 ASSERT(comparand >= 0 && comparand <= 65535); | 228 ASSERT(comparand >= 0 && comparand <= 65535); |
| 205 assembler_->CheckRegisterGE(register_index, comparand, if_greater_or_equal); | 229 assembler_->CheckRegisterGE(register_index, comparand, if_greater_or_equal); |
| 206 } | 230 } |
| 207 | 231 |
| 208 | 232 |
| 209 Handle<Object> RegExpMacroAssemblerRe2k::GetCode() { | 233 Handle<Object> RegExpMacroAssemblerRe2k::GetCode() { |
| 210 Handle<ByteArray> array = Factory::NewByteArray(assembler_->length()); | 234 Handle<ByteArray> array = Factory::NewByteArray(assembler_->length()); |
| 211 assembler_->Copy(array->GetDataStartAddress()); | 235 assembler_->Copy(array->GetDataStartAddress()); |
| 212 return array; | 236 return array; |
| 213 } | 237 } |
| 214 | 238 |
| 215 } } // namespace v8::internal | 239 } } // namespace v8::internal |
| OLD | NEW |