| 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 for (int i = 0; i < str.length(); i++) { | 288 for (int i = 0; i < str.length(); i++) { |
| 289 PrintF("u%04x", str[i]); | 289 PrintF("u%04x", str[i]); |
| 290 } | 290 } |
| 291 PrintF("\", cp_offset=%d, label[%08x])\n", cp_offset, on_failure); | 291 PrintF("\", cp_offset=%d, label[%08x])\n", cp_offset, on_failure); |
| 292 assembler_->CheckCharacters(str, cp_offset, on_failure, check_end_of_string); | 292 assembler_->CheckCharacters(str, cp_offset, on_failure, check_end_of_string); |
| 293 } | 293 } |
| 294 | 294 |
| 295 | 295 |
| 296 void RegExpMacroAssemblerTracer::CheckBitmap(uc16 start, Label* bitmap, | 296 void RegExpMacroAssemblerTracer::CheckBitmap(uc16 start, Label* bitmap, |
| 297 Label* on_zero) { | 297 Label* on_zero) { |
| 298 PrintF(" CheckBitmap(start=u$04x, <bitmap>, label[%08x]);\n", start, on_zero); | 298 PrintF(" CheckBitmap(start=u%04x, <bitmap>, label[%08x]);\n", start, on_zero); |
| 299 assembler_->CheckBitmap(start, bitmap, on_zero); | 299 assembler_->CheckBitmap(start, bitmap, on_zero); |
| 300 } | 300 } |
| 301 | 301 |
| 302 | 302 |
| 303 bool RegExpMacroAssemblerTracer::CheckSpecialCharacterClass( |
| 304 uc16 type, |
| 305 int cp_offset, |
| 306 bool check_offset, |
| 307 Label* on_no_match) { |
| 308 bool supported = assembler_->CheckSpecialCharacterClass(type, |
| 309 cp_offset, |
| 310 check_offset, |
| 311 on_no_match); |
| 312 PrintF(" CheckSpecialCharacterClass(type='%c', offset=%d, " |
| 313 "check_offset=%s, label[%08x]): %s;\n", |
| 314 type, |
| 315 cp_offset, |
| 316 check_offset ? "true" : "false", |
| 317 on_no_match, |
| 318 supported ? "true" : "false"); |
| 319 return supported; |
| 320 } |
| 321 |
| 322 |
| 303 void RegExpMacroAssemblerTracer::DispatchHalfNibbleMap( | 323 void RegExpMacroAssemblerTracer::DispatchHalfNibbleMap( |
| 304 uc16 start, | 324 uc16 start, |
| 305 Label* half_nibble_map, | 325 Label* half_nibble_map, |
| 306 const Vector<Label*>& destinations) { | 326 const Vector<Label*>& destinations) { |
| 307 PrintF(" DispatchHalfNibbleMap(start=u$04x, <half_nibble_map>, [", start); | 327 PrintF(" DispatchHalfNibbleMap(start=u%04x, <half_nibble_map>, [", start); |
| 308 for (int i = 0; i < destinations.length(); i++) { | 328 for (int i = 0; i < destinations.length(); i++) { |
| 309 if (i > 0) | 329 if (i > 0) |
| 310 PrintF(", "); | 330 PrintF(", "); |
| 311 PrintF("label[%08x]", destinations[i]); | 331 PrintF("label[%08x]", destinations[i]); |
| 312 } | 332 } |
| 313 PrintF(");\n"); | 333 PrintF(");\n"); |
| 314 assembler_->DispatchHalfNibbleMap(start, half_nibble_map, destinations); | 334 assembler_->DispatchHalfNibbleMap(start, half_nibble_map, destinations); |
| 315 } | 335 } |
| 316 | 336 |
| 317 | 337 |
| 318 void RegExpMacroAssemblerTracer::DispatchByteMap( | 338 void RegExpMacroAssemblerTracer::DispatchByteMap( |
| 319 uc16 start, | 339 uc16 start, |
| 320 Label* byte_map, | 340 Label* byte_map, |
| 321 const Vector<Label*>& destinations) { | 341 const Vector<Label*>& destinations) { |
| 322 PrintF(" DispatchByteMap(start=u$04x, <byte_map>, [", start); | 342 PrintF(" DispatchByteMap(start=u%04x, <byte_map>, [", start); |
| 323 for (int i = 0; i < destinations.length(); i++) { | 343 for (int i = 0; i < destinations.length(); i++) { |
| 324 if (i > 0) | 344 if (i > 0) |
| 325 PrintF(", "); | 345 PrintF(", "); |
| 326 PrintF("label[%08x]", destinations[i]); | 346 PrintF("label[%08x]", destinations[i]); |
| 327 } | 347 } |
| 328 PrintF(");\n"); | 348 PrintF(");\n"); |
| 329 assembler_->DispatchByteMap(start, byte_map, destinations); | 349 assembler_->DispatchByteMap(start, byte_map, destinations); |
| 330 } | 350 } |
| 331 | 351 |
| 332 | 352 |
| 333 void RegExpMacroAssemblerTracer::DispatchHighByteMap( | 353 void RegExpMacroAssemblerTracer::DispatchHighByteMap( |
| 334 byte start, | 354 byte start, |
| 335 Label* byte_map, | 355 Label* byte_map, |
| 336 const Vector<Label*>& destinations) { | 356 const Vector<Label*>& destinations) { |
| 337 PrintF(" DispatchHighByteMap(start=u$04x, <byte_map>, [", start); | 357 PrintF(" DispatchHighByteMap(start=u%04x, <byte_map>, [", start); |
| 338 for (int i = 0; i < destinations.length(); i++) { | 358 for (int i = 0; i < destinations.length(); i++) { |
| 339 if (i > 0) | 359 if (i > 0) |
| 340 PrintF(", "); | 360 PrintF(", "); |
| 341 PrintF("label[%08x]", destinations[i]); | 361 PrintF("label[%08x]", destinations[i]); |
| 342 } | 362 } |
| 343 PrintF(");\n"); | 363 PrintF(");\n"); |
| 344 assembler_->DispatchHighByteMap(start, byte_map, destinations); | 364 assembler_->DispatchHighByteMap(start, byte_map, destinations); |
| 345 } | 365 } |
| 346 | 366 |
| 347 | 367 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 366 return assembler_->Implementation(); | 386 return assembler_->Implementation(); |
| 367 } | 387 } |
| 368 | 388 |
| 369 | 389 |
| 370 Handle<Object> RegExpMacroAssemblerTracer::GetCode(Handle<String> source) { | 390 Handle<Object> RegExpMacroAssemblerTracer::GetCode(Handle<String> source) { |
| 371 PrintF(" GetCode(%s);\n", *(source->ToCString())); | 391 PrintF(" GetCode(%s);\n", *(source->ToCString())); |
| 372 return assembler_->GetCode(source); | 392 return assembler_->GetCode(source); |
| 373 } | 393 } |
| 374 | 394 |
| 375 }} // namespace v8::internal | 395 }} // namespace v8::internal |
| OLD | NEW |