OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 Isolate* isolate = CcTest::i_isolate(); | 511 Isolate* isolate = CcTest::i_isolate(); |
512 FlatStringReader reader(isolate, CStrVector(input)); | 512 FlatStringReader reader(isolate, CStrVector(input)); |
513 RegExpCompileData compile_data; | 513 RegExpCompileData compile_data; |
514 if (!v8::internal::RegExpParser::ParseRegExp(&reader, multiline, | 514 if (!v8::internal::RegExpParser::ParseRegExp(&reader, multiline, |
515 &compile_data, zone)) | 515 &compile_data, zone)) |
516 return NULL; | 516 return NULL; |
517 Handle<String> pattern = isolate->factory()-> | 517 Handle<String> pattern = isolate->factory()-> |
518 NewStringFromUtf8(CStrVector(input)).ToHandleChecked(); | 518 NewStringFromUtf8(CStrVector(input)).ToHandleChecked(); |
519 Handle<String> sample_subject = | 519 Handle<String> sample_subject = |
520 isolate->factory()->NewStringFromUtf8(CStrVector("")).ToHandleChecked(); | 520 isolate->factory()->NewStringFromUtf8(CStrVector("")).ToHandleChecked(); |
521 RegExpEngine::Compile(&compile_data, false, false, multiline, false, pattern, | 521 RegExpEngine::Compile(&compile_data, false, false, multiline, pattern, |
522 sample_subject, is_one_byte, zone); | 522 sample_subject, is_one_byte, zone); |
523 return compile_data.node; | 523 return compile_data.node; |
524 } | 524 } |
525 | 525 |
526 | 526 |
527 static void Execute(const char* input, bool multiline, bool is_one_byte, | 527 static void Execute(const char* input, bool multiline, bool is_one_byte, |
528 bool dot_output = false) { | 528 bool dot_output = false) { |
529 v8::HandleScope scope(CcTest::isolate()); | 529 v8::HandleScope scope(CcTest::isolate()); |
530 Zone zone(CcTest::i_isolate()); | 530 Zone zone(CcTest::i_isolate()); |
531 RegExpNode* node = Compile(input, multiline, is_one_byte, &zone); | 531 RegExpNode* node = Compile(input, multiline, is_one_byte, &zone); |
(...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1804 ZoneList<CharacterRange> first_only(4, &zone); | 1804 ZoneList<CharacterRange> first_only(4, &zone); |
1805 ZoneList<CharacterRange> second_only(4, &zone); | 1805 ZoneList<CharacterRange> second_only(4, &zone); |
1806 ZoneList<CharacterRange> both(4, &zone); | 1806 ZoneList<CharacterRange> both(4, &zone); |
1807 } | 1807 } |
1808 | 1808 |
1809 | 1809 |
1810 TEST(Graph) { | 1810 TEST(Graph) { |
1811 V8::Initialize(NULL); | 1811 V8::Initialize(NULL); |
1812 Execute("\\b\\w+\\b", false, true, true); | 1812 Execute("\\b\\w+\\b", false, true, true); |
1813 } | 1813 } |
OLD | NEW |