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

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

Issue 1528873002: VM: Use read-only handle Object::dynamic_type() where possible. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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/parser.cc ('k') | runtime/vm/regexp_assembler_ir.cc » ('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 5258 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(RegExpMacroAssembler::kParamRegExpIndex, 5278 fn.SetParameterTypeAt(RegExpMacroAssembler::kParamRegExpIndex,
5279 Type::Handle(zone, Type::DynamicType())); 5279 Object::dynamic_type());
5280 fn.SetParameterNameAt(RegExpMacroAssembler::kParamRegExpIndex, 5280 fn.SetParameterNameAt(RegExpMacroAssembler::kParamRegExpIndex,
5281 Symbols::This()); 5281 Symbols::This());
5282 fn.SetParameterTypeAt(RegExpMacroAssembler::kParamStringIndex, 5282 fn.SetParameterTypeAt(RegExpMacroAssembler::kParamStringIndex,
5283 Type::Handle(zone, Type::DynamicType())); 5283 Object::dynamic_type());
5284 fn.SetParameterNameAt(RegExpMacroAssembler::kParamStringIndex, 5284 fn.SetParameterNameAt(RegExpMacroAssembler::kParamStringIndex,
5285 Symbols::string_param()); 5285 Symbols::string_param());
5286 fn.SetParameterTypeAt(RegExpMacroAssembler::kParamStartOffsetIndex, 5286 fn.SetParameterTypeAt(RegExpMacroAssembler::kParamStartOffsetIndex,
5287 Type::Handle(zone, Type::DynamicType())); 5287 Object::dynamic_type());
5288 fn.SetParameterNameAt(RegExpMacroAssembler::kParamStartOffsetIndex, 5288 fn.SetParameterNameAt(RegExpMacroAssembler::kParamStartOffsetIndex,
5289 Symbols::start_index_param()); 5289 Symbols::start_index_param());
5290 fn.set_result_type(Type::Handle(zone, Type::ArrayType())); 5290 fn.set_result_type(Type::Handle(zone, Type::ArrayType()));
5291 5291
5292 // Cache the result. 5292 // Cache the result.
5293 regexp.set_function(specialization_cid, fn); 5293 regexp.set_function(specialization_cid, fn);
5294 5294
5295 fn.SetRegExpData(regexp, specialization_cid); 5295 fn.SetRegExpData(regexp, specialization_cid);
5296 fn.set_is_debuggable(false); 5296 fn.set_is_debuggable(false);
5297 5297
(...skipping 28 matching lines...) Expand all
5326 CreateSpecializedFunction(zone, regexp, kOneByteStringCid, owner); 5326 CreateSpecializedFunction(zone, regexp, kOneByteStringCid, owner);
5327 CreateSpecializedFunction(zone, regexp, kTwoByteStringCid, owner); 5327 CreateSpecializedFunction(zone, regexp, kTwoByteStringCid, owner);
5328 CreateSpecializedFunction(zone, regexp, kExternalOneByteStringCid, owner); 5328 CreateSpecializedFunction(zone, regexp, kExternalOneByteStringCid, owner);
5329 CreateSpecializedFunction(zone, regexp, kExternalTwoByteStringCid, owner); 5329 CreateSpecializedFunction(zone, regexp, kExternalTwoByteStringCid, owner);
5330 5330
5331 return regexp.raw(); 5331 return regexp.raw();
5332 } 5332 }
5333 5333
5334 5334
5335 } // namespace dart 5335 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/parser.cc ('k') | runtime/vm/regexp_assembler_ir.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698