OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/objects.h" | 5 #include "src/objects.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <iomanip> | 8 #include <iomanip> |
9 #include <memory> | 9 #include <memory> |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 9093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9104 return new_map; | 9104 return new_map; |
9105 } | 9105 } |
9106 | 9106 |
9107 Handle<Map> Map::CopyInitialMap(Handle<Map> map, int instance_size, | 9107 Handle<Map> Map::CopyInitialMap(Handle<Map> map, int instance_size, |
9108 int in_object_properties, | 9108 int in_object_properties, |
9109 int unused_property_fields) { | 9109 int unused_property_fields) { |
9110 #ifdef DEBUG | 9110 #ifdef DEBUG |
9111 Isolate* isolate = map->GetIsolate(); | 9111 Isolate* isolate = map->GetIsolate(); |
9112 // Strict function maps have Function as a constructor but the | 9112 // Strict function maps have Function as a constructor but the |
9113 // Function's initial map is a sloppy function map. Same holds for | 9113 // Function's initial map is a sloppy function map. Same holds for |
9114 // GeneratorFunction and its initial map. | 9114 // GeneratorFunction / AsyncFunction and its initial map. |
9115 Object* constructor = map->GetConstructor(); | 9115 Object* constructor = map->GetConstructor(); |
9116 DCHECK(constructor->IsJSFunction()); | 9116 DCHECK(constructor->IsJSFunction()); |
9117 DCHECK(*map == JSFunction::cast(constructor)->initial_map() || | 9117 DCHECK(*map == JSFunction::cast(constructor)->initial_map() || |
9118 *map == *isolate->strict_function_map() || | 9118 *map == *isolate->strict_function_map() || |
9119 *map == *isolate->strict_generator_function_map()); | 9119 *map == *isolate->generator_function_map() || |
| 9120 *map == *isolate->async_function_map()); |
9120 #endif | 9121 #endif |
9121 // Initial maps must always own their descriptors and it's descriptor array | 9122 // Initial maps must always own their descriptors and it's descriptor array |
9122 // does not contain descriptors that do not belong to the map. | 9123 // does not contain descriptors that do not belong to the map. |
9123 DCHECK(map->owns_descriptors()); | 9124 DCHECK(map->owns_descriptors()); |
9124 DCHECK_EQ(map->NumberOfOwnDescriptors(), | 9125 DCHECK_EQ(map->NumberOfOwnDescriptors(), |
9125 map->instance_descriptors()->number_of_descriptors()); | 9126 map->instance_descriptors()->number_of_descriptors()); |
9126 | 9127 |
9127 Handle<Map> result = RawCopy(map, instance_size); | 9128 Handle<Map> result = RawCopy(map, instance_size); |
9128 | 9129 |
9129 // Please note instance_type and instance_size are set when allocated. | 9130 // Please note instance_type and instance_size are set when allocated. |
(...skipping 11211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
20341 // depend on this. | 20342 // depend on this. |
20342 return DICTIONARY_ELEMENTS; | 20343 return DICTIONARY_ELEMENTS; |
20343 } | 20344 } |
20344 DCHECK_LE(kind, LAST_ELEMENTS_KIND); | 20345 DCHECK_LE(kind, LAST_ELEMENTS_KIND); |
20345 return kind; | 20346 return kind; |
20346 } | 20347 } |
20347 } | 20348 } |
20348 | 20349 |
20349 } // namespace internal | 20350 } // namespace internal |
20350 } // namespace v8 | 20351 } // namespace v8 |
OLD | NEW |