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

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

Issue 1305993005: VM: Simplify irregexp entry stub. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: simplify ExecuteMatch Created 5 years, 3 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/intrinsifier_x64.cc ('k') | runtime/vm/regexp_assembler.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.h" 5 #include "vm/regexp.h"
6 6
7 #include "vm/dart_entry.h" 7 #include "vm/dart_entry.h"
8 #include "vm/regexp_assembler.h" 8 #include "vm/regexp_assembler.h"
9 #include "vm/regexp_assembler_bytecode.h" 9 #include "vm/regexp_assembler_bytecode.h"
10 #include "vm/regexp_assembler_ir.h" 10 #include "vm/regexp_assembler_ir.h"
(...skipping 5257 matching lines...) Expand 10 before | Expand all | Expand 10 after
5268 false, // Not native. 5268 false, // Not native.
5269 owner, 5269 owner,
5270 0)); // No token position. 5270 0)); // No token position.
5271 5271
5272 // TODO(zerny): Share these arrays between all irregexp functions. 5272 // TODO(zerny): Share these arrays between all irregexp functions.
5273 fn.set_num_fixed_parameters(kParamCount); 5273 fn.set_num_fixed_parameters(kParamCount);
5274 fn.set_parameter_types(Array::Handle(zone, Array::New(kParamCount, 5274 fn.set_parameter_types(Array::Handle(zone, Array::New(kParamCount,
5275 Heap::kOld))); 5275 Heap::kOld)));
5276 fn.set_parameter_names(Array::Handle(zone, Array::New(kParamCount, 5276 fn.set_parameter_names(Array::Handle(zone, Array::New(kParamCount,
5277 Heap::kOld))); 5277 Heap::kOld)));
5278 fn.SetParameterTypeAt(0, Type::Handle(zone, Type::DynamicType())); 5278 fn.SetParameterTypeAt(RegExpMacroAssembler::kParamRegExpIndex,
5279 fn.SetParameterNameAt(0, Symbols::string_param()); 5279 Type::Handle(zone, Type::DynamicType()));
5280 fn.SetParameterTypeAt(1, Type::Handle(zone, Type::DynamicType())); 5280 fn.SetParameterNameAt(RegExpMacroAssembler::kParamRegExpIndex,
5281 fn.SetParameterNameAt(1, Symbols::start_index_param()); 5281 Symbols::This());
5282 fn.SetParameterTypeAt(RegExpMacroAssembler::kParamStringIndex,
5283 Type::Handle(zone, Type::DynamicType()));
5284 fn.SetParameterNameAt(RegExpMacroAssembler::kParamStringIndex,
5285 Symbols::string_param());
5286 fn.SetParameterTypeAt(RegExpMacroAssembler::kParamStartOffsetIndex,
5287 Type::Handle(zone, Type::DynamicType()));
5288 fn.SetParameterNameAt(RegExpMacroAssembler::kParamStartOffsetIndex,
5289 Symbols::start_index_param());
5282 fn.set_result_type(Type::Handle(zone, Type::ArrayType())); 5290 fn.set_result_type(Type::Handle(zone, Type::ArrayType()));
5283 5291
5284 // Cache the result. 5292 // Cache the result.
5285 regexp.set_function(specialization_cid, fn); 5293 regexp.set_function(specialization_cid, fn);
5286 5294
5287 fn.SetRegExpData(regexp, specialization_cid); 5295 fn.SetRegExpData(regexp, specialization_cid);
5288 fn.set_is_debuggable(false); 5296 fn.set_is_debuggable(false);
5289 5297
5290 // The function is compiled lazily during the first call. 5298 // The function is compiled lazily during the first call.
5291 } 5299 }
(...skipping 26 matching lines...) Expand all
5318 CreateSpecializedFunction(zone, regexp, kOneByteStringCid, owner); 5326 CreateSpecializedFunction(zone, regexp, kOneByteStringCid, owner);
5319 CreateSpecializedFunction(zone, regexp, kTwoByteStringCid, owner); 5327 CreateSpecializedFunction(zone, regexp, kTwoByteStringCid, owner);
5320 CreateSpecializedFunction(zone, regexp, kExternalOneByteStringCid, owner); 5328 CreateSpecializedFunction(zone, regexp, kExternalOneByteStringCid, owner);
5321 CreateSpecializedFunction(zone, regexp, kExternalTwoByteStringCid, owner); 5329 CreateSpecializedFunction(zone, regexp, kExternalTwoByteStringCid, owner);
5322 5330
5323 return regexp.raw(); 5331 return regexp.raw();
5324 } 5332 }
5325 5333
5326 5334
5327 } // namespace dart 5335 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_x64.cc ('k') | runtime/vm/regexp_assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698