OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/jsregexp-inl.h" | 8 #include "src/jsregexp-inl.h" |
9 #include "src/jsregexp.h" | 9 #include "src/jsregexp.h" |
10 #include "src/runtime/runtime-utils.h" | 10 #include "src/runtime/runtime-utils.h" |
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
859 isolate, NewSyntaxError("invalid_regexp_flags", args)); | 859 isolate, NewSyntaxError("invalid_regexp_flags", args)); |
860 } | 860 } |
861 | 861 |
862 Handle<Object> global = factory->ToBoolean(flags.is_global()); | 862 Handle<Object> global = factory->ToBoolean(flags.is_global()); |
863 Handle<Object> ignore_case = factory->ToBoolean(flags.is_ignore_case()); | 863 Handle<Object> ignore_case = factory->ToBoolean(flags.is_ignore_case()); |
864 Handle<Object> multiline = factory->ToBoolean(flags.is_multiline()); | 864 Handle<Object> multiline = factory->ToBoolean(flags.is_multiline()); |
865 Handle<Object> sticky = factory->ToBoolean(flags.is_sticky()); | 865 Handle<Object> sticky = factory->ToBoolean(flags.is_sticky()); |
866 Handle<Object> unicode = factory->ToBoolean(flags.is_unicode()); | 866 Handle<Object> unicode = factory->ToBoolean(flags.is_unicode()); |
867 | 867 |
868 Map* map = regexp->map(); | 868 Map* map = regexp->map(); |
869 Object* constructor = map->constructor(); | 869 Object* constructor = map->GetConstructor(); |
870 if (!FLAG_harmony_regexps && !FLAG_harmony_unicode_regexps && | 870 if (!FLAG_harmony_regexps && !FLAG_harmony_unicode_regexps && |
871 constructor->IsJSFunction() && | 871 constructor->IsJSFunction() && |
872 JSFunction::cast(constructor)->initial_map() == map) { | 872 JSFunction::cast(constructor)->initial_map() == map) { |
873 // If we still have the original map, set in-object properties directly. | 873 // If we still have the original map, set in-object properties directly. |
874 // Both true and false are immovable immortal objects so no need for write | 874 // Both true and false are immovable immortal objects so no need for write |
875 // barrier. | 875 // barrier. |
876 regexp->InObjectPropertyAtPut(JSRegExp::kGlobalFieldIndex, *global, | 876 regexp->InObjectPropertyAtPut(JSRegExp::kGlobalFieldIndex, *global, |
877 SKIP_WRITE_BARRIER); | 877 SKIP_WRITE_BARRIER); |
878 regexp->InObjectPropertyAtPut(JSRegExp::kIgnoreCaseFieldIndex, *ignore_case, | 878 regexp->InObjectPropertyAtPut(JSRegExp::kIgnoreCaseFieldIndex, *ignore_case, |
879 SKIP_WRITE_BARRIER); | 879 SKIP_WRITE_BARRIER); |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1123 | 1123 |
1124 | 1124 |
1125 RUNTIME_FUNCTION(RuntimeReference_IsRegExp) { | 1125 RUNTIME_FUNCTION(RuntimeReference_IsRegExp) { |
1126 SealHandleScope shs(isolate); | 1126 SealHandleScope shs(isolate); |
1127 DCHECK(args.length() == 1); | 1127 DCHECK(args.length() == 1); |
1128 CONVERT_ARG_CHECKED(Object, obj, 0); | 1128 CONVERT_ARG_CHECKED(Object, obj, 0); |
1129 return isolate->heap()->ToBoolean(obj->IsJSRegExp()); | 1129 return isolate->heap()->ToBoolean(obj->IsJSRegExp()); |
1130 } | 1130 } |
1131 } | 1131 } |
1132 } // namespace v8::internal | 1132 } // namespace v8::internal |
OLD | NEW |