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

Side by Side Diff: runtime/vm/regexp_assembler_ir.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_assembler_ir.h ('k') | runtime/vm/regexp_bytecodes.h » ('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 "vm/regexp_assembler.h" 5 #include "vm/regexp_assembler_ir.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/compiler.h" 8 #include "vm/compiler.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/flow_graph_builder.h" 10 #include "vm/flow_graph_builder.h"
11 #include "vm/il_printer.h" 11 #include "vm/il_printer.h"
12 #include "vm/object_store.h" 12 #include "vm/object_store.h"
13 #include "vm/regexp.h" 13 #include "vm/regexp.h"
14 #include "vm/resolver.h" 14 #include "vm/resolver.h"
15 #include "vm/stack_frame.h" 15 #include "vm/stack_frame.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 * 60 *
61 * Results are returned though an array of capture indices, stored at 61 * Results are returned though an array of capture indices, stored at
62 * matches_param_. A null array specifies a failure to match. The match indices 62 * matches_param_. A null array specifies a failure to match. The match indices
63 * [start_inclusive, end_exclusive] for capture group i are stored at positions 63 * [start_inclusive, end_exclusive] for capture group i are stored at positions
64 * matches_param_[i * 2] and matches_param_[i * 2 + 1], respectively. Match 64 * matches_param_[i * 2] and matches_param_[i * 2 + 1], respectively. Match
65 * indices of -1 denote non-matched groups. Note that we store these indices 65 * indices of -1 denote non-matched groups. Note that we store these indices
66 * as a negative offset from the end of the string in registers_array_ 66 * as a negative offset from the end of the string in registers_array_
67 * during processing, and convert them to standard indexes when copying them 67 * during processing, and convert them to standard indexes when copying them
68 * to matches_param_ on successful match. 68 * to matches_param_ on successful match.
69 */ 69 */
70
71 RegExpMacroAssembler::RegExpMacroAssembler(Zone* zone)
72 : slow_safe_compiler_(false),
73 global_mode_(NOT_GLOBAL),
74 zone_(zone) {
75 }
76
77
78 RegExpMacroAssembler::~RegExpMacroAssembler() {
79 }
80
81
82 IRRegExpMacroAssembler::IRRegExpMacroAssembler( 70 IRRegExpMacroAssembler::IRRegExpMacroAssembler(
83 intptr_t specialization_cid, 71 intptr_t specialization_cid,
84 intptr_t capture_count, 72 intptr_t capture_count,
85 const ParsedFunction* parsed_function, 73 const ParsedFunction* parsed_function,
86 const ZoneGrowableArray<const ICData*>& ic_data_array, 74 const ZoneGrowableArray<const ICData*>& ic_data_array,
87 Zone* zone) 75 Zone* zone)
88 : RegExpMacroAssembler(zone), 76 : RegExpMacroAssembler(zone),
89 specialization_cid_(specialization_cid), 77 specialization_cid_(specialization_cid),
90 parsed_function_(parsed_function), 78 parsed_function_(parsed_function),
91 ic_data_array_(ic_data_array), 79 ic_data_array_(ic_data_array),
(...skipping 1834 matching lines...) Expand 10 before | Expand all | Expand 10 after
1926 index_val, 1914 index_val,
1927 characters, 1915 characters,
1928 specialization_cid_, 1916 specialization_cid_,
1929 Scanner::kNoSourcePos)); 1917 Scanner::kNoSourcePos));
1930 } 1918 }
1931 1919
1932 1920
1933 #undef __ 1921 #undef __
1934 1922
1935 } // namespace dart 1923 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/regexp_assembler_ir.h ('k') | runtime/vm/regexp_bytecodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698