| 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/bootstrapper.h" | 5 #include "src/bootstrapper.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/extensions/externalize-string-extension.h" | 10 #include "src/extensions/externalize-string-extension.h" |
| (...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 818 native_context()->set_generator_object_prototype_map( | 818 native_context()->set_generator_object_prototype_map( |
| 819 *generator_object_prototype_map); | 819 *generator_object_prototype_map); |
| 820 } | 820 } |
| 821 | 821 |
| 822 | 822 |
| 823 static void ReplaceAccessors(Handle<Map> map, | 823 static void ReplaceAccessors(Handle<Map> map, |
| 824 Handle<String> name, | 824 Handle<String> name, |
| 825 PropertyAttributes attributes, | 825 PropertyAttributes attributes, |
| 826 Handle<AccessorPair> accessor_pair) { | 826 Handle<AccessorPair> accessor_pair) { |
| 827 DescriptorArray* descriptors = map->instance_descriptors(); | 827 DescriptorArray* descriptors = map->instance_descriptors(); |
| 828 int idx = descriptors->SearchWithCache(*name, *map); | 828 int idx = descriptors->SearchWithCache(map->GetIsolate(), *name, *map); |
| 829 AccessorConstantDescriptor descriptor(name, accessor_pair, attributes); | 829 AccessorConstantDescriptor descriptor(name, accessor_pair, attributes); |
| 830 descriptors->Replace(idx, &descriptor); | 830 descriptors->Replace(idx, &descriptor); |
| 831 } | 831 } |
| 832 | 832 |
| 833 | 833 |
| 834 void Genesis::AddRestrictedFunctionProperties(Handle<Map> map) { | 834 void Genesis::AddRestrictedFunctionProperties(Handle<Map> map) { |
| 835 PropertyAttributes rw_attribs = static_cast<PropertyAttributes>(DONT_ENUM); | 835 PropertyAttributes rw_attribs = static_cast<PropertyAttributes>(DONT_ENUM); |
| 836 Handle<JSFunction> thrower = GetRestrictedFunctionPropertiesThrower(); | 836 Handle<JSFunction> thrower = GetRestrictedFunctionPropertiesThrower(); |
| 837 Handle<AccessorPair> accessors = factory()->NewAccessorPair(); | 837 Handle<AccessorPair> accessors = factory()->NewAccessorPair(); |
| 838 accessors->set_getter(*thrower); | 838 accessors->set_getter(*thrower); |
| (...skipping 2057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2896 | 2896 |
| 2897 // Update map with length accessor from Array and add "index" and "input". | 2897 // Update map with length accessor from Array and add "index" and "input". |
| 2898 Map::EnsureDescriptorSlack(initial_map, 3); | 2898 Map::EnsureDescriptorSlack(initial_map, 3); |
| 2899 | 2899 |
| 2900 { | 2900 { |
| 2901 JSFunction* array_function = native_context()->array_function(); | 2901 JSFunction* array_function = native_context()->array_function(); |
| 2902 Handle<DescriptorArray> array_descriptors( | 2902 Handle<DescriptorArray> array_descriptors( |
| 2903 array_function->initial_map()->instance_descriptors()); | 2903 array_function->initial_map()->instance_descriptors()); |
| 2904 Handle<String> length = factory()->length_string(); | 2904 Handle<String> length = factory()->length_string(); |
| 2905 int old = array_descriptors->SearchWithCache( | 2905 int old = array_descriptors->SearchWithCache( |
| 2906 *length, array_function->initial_map()); | 2906 isolate(), *length, array_function->initial_map()); |
| 2907 DCHECK(old != DescriptorArray::kNotFound); | 2907 DCHECK(old != DescriptorArray::kNotFound); |
| 2908 AccessorConstantDescriptor desc( | 2908 AccessorConstantDescriptor desc( |
| 2909 length, handle(array_descriptors->GetValue(old), isolate()), | 2909 length, handle(array_descriptors->GetValue(old), isolate()), |
| 2910 array_descriptors->GetDetails(old).attributes()); | 2910 array_descriptors->GetDetails(old).attributes()); |
| 2911 initial_map->AppendDescriptor(&desc); | 2911 initial_map->AppendDescriptor(&desc); |
| 2912 } | 2912 } |
| 2913 { | 2913 { |
| 2914 DataDescriptor index_field(factory()->index_string(), | 2914 DataDescriptor index_field(factory()->index_string(), |
| 2915 JSRegExpResult::kIndexIndex, NONE, | 2915 JSRegExpResult::kIndexIndex, NONE, |
| 2916 Representation::Tagged()); | 2916 Representation::Tagged()); |
| (...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3672 } | 3672 } |
| 3673 | 3673 |
| 3674 | 3674 |
| 3675 // Called when the top-level V8 mutex is destroyed. | 3675 // Called when the top-level V8 mutex is destroyed. |
| 3676 void Bootstrapper::FreeThreadResources() { | 3676 void Bootstrapper::FreeThreadResources() { |
| 3677 DCHECK(!IsActive()); | 3677 DCHECK(!IsActive()); |
| 3678 } | 3678 } |
| 3679 | 3679 |
| 3680 } // namespace internal | 3680 } // namespace internal |
| 3681 } // namespace v8 | 3681 } // namespace v8 |
| OLD | NEW |