OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
844 if (result->IsMap()) return Handle<Map>::cast(result); | 844 if (result->IsMap()) return Handle<Map>::cast(result); |
845 // Create a new map and add it to the cache. | 845 // Create a new map and add it to the cache. |
846 Handle<Map> map = | 846 Handle<Map> map = |
847 CopyMap(Handle<Map>(context->object_function()->initial_map()), | 847 CopyMap(Handle<Map>(context->object_function()->initial_map()), |
848 keys->length()); | 848 keys->length()); |
849 AddToMapCache(context, keys, map); | 849 AddToMapCache(context, keys, map); |
850 return Handle<Map>(map); | 850 return Handle<Map>(map); |
851 } | 851 } |
852 | 852 |
853 | 853 |
854 void Factory::SetRegExpData(Handle<JSRegExp> regexp, | 854 void Factory::SetRegExpAtomData(Handle<JSRegExp> regexp, |
855 JSRegExp::Type type, | 855 JSRegExp::Type type, |
856 Handle<String> source, | 856 Handle<String> source, |
857 JSRegExp::Flags flags, | 857 JSRegExp::Flags flags, |
858 Handle<Object> data) { | 858 Handle<Object> data) { |
859 Handle<FixedArray> store = NewFixedArray(JSRegExp::kDataSize); | 859 Handle<FixedArray> store = NewFixedArray(JSRegExp::kAtomDataSize); |
| 860 |
860 store->set(JSRegExp::kTagIndex, Smi::FromInt(type)); | 861 store->set(JSRegExp::kTagIndex, Smi::FromInt(type)); |
861 store->set(JSRegExp::kSourceIndex, *source); | 862 store->set(JSRegExp::kSourceIndex, *source); |
862 store->set(JSRegExp::kFlagsIndex, Smi::FromInt(flags.value())); | 863 store->set(JSRegExp::kFlagsIndex, Smi::FromInt(flags.value())); |
863 store->set(JSRegExp::kAtomPatternIndex, *data); | 864 store->set(JSRegExp::kAtomPatternIndex, *data); |
864 regexp->set_data(*store); | 865 regexp->set_data(*store); |
865 } | 866 } |
866 | 867 |
| 868 void Factory::SetRegExpIrregexpData(Handle<JSRegExp> regexp, |
| 869 JSRegExp::Type type, |
| 870 Handle<String> source, |
| 871 JSRegExp::Flags flags, |
| 872 int capture_count) { |
| 873 Handle<FixedArray> store = NewFixedArray(JSRegExp::kIrregexpDataSize); |
| 874 |
| 875 store->set(JSRegExp::kTagIndex, Smi::FromInt(type)); |
| 876 store->set(JSRegExp::kSourceIndex, *source); |
| 877 store->set(JSRegExp::kFlagsIndex, Smi::FromInt(flags.value())); |
| 878 store->set(JSRegExp::kIrregexpASCIICodeIndex, Heap::the_hole_value()); |
| 879 store->set(JSRegExp::kIrregexpUC16CodeIndex, Heap::the_hole_value()); |
| 880 store->set(JSRegExp::kIrregexpMaxRegisterCountIndex, Smi::FromInt(0)); |
| 881 store->set(JSRegExp::kIrregexpCaptureCountIndex, |
| 882 Smi::FromInt(capture_count)); |
| 883 regexp->set_data(*store); |
| 884 } |
| 885 |
| 886 |
867 | 887 |
868 void Factory::ConfigureInstance(Handle<FunctionTemplateInfo> desc, | 888 void Factory::ConfigureInstance(Handle<FunctionTemplateInfo> desc, |
869 Handle<JSObject> instance, | 889 Handle<JSObject> instance, |
870 bool* pending_exception) { | 890 bool* pending_exception) { |
871 // Configure the instance by adding the properties specified by the | 891 // Configure the instance by adding the properties specified by the |
872 // instance template. | 892 // instance template. |
873 Handle<Object> instance_template = Handle<Object>(desc->instance_template()); | 893 Handle<Object> instance_template = Handle<Object>(desc->instance_template()); |
874 if (!instance_template->IsUndefined()) { | 894 if (!instance_template->IsUndefined()) { |
875 Execution::ConfigureInstance(instance, | 895 Execution::ConfigureInstance(instance, |
876 instance_template, | 896 instance_template, |
877 pending_exception); | 897 pending_exception); |
878 } else { | 898 } else { |
879 *pending_exception = false; | 899 *pending_exception = false; |
880 } | 900 } |
881 } | 901 } |
882 | 902 |
883 | 903 |
884 } } // namespace v8::internal | 904 } } // namespace v8::internal |
OLD | NEW |