OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/builtins/builtins-regexp.h" | 5 #include "src/builtins/builtins-regexp.h" |
6 | 6 |
7 #include "src/builtins/builtins-constructor.h" | 7 #include "src/builtins/builtins-constructor.h" |
8 #include "src/builtins/builtins-utils.h" | 8 #include "src/builtins/builtins-utils.h" |
9 #include "src/builtins/builtins.h" | 9 #include "src/builtins/builtins.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 { | 391 { |
392 Node* const message_id = SmiConstant(Smi::FromInt(msg_template)); | 392 Node* const message_id = SmiConstant(Smi::FromInt(msg_template)); |
393 Node* const method_name_str = HeapConstant( | 393 Node* const method_name_str = HeapConstant( |
394 isolate()->factory()->NewStringFromAsciiChecked(method_name, TENURED)); | 394 isolate()->factory()->NewStringFromAsciiChecked(method_name, TENURED)); |
395 | 395 |
396 Callable callable = CodeFactory::ToString(isolate()); | 396 Callable callable = CodeFactory::ToString(isolate()); |
397 Node* const value_str = CallStub(callable, context, maybe_receiver); | 397 Node* const value_str = CallStub(callable, context, maybe_receiver); |
398 | 398 |
399 CallRuntime(Runtime::kThrowTypeError, context, message_id, method_name_str, | 399 CallRuntime(Runtime::kThrowTypeError, context, message_id, method_name_str, |
400 value_str); | 400 value_str); |
401 var_value_map.Bind(UndefinedConstant()); | 401 Unreachable(); |
402 Goto(&out); // Never reached. | |
403 } | 402 } |
404 | 403 |
405 Bind(&out); | 404 Bind(&out); |
406 return var_value_map.value(); | 405 return var_value_map.value(); |
407 } | 406 } |
408 | 407 |
409 Node* RegExpBuiltinsAssembler::IsInitialRegExpMap(Node* context, Node* map) { | 408 Node* RegExpBuiltinsAssembler::IsInitialRegExpMap(Node* context, Node* map) { |
410 Node* const native_context = LoadNativeContext(context); | 409 Node* const native_context = LoadNativeContext(context); |
411 Node* const regexp_fun = | 410 Node* const regexp_fun = |
412 LoadContextElement(native_context, Context::REGEXP_FUNCTION_INDEX); | 411 LoadContextElement(native_context, Context::REGEXP_FUNCTION_INDEX); |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 } | 1082 } |
1084 | 1083 |
1085 Bind(&if_isnotprototype); | 1084 Bind(&if_isnotprototype); |
1086 { | 1085 { |
1087 Node* const message_id = | 1086 Node* const message_id = |
1088 SmiConstant(Smi::FromInt(MessageTemplate::kRegExpNonRegExp)); | 1087 SmiConstant(Smi::FromInt(MessageTemplate::kRegExpNonRegExp)); |
1089 Node* const method_name_str = HeapConstant( | 1088 Node* const method_name_str = HeapConstant( |
1090 isolate->factory()->NewStringFromAsciiChecked(method_name)); | 1089 isolate->factory()->NewStringFromAsciiChecked(method_name)); |
1091 CallRuntime(Runtime::kThrowTypeError, context, message_id, | 1090 CallRuntime(Runtime::kThrowTypeError, context, message_id, |
1092 method_name_str); | 1091 method_name_str); |
1093 Return(UndefinedConstant()); // Never reached. | 1092 Unreachable(); |
1094 } | 1093 } |
1095 } | 1094 } |
1096 } | 1095 } |
1097 | 1096 |
1098 // ES6 21.2.5.4. | 1097 // ES6 21.2.5.4. |
1099 TF_BUILTIN(RegExpPrototypeGlobalGetter, RegExpBuiltinsAssembler) { | 1098 TF_BUILTIN(RegExpPrototypeGlobalGetter, RegExpBuiltinsAssembler) { |
1100 FlagGetter(JSRegExp::kGlobal, v8::Isolate::kRegExpPrototypeOldFlagGetter, | 1099 FlagGetter(JSRegExp::kGlobal, v8::Isolate::kRegExpPrototypeOldFlagGetter, |
1101 "RegExp.prototype.global"); | 1100 "RegExp.prototype.global"); |
1102 } | 1101 } |
1103 | 1102 |
(...skipping 1462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2566 Bind(&if_matched); | 2565 Bind(&if_matched); |
2567 { | 2566 { |
2568 Node* result = | 2567 Node* result = |
2569 ConstructNewResultFromMatchInfo(context, regexp, match_indices, string); | 2568 ConstructNewResultFromMatchInfo(context, regexp, match_indices, string); |
2570 Return(result); | 2569 Return(result); |
2571 } | 2570 } |
2572 } | 2571 } |
2573 | 2572 |
2574 } // namespace internal | 2573 } // namespace internal |
2575 } // namespace v8 | 2574 } // namespace v8 |
OLD | NEW |