OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
962 PropertyAttributes final = | 962 PropertyAttributes final = |
963 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); | 963 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); |
964 Handle<DescriptorArray> descriptors = factory->NewDescriptorArray(0, 5); | 964 Handle<DescriptorArray> descriptors = factory->NewDescriptorArray(0, 5); |
965 DescriptorArray::WhitenessWitness witness(*descriptors); | 965 DescriptorArray::WhitenessWitness witness(*descriptors); |
966 initial_map->set_instance_descriptors(*descriptors); | 966 initial_map->set_instance_descriptors(*descriptors); |
967 | 967 |
968 { | 968 { |
969 // ECMA-262, section 15.10.7.1. | 969 // ECMA-262, section 15.10.7.1. |
970 FieldDescriptor field(heap->source_string(), | 970 FieldDescriptor field(heap->source_string(), |
971 JSRegExp::kSourceFieldIndex, | 971 JSRegExp::kSourceFieldIndex, |
972 final); | 972 final, |
| 973 Representation::Tagged()); |
973 initial_map->AppendDescriptor(&field, witness); | 974 initial_map->AppendDescriptor(&field, witness); |
974 } | 975 } |
975 { | 976 { |
976 // ECMA-262, section 15.10.7.2. | 977 // ECMA-262, section 15.10.7.2. |
977 FieldDescriptor field(heap->global_string(), | 978 FieldDescriptor field(heap->global_string(), |
978 JSRegExp::kGlobalFieldIndex, | 979 JSRegExp::kGlobalFieldIndex, |
979 final); | 980 final, |
| 981 Representation::Tagged()); |
980 initial_map->AppendDescriptor(&field, witness); | 982 initial_map->AppendDescriptor(&field, witness); |
981 } | 983 } |
982 { | 984 { |
983 // ECMA-262, section 15.10.7.3. | 985 // ECMA-262, section 15.10.7.3. |
984 FieldDescriptor field(heap->ignore_case_string(), | 986 FieldDescriptor field(heap->ignore_case_string(), |
985 JSRegExp::kIgnoreCaseFieldIndex, | 987 JSRegExp::kIgnoreCaseFieldIndex, |
986 final); | 988 final, |
| 989 Representation::Tagged()); |
987 initial_map->AppendDescriptor(&field, witness); | 990 initial_map->AppendDescriptor(&field, witness); |
988 } | 991 } |
989 { | 992 { |
990 // ECMA-262, section 15.10.7.4. | 993 // ECMA-262, section 15.10.7.4. |
991 FieldDescriptor field(heap->multiline_string(), | 994 FieldDescriptor field(heap->multiline_string(), |
992 JSRegExp::kMultilineFieldIndex, | 995 JSRegExp::kMultilineFieldIndex, |
993 final); | 996 final, |
| 997 Representation::Tagged()); |
994 initial_map->AppendDescriptor(&field, witness); | 998 initial_map->AppendDescriptor(&field, witness); |
995 } | 999 } |
996 { | 1000 { |
997 // ECMA-262, section 15.10.7.5. | 1001 // ECMA-262, section 15.10.7.5. |
998 PropertyAttributes writable = | 1002 PropertyAttributes writable = |
999 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE); | 1003 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE); |
1000 FieldDescriptor field(heap->last_index_string(), | 1004 FieldDescriptor field(heap->last_index_string(), |
1001 JSRegExp::kLastIndexFieldIndex, | 1005 JSRegExp::kLastIndexFieldIndex, |
1002 writable); | 1006 writable, |
| 1007 Representation::Tagged()); |
1003 initial_map->AppendDescriptor(&field, witness); | 1008 initial_map->AppendDescriptor(&field, witness); |
1004 } | 1009 } |
1005 | 1010 |
1006 initial_map->set_inobject_properties(5); | 1011 initial_map->set_inobject_properties(5); |
1007 initial_map->set_pre_allocated_property_fields(5); | 1012 initial_map->set_pre_allocated_property_fields(5); |
1008 initial_map->set_unused_property_fields(0); | 1013 initial_map->set_unused_property_fields(0); |
1009 initial_map->set_instance_size( | 1014 initial_map->set_instance_size( |
1010 initial_map->instance_size() + 5 * kPointerSize); | 1015 initial_map->instance_size() + 5 * kPointerSize); |
1011 initial_map->set_visitor_id(StaticVisitorBase::GetVisitorId(*initial_map)); | 1016 initial_map->set_visitor_id(StaticVisitorBase::GetVisitorId(*initial_map)); |
1012 | 1017 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1144 | 1149 |
1145 // Create the map. Allocate one in-object field for length. | 1150 // Create the map. Allocate one in-object field for length. |
1146 Handle<Map> map = factory->NewMap(JS_OBJECT_TYPE, | 1151 Handle<Map> map = factory->NewMap(JS_OBJECT_TYPE, |
1147 Heap::kArgumentsObjectSizeStrict); | 1152 Heap::kArgumentsObjectSizeStrict); |
1148 // Create the descriptor array for the arguments object. | 1153 // Create the descriptor array for the arguments object. |
1149 Handle<DescriptorArray> descriptors = factory->NewDescriptorArray(0, 3); | 1154 Handle<DescriptorArray> descriptors = factory->NewDescriptorArray(0, 3); |
1150 DescriptorArray::WhitenessWitness witness(*descriptors); | 1155 DescriptorArray::WhitenessWitness witness(*descriptors); |
1151 map->set_instance_descriptors(*descriptors); | 1156 map->set_instance_descriptors(*descriptors); |
1152 | 1157 |
1153 { // length | 1158 { // length |
1154 FieldDescriptor d(*factory->length_string(), 0, DONT_ENUM); | 1159 FieldDescriptor d( |
| 1160 *factory->length_string(), 0, DONT_ENUM, Representation::Tagged()); |
1155 map->AppendDescriptor(&d, witness); | 1161 map->AppendDescriptor(&d, witness); |
1156 } | 1162 } |
1157 { // callee | 1163 { // callee |
1158 CallbacksDescriptor d(*factory->callee_string(), | 1164 CallbacksDescriptor d(*factory->callee_string(), |
1159 *callee, | 1165 *callee, |
1160 attributes); | 1166 attributes); |
1161 map->AppendDescriptor(&d, witness); | 1167 map->AppendDescriptor(&d, witness); |
1162 } | 1168 } |
1163 { // caller | 1169 { // caller |
1164 CallbacksDescriptor d(*factory->caller_string(), | 1170 CallbacksDescriptor d(*factory->caller_string(), |
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1910 length, array_function->initial_map()); | 1916 length, array_function->initial_map()); |
1911 ASSERT(old != DescriptorArray::kNotFound); | 1917 ASSERT(old != DescriptorArray::kNotFound); |
1912 CallbacksDescriptor desc(length, | 1918 CallbacksDescriptor desc(length, |
1913 array_descriptors->GetValue(old), | 1919 array_descriptors->GetValue(old), |
1914 array_descriptors->GetDetails(old).attributes()); | 1920 array_descriptors->GetDetails(old).attributes()); |
1915 initial_map->AppendDescriptor(&desc, witness); | 1921 initial_map->AppendDescriptor(&desc, witness); |
1916 } | 1922 } |
1917 { | 1923 { |
1918 FieldDescriptor index_field(heap()->index_string(), | 1924 FieldDescriptor index_field(heap()->index_string(), |
1919 JSRegExpResult::kIndexIndex, | 1925 JSRegExpResult::kIndexIndex, |
1920 NONE); | 1926 NONE, |
| 1927 Representation::Tagged()); |
1921 initial_map->AppendDescriptor(&index_field, witness); | 1928 initial_map->AppendDescriptor(&index_field, witness); |
1922 } | 1929 } |
1923 | 1930 |
1924 { | 1931 { |
1925 FieldDescriptor input_field(heap()->input_string(), | 1932 FieldDescriptor input_field(heap()->input_string(), |
1926 JSRegExpResult::kInputIndex, | 1933 JSRegExpResult::kInputIndex, |
1927 NONE); | 1934 NONE, |
| 1935 Representation::Tagged()); |
1928 initial_map->AppendDescriptor(&input_field, witness); | 1936 initial_map->AppendDescriptor(&input_field, witness); |
1929 } | 1937 } |
1930 | 1938 |
1931 initial_map->set_inobject_properties(2); | 1939 initial_map->set_inobject_properties(2); |
1932 initial_map->set_pre_allocated_property_fields(2); | 1940 initial_map->set_pre_allocated_property_fields(2); |
1933 initial_map->set_unused_property_fields(0); | 1941 initial_map->set_unused_property_fields(0); |
1934 | 1942 |
1935 native_context()->set_regexp_result_map(*initial_map); | 1943 native_context()->set_regexp_result_map(*initial_map); |
1936 } | 1944 } |
1937 | 1945 |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2374 to->LocalLookup(descs->GetKey(i), &result); | 2382 to->LocalLookup(descs->GetKey(i), &result); |
2375 // If the property is already there we skip it | 2383 // If the property is already there we skip it |
2376 if (result.IsFound()) continue; | 2384 if (result.IsFound()) continue; |
2377 HandleScope inner(isolate()); | 2385 HandleScope inner(isolate()); |
2378 ASSERT(!to->HasFastProperties()); | 2386 ASSERT(!to->HasFastProperties()); |
2379 // Add to dictionary. | 2387 // Add to dictionary. |
2380 Handle<Name> key = Handle<Name>(descs->GetKey(i)); | 2388 Handle<Name> key = Handle<Name>(descs->GetKey(i)); |
2381 Handle<Object> callbacks(descs->GetCallbacksObject(i), isolate()); | 2389 Handle<Object> callbacks(descs->GetCallbacksObject(i), isolate()); |
2382 PropertyDetails d = PropertyDetails(details.attributes(), | 2390 PropertyDetails d = PropertyDetails(details.attributes(), |
2383 CALLBACKS, | 2391 CALLBACKS, |
| 2392 Representation::Tagged(), |
2384 details.descriptor_index()); | 2393 details.descriptor_index()); |
2385 JSObject::SetNormalizedProperty(to, key, callbacks, d); | 2394 JSObject::SetNormalizedProperty(to, key, callbacks, d); |
2386 break; | 2395 break; |
2387 } | 2396 } |
2388 case NORMAL: | 2397 case NORMAL: |
2389 // Do not occur since the from object has fast properties. | 2398 // Do not occur since the from object has fast properties. |
2390 case HANDLER: | 2399 case HANDLER: |
2391 case INTERCEPTOR: | 2400 case INTERCEPTOR: |
2392 case TRANSITION: | 2401 case TRANSITION: |
2393 case NONEXISTENT: | 2402 case NONEXISTENT: |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2554 return from + sizeof(NestingCounterType); | 2563 return from + sizeof(NestingCounterType); |
2555 } | 2564 } |
2556 | 2565 |
2557 | 2566 |
2558 // Called when the top-level V8 mutex is destroyed. | 2567 // Called when the top-level V8 mutex is destroyed. |
2559 void Bootstrapper::FreeThreadResources() { | 2568 void Bootstrapper::FreeThreadResources() { |
2560 ASSERT(!IsActive()); | 2569 ASSERT(!IsActive()); |
2561 } | 2570 } |
2562 | 2571 |
2563 } } // namespace v8::internal | 2572 } } // namespace v8::internal |
OLD | NEW |