| OLD | NEW |
| 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_ir.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" |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 static const bool kEnableUnalignedAccesses = false; | 304 static const bool kEnableUnalignedAccesses = false; |
| 305 #else | 305 #else |
| 306 static const bool kEnableUnalignedAccesses = true; | 306 static const bool kEnableUnalignedAccesses = true; |
| 307 #endif | 307 #endif |
| 308 bool IRRegExpMacroAssembler::CanReadUnaligned() { | 308 bool IRRegExpMacroAssembler::CanReadUnaligned() { |
| 309 return kEnableUnalignedAccesses && !slow_safe(); | 309 return kEnableUnalignedAccesses && !slow_safe(); |
| 310 } | 310 } |
| 311 | 311 |
| 312 | 312 |
| 313 RawArray* IRRegExpMacroAssembler::Execute( | 313 RawArray* IRRegExpMacroAssembler::Execute( |
| 314 const JSRegExp& regexp, | 314 const RegExp& regexp, |
| 315 const String& input, | 315 const String& input, |
| 316 const Smi& start_offset, | 316 const Smi& start_offset, |
| 317 Zone* zone) { | 317 Zone* zone) { |
| 318 const intptr_t cid = input.GetClassId(); | 318 const intptr_t cid = input.GetClassId(); |
| 319 const Function& fun = Function::Handle(regexp.function(cid)); | 319 const Function& fun = Function::Handle(regexp.function(cid)); |
| 320 ASSERT(!fun.IsNull()); | 320 ASSERT(!fun.IsNull()); |
| 321 // Create the argument list. | 321 // Create the argument list. |
| 322 const Array& args = | 322 const Array& args = |
| 323 Array::Handle(Array::New(RegExpMacroAssembler::kParamCount)); | 323 Array::Handle(Array::New(RegExpMacroAssembler::kParamCount)); |
| 324 args.SetAt(RegExpMacroAssembler::kParamRegExpIndex, regexp); | 324 args.SetAt(RegExpMacroAssembler::kParamRegExpIndex, regexp); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 | 422 |
| 423 ConstantInstr* IRRegExpMacroAssembler::StringConstant(const char* value) const { | 423 ConstantInstr* IRRegExpMacroAssembler::StringConstant(const char* value) const { |
| 424 return new(Z) ConstantInstr( | 424 return new(Z) ConstantInstr( |
| 425 String::ZoneHandle(Z, String::New(value, Heap::kOld))); | 425 String::ZoneHandle(Z, String::New(value, Heap::kOld))); |
| 426 } | 426 } |
| 427 | 427 |
| 428 | 428 |
| 429 ConstantInstr* IRRegExpMacroAssembler::WordCharacterMapConstant() const { | 429 ConstantInstr* IRRegExpMacroAssembler::WordCharacterMapConstant() const { |
| 430 const Library& lib = Library::Handle(Z, Library::CoreLibrary()); | 430 const Library& lib = Library::Handle(Z, Library::CoreLibrary()); |
| 431 const Class& regexp_class = Class::Handle(Z, | 431 const Class& regexp_class = Class::Handle(Z, |
| 432 lib.LookupClassAllowPrivate(Symbols::JSSyntaxRegExp())); | 432 lib.LookupClassAllowPrivate(Symbols::_RegExp())); |
| 433 const Field& word_character_field = Field::ZoneHandle(Z, | 433 const Field& word_character_field = Field::ZoneHandle(Z, |
| 434 regexp_class.LookupStaticField(Symbols::_wordCharacterMap())); | 434 regexp_class.LookupStaticField(Symbols::_wordCharacterMap())); |
| 435 ASSERT(!word_character_field.IsNull()); | 435 ASSERT(!word_character_field.IsNull()); |
| 436 | 436 |
| 437 if (word_character_field.IsUninitialized()) { | 437 if (word_character_field.IsUninitialized()) { |
| 438 ASSERT(!Compiler::IsBackgroundCompilation()); | 438 ASSERT(!Compiler::IsBackgroundCompilation()); |
| 439 word_character_field.EvaluateInitializer(); | 439 word_character_field.EvaluateInitializer(); |
| 440 } | 440 } |
| 441 ASSERT(!word_character_field.IsUninitialized()); | 441 ASSERT(!word_character_field.IsUninitialized()); |
| 442 | 442 |
| (...skipping 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1928 index_val, | 1928 index_val, |
| 1929 characters, | 1929 characters, |
| 1930 specialization_cid_, | 1930 specialization_cid_, |
| 1931 TokenPosition::kNoSource)); | 1931 TokenPosition::kNoSource)); |
| 1932 } | 1932 } |
| 1933 | 1933 |
| 1934 | 1934 |
| 1935 #undef __ | 1935 #undef __ |
| 1936 | 1936 |
| 1937 } // namespace dart | 1937 } // namespace dart |
| OLD | NEW |