Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(361)

Side by Side Diff: runtime/vm/regexp_test.cc

Issue 1201383002: Port irregexp bytecode compiler and interpreter from V8 r24065. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/regexp_interpreter.cc ('k') | runtime/vm/vm_sources.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/globals.h" 5 #include "platform/globals.h"
6 6
7 #include "vm/isolate.h" 7 #include "vm/isolate.h"
8 #include "vm/object.h" 8 #include "vm/object.h"
9 #include "vm/regexp.h" 9 #include "vm/regexp.h"
10 #include "vm/regexp_assembler_ir.h"
10 #include "vm/unit_test.h" 11 #include "vm/unit_test.h"
11 12
12 namespace dart { 13 namespace dart {
13 14
14 static RawArray* Match(const String& pat, const String& str) { 15 static RawArray* Match(const String& pat, const String& str) {
15 Zone* zone = Thread::Current()->zone(); 16 Zone* zone = Thread::Current()->zone();
16 const JSRegExp& regexp = JSRegExp::Handle( 17 const JSRegExp& regexp = JSRegExp::Handle(
17 RegExpEngine::CreateJSRegExp(zone, pat, false, false)); 18 RegExpEngine::CreateJSRegExp(zone, pat, false, false));
18 const intptr_t cid = str.GetClassId(); 19 const intptr_t cid = str.GetClassId();
19 const Function& fn = Function::Handle(regexp.function(cid)); 20 const Function& fn = Function::Handle(regexp.function(cid));
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 EXPECT(res_1.IsSmi()); 101 EXPECT(res_1.IsSmi());
101 EXPECT(res_2.IsSmi()); 102 EXPECT(res_2.IsSmi());
102 103
103 const Smi& smi_1 = Smi::Cast(res_1); 104 const Smi& smi_1 = Smi::Cast(res_1);
104 const Smi& smi_2 = Smi::Cast(res_2); 105 const Smi& smi_2 = Smi::Cast(res_2);
105 EXPECT_EQ(1, smi_1.Value()); 106 EXPECT_EQ(1, smi_1.Value());
106 EXPECT_EQ(3, smi_2.Value()); 107 EXPECT_EQ(3, smi_2.Value());
107 } 108 }
108 109
109 } // namespace dart 110 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/regexp_interpreter.cc ('k') | runtime/vm/vm_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698