| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 assembler_->EmitOrLink(label); | 57 assembler_->EmitOrLink(label); |
| 58 } | 58 } |
| 59 | 59 |
| 60 | 60 |
| 61 void RegExpMacroAssemblerTracer::AdvanceCurrentPosition(int by) { | 61 void RegExpMacroAssemblerTracer::AdvanceCurrentPosition(int by) { |
| 62 PrintF(" AdvanceCurrentPosition(by=%d);\n", by); | 62 PrintF(" AdvanceCurrentPosition(by=%d);\n", by); |
| 63 assembler_->AdvanceCurrentPosition(by); | 63 assembler_->AdvanceCurrentPosition(by); |
| 64 } | 64 } |
| 65 | 65 |
| 66 | 66 |
| 67 void RegExpMacroAssemblerTracer::CheckGreedyLoop(Label* label) { |
| 68 PrintF(" CheckGreedyLoop(label[%08x]);\n\n", label); |
| 69 assembler_->CheckGreedyLoop(label); |
| 70 } |
| 71 |
| 72 |
| 67 void RegExpMacroAssemblerTracer::PopCurrentPosition() { | 73 void RegExpMacroAssemblerTracer::PopCurrentPosition() { |
| 68 PrintF(" PopCurrentPosition();\n"); | 74 PrintF(" PopCurrentPosition();\n"); |
| 69 assembler_->PopCurrentPosition(); | 75 assembler_->PopCurrentPosition(); |
| 70 } | 76 } |
| 71 | 77 |
| 72 | 78 |
| 73 void RegExpMacroAssemblerTracer::PushCurrentPosition() { | 79 void RegExpMacroAssemblerTracer::PushCurrentPosition() { |
| 74 PrintF(" PushCurrentPosition();\n"); | 80 PrintF(" PushCurrentPosition();\n"); |
| 75 assembler_->PushCurrentPosition(); | 81 assembler_->PushCurrentPosition(); |
| 76 } | 82 } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 assembler_->AdvanceRegister(reg, by); | 129 assembler_->AdvanceRegister(reg, by); |
| 124 } | 130 } |
| 125 | 131 |
| 126 | 132 |
| 127 void RegExpMacroAssemblerTracer::SetRegister(int register_index, int to) { | 133 void RegExpMacroAssemblerTracer::SetRegister(int register_index, int to) { |
| 128 PrintF(" SetRegister(register=%d, to=%d);\n", register_index, to); | 134 PrintF(" SetRegister(register=%d, to=%d);\n", register_index, to); |
| 129 assembler_->SetRegister(register_index, to); | 135 assembler_->SetRegister(register_index, to); |
| 130 } | 136 } |
| 131 | 137 |
| 132 | 138 |
| 133 void RegExpMacroAssemblerTracer::WriteCurrentPositionToRegister(int reg) { | 139 void RegExpMacroAssemblerTracer::WriteCurrentPositionToRegister(int reg, |
| 134 PrintF(" WriteCurrentPositionToRegister(register=%d);\n", reg); | 140 int cp_offset) { |
| 135 assembler_->WriteCurrentPositionToRegister(reg); | 141 PrintF(" WriteCurrentPositionToRegister(register=%d,cp_offset=%d);\n", |
| 142 reg, |
| 143 cp_offset); |
| 144 assembler_->WriteCurrentPositionToRegister(reg, cp_offset); |
| 136 } | 145 } |
| 137 | 146 |
| 138 | 147 |
| 139 void RegExpMacroAssemblerTracer::ReadCurrentPositionFromRegister(int reg) { | 148 void RegExpMacroAssemblerTracer::ReadCurrentPositionFromRegister(int reg) { |
| 140 PrintF(" ReadCurrentPositionFromRegister(register=%d);\n", reg); | 149 PrintF(" ReadCurrentPositionFromRegister(register=%d);\n", reg); |
| 141 assembler_->ReadCurrentPositionFromRegister(reg); | 150 assembler_->ReadCurrentPositionFromRegister(reg); |
| 142 } | 151 } |
| 143 | 152 |
| 144 | 153 |
| 145 void RegExpMacroAssemblerTracer::WriteStackPointerToRegister(int reg) { | 154 void RegExpMacroAssemblerTracer::WriteStackPointerToRegister(int reg) { |
| 146 PrintF(" WriteStackPointerToRegister(register=%d);\n", reg); | 155 PrintF(" WriteStackPointerToRegister(register=%d);\n", reg); |
| 147 assembler_->WriteStackPointerToRegister(reg); | 156 assembler_->WriteStackPointerToRegister(reg); |
| 148 } | 157 } |
| 149 | 158 |
| 150 | 159 |
| 151 void RegExpMacroAssemblerTracer::ReadStackPointerFromRegister(int reg) { | 160 void RegExpMacroAssemblerTracer::ReadStackPointerFromRegister(int reg) { |
| 152 PrintF(" ReadStackPointerFromRegister(register=%d);\n", reg); | 161 PrintF(" ReadStackPointerFromRegister(register=%d);\n", reg); |
| 153 assembler_->ReadStackPointerFromRegister(reg); | 162 assembler_->ReadStackPointerFromRegister(reg); |
| 154 } | 163 } |
| 155 | 164 |
| 156 | 165 |
| 157 void RegExpMacroAssemblerTracer::LoadCurrentCharacter(int cp_offset, | 166 void RegExpMacroAssemblerTracer::LoadCurrentCharacter(int cp_offset, |
| 158 Label* on_end_of_input) { | 167 Label* on_end_of_input) { |
| 159 PrintF(" LoadCurrentCharacter(cp_offset=%d, label[%08x]);\n", cp_offset, | 168 PrintF(" LoadCurrentCharacter(cp_offset=%d, label[%08x]);\n", |
| 169 cp_offset, |
| 160 on_end_of_input); | 170 on_end_of_input); |
| 161 assembler_->LoadCurrentCharacter(cp_offset, on_end_of_input); | 171 assembler_->LoadCurrentCharacter(cp_offset, on_end_of_input); |
| 162 } | 172 } |
| 163 | 173 |
| 164 | 174 |
| 175 void RegExpMacroAssemblerTracer::LoadCurrentCharacterUnchecked(int cp_offset) { |
| 176 PrintF(" LoadCurrentCharacterUnchecked(cp_offset=%d);\n", |
| 177 cp_offset); |
| 178 assembler_->LoadCurrentCharacterUnchecked(cp_offset); |
| 179 } |
| 180 |
| 181 |
| 165 void RegExpMacroAssemblerTracer::CheckCharacterLT(uc16 limit, Label* on_less) { | 182 void RegExpMacroAssemblerTracer::CheckCharacterLT(uc16 limit, Label* on_less) { |
| 166 PrintF(" CheckCharacterLT(c='u%04x', label[%08x]);\n", limit, on_less); | 183 PrintF(" CheckCharacterLT(c='u%04x', label[%08x]);\n", limit, on_less); |
| 167 assembler_->CheckCharacterLT(limit, on_less); | 184 assembler_->CheckCharacterLT(limit, on_less); |
| 168 } | 185 } |
| 169 | 186 |
| 170 | 187 |
| 171 void RegExpMacroAssemblerTracer::CheckCharacterGT(uc16 limit, | 188 void RegExpMacroAssemblerTracer::CheckCharacterGT(uc16 limit, |
| 172 Label* on_greater) { | 189 Label* on_greater) { |
| 173 PrintF(" CheckCharacterGT(c='u%04x', label[%08x]);\n", limit, on_greater); | 190 PrintF(" CheckCharacterGT(c='u%04x', label[%08x]);\n", limit, on_greater); |
| 174 assembler_->CheckCharacterGT(limit, on_greater); | 191 assembler_->CheckCharacterGT(limit, on_greater); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 PrintF(" CheckNotRegistersEqual(reg1=%d, reg2=%d, label[%08x]);\n", | 252 PrintF(" CheckNotRegistersEqual(reg1=%d, reg2=%d, label[%08x]);\n", |
| 236 reg1, | 253 reg1, |
| 237 reg2, | 254 reg2, |
| 238 on_not_equal); | 255 on_not_equal); |
| 239 assembler_->CheckNotRegistersEqual(reg1, reg2, on_not_equal); | 256 assembler_->CheckNotRegistersEqual(reg1, reg2, on_not_equal); |
| 240 } | 257 } |
| 241 | 258 |
| 242 | 259 |
| 243 void RegExpMacroAssemblerTracer::CheckCharacters(Vector<const uc16> str, | 260 void RegExpMacroAssemblerTracer::CheckCharacters(Vector<const uc16> str, |
| 244 int cp_offset, | 261 int cp_offset, |
| 245 Label* on_failure) { | 262 Label* on_failure, |
| 246 PrintF(" CheckCharacters(str=\""); | 263 bool check_end_of_string) { |
| 264 PrintF(" %s(str=\"", |
| 265 check_end_of_string ? "CheckCharacters" : "CheckCharactersUnchecked"); |
| 247 for (int i = 0; i < str.length(); i++) { | 266 for (int i = 0; i < str.length(); i++) { |
| 248 PrintF("u%04x", str[i]); | 267 PrintF("u%04x", str[i]); |
| 249 } | 268 } |
| 250 PrintF("\", cp_offset=%d, label[%08x])\n", cp_offset, on_failure); | 269 PrintF("\", cp_offset=%d, label[%08x])\n", cp_offset, on_failure); |
| 251 assembler_->CheckCharacters(str, cp_offset, on_failure); | 270 assembler_->CheckCharacters(str, cp_offset, on_failure, check_end_of_string); |
| 252 } | |
| 253 | |
| 254 | |
| 255 void RegExpMacroAssemblerTracer::CheckCurrentPosition(int register_index, | |
| 256 Label* on_equal) { | |
| 257 PrintF(" CheckCurrentPosition(register=%d, label[%08x]);\n", register_index, | |
| 258 on_equal); | |
| 259 assembler_->CheckCurrentPosition(register_index, on_equal); | |
| 260 } | 271 } |
| 261 | 272 |
| 262 | 273 |
| 263 void RegExpMacroAssemblerTracer::CheckBitmap(uc16 start, Label* bitmap, | 274 void RegExpMacroAssemblerTracer::CheckBitmap(uc16 start, Label* bitmap, |
| 264 Label* on_zero) { | 275 Label* on_zero) { |
| 265 PrintF(" CheckBitmap(start=u$04x, <bitmap>, label[%08x]);\n", start, on_zero); | 276 PrintF(" CheckBitmap(start=u$04x, <bitmap>, label[%08x]);\n", start, on_zero); |
| 266 assembler_->CheckBitmap(start, bitmap, on_zero); | 277 assembler_->CheckBitmap(start, bitmap, on_zero); |
| 267 } | 278 } |
| 268 | 279 |
| 269 | 280 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 assembler_->IfRegisterGE(register_index, comparand, if_ge); | 338 assembler_->IfRegisterGE(register_index, comparand, if_ge); |
| 328 } | 339 } |
| 329 | 340 |
| 330 | 341 |
| 331 RegExpMacroAssembler::IrregexpImplementation | 342 RegExpMacroAssembler::IrregexpImplementation |
| 332 RegExpMacroAssemblerTracer::Implementation() { | 343 RegExpMacroAssemblerTracer::Implementation() { |
| 333 return assembler_->Implementation(); | 344 return assembler_->Implementation(); |
| 334 } | 345 } |
| 335 | 346 |
| 336 | 347 |
| 337 Handle<Object> RegExpMacroAssemblerTracer::GetCode() { | 348 Handle<Object> RegExpMacroAssemblerTracer::GetCode(Handle<String> source) { |
| 338 PrintF(" GetCode();\n"); | 349 PrintF(" GetCode(%s);\n", *(source->ToCString())); |
| 339 return assembler_->GetCode(); | 350 return assembler_->GetCode(source); |
| 340 } | 351 } |
| 341 | 352 |
| 342 }} // namespace v8::internal | 353 }} // namespace v8::internal |
| OLD | NEW |