Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/assert.h" | 5 #include "platform/assert.h" |
| 6 #include "vm/bootstrap_natives.h" | 6 #include "vm/bootstrap_natives.h" |
| 7 #include "vm/exceptions.h" | 7 #include "vm/exceptions.h" |
| 8 #include "vm/native_entry.h" | 8 #include "vm/native_entry.h" |
| 9 #include "vm/object.h" | 9 #include "vm/object.h" |
| 10 #include "vm/regexp_parser.h" | 10 #include "vm/regexp_parser.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 80 | 80 |
| 81 DEFINE_NATIVE_ENTRY(RegExp_ExecuteMatch, 3) { | 81 DEFINE_NATIVE_ENTRY(RegExp_ExecuteMatch, 3) { |
| 82 // This function is intrinsified. See Intrinsifier::RegExp_ExecuteMatch. | 82 // This function is intrinsified. See Intrinsifier::RegExp_ExecuteMatch. |
| 83 const RegExp& regexp = RegExp::CheckedHandle(arguments->NativeArgAt(0)); | 83 const RegExp& regexp = RegExp::CheckedHandle(arguments->NativeArgAt(0)); |
| 84 ASSERT(!regexp.IsNull()); | 84 ASSERT(!regexp.IsNull()); |
| 85 GET_NON_NULL_NATIVE_ARGUMENT(String, subject, arguments->NativeArgAt(1)); | 85 GET_NON_NULL_NATIVE_ARGUMENT(String, subject, arguments->NativeArgAt(1)); |
| 86 GET_NON_NULL_NATIVE_ARGUMENT(Smi, start_index, arguments->NativeArgAt(2)); | 86 GET_NON_NULL_NATIVE_ARGUMENT(Smi, start_index, arguments->NativeArgAt(2)); |
| 87 | 87 |
| 88 if (FLAG_interpret_irregexp || FLAG_precompiled_runtime) { | 88 if (FLAG_interpret_irregexp || FLAG_precompiled_runtime) { |
| 89 return BytecodeRegExpMacroAssembler::Interpret(regexp, subject, start_index, | 89 return BytecodeRegExpMacroAssembler::Interpret(regexp, subject, start_index, |
| 90 zone); | 90 /*sticky=*/false, zone); |
| 91 } | 91 } |
| 92 | 92 |
| 93 return IRRegExpMacroAssembler::Execute(regexp, subject, start_index, zone); | 93 return IRRegExpMacroAssembler::Execute(regexp, subject, start_index, |
| 94 /*sticky=*/false, zone); | |
| 94 } | 95 } |
| 95 | 96 |
| 97 | |
| 98 DEFINE_NATIVE_ENTRY(RegExp_ExecuteMatchSticky, 3) { | |
| 99 // This function is intrinsified. See Intrinsifier::RegExp_ExecuteMatch. | |
|
rmacnak
2016/11/17 00:49:52
MatchSticky
Vyacheslav Egorov (Google)
2016/11/17 16:51:33
Done.
| |
| 100 const RegExp& regexp = RegExp::CheckedHandle(arguments->NativeArgAt(0)); | |
| 101 ASSERT(!regexp.IsNull()); | |
| 102 GET_NON_NULL_NATIVE_ARGUMENT(String, subject, arguments->NativeArgAt(1)); | |
| 103 GET_NON_NULL_NATIVE_ARGUMENT(Smi, start_index, arguments->NativeArgAt(2)); | |
| 104 | |
| 105 if (FLAG_interpret_irregexp || FLAG_precompiled_runtime) { | |
| 106 return BytecodeRegExpMacroAssembler::Interpret(regexp, subject, start_index, | |
| 107 /*sticky=*/true, zone); | |
| 108 } | |
| 109 | |
| 110 return IRRegExpMacroAssembler::Execute(regexp, subject, start_index, | |
| 111 /*sticky=*/true, zone); | |
| 112 } | |
| 113 | |
| 114 | |
| 96 } // namespace dart | 115 } // namespace dart |
| OLD | NEW |