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 "bootstrapper.h" | 5 #include "bootstrapper.h" |
6 | 6 |
7 #include "accessors.h" | 7 #include "accessors.h" |
8 #include "isolate-inl.h" | 8 #include "isolate-inl.h" |
9 #include "natives.h" | 9 #include "natives.h" |
10 #include "snapshot.h" | 10 #include "snapshot.h" |
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
913 string_fun->shared()->set_construct_stub( | 913 string_fun->shared()->set_construct_stub( |
914 isolate->builtins()->builtin(Builtins::kStringConstructCode)); | 914 isolate->builtins()->builtin(Builtins::kStringConstructCode)); |
915 native_context()->set_string_function(*string_fun); | 915 native_context()->set_string_function(*string_fun); |
916 | 916 |
917 Handle<Map> string_map = | 917 Handle<Map> string_map = |
918 Handle<Map>(native_context()->string_function()->initial_map()); | 918 Handle<Map>(native_context()->string_function()->initial_map()); |
919 Handle<DescriptorArray> string_descriptors( | 919 Handle<DescriptorArray> string_descriptors( |
920 factory->NewDescriptorArray(0, 1)); | 920 factory->NewDescriptorArray(0, 1)); |
921 DescriptorArray::WhitenessWitness witness(*string_descriptors); | 921 DescriptorArray::WhitenessWitness witness(*string_descriptors); |
922 | 922 |
923 Handle<Foreign> string_length( | |
924 factory->NewForeign(&Accessors::StringLength)); | |
925 PropertyAttributes attribs = static_cast<PropertyAttributes>( | 923 PropertyAttributes attribs = static_cast<PropertyAttributes>( |
926 DONT_ENUM | DONT_DELETE | READ_ONLY); | 924 DONT_ENUM | DONT_DELETE | READ_ONLY); |
| 925 Handle<AccessorInfo> string_length( |
| 926 Accessors::StringLengthInfo(isolate, attribs)); |
927 string_map->set_instance_descriptors(*string_descriptors); | 927 string_map->set_instance_descriptors(*string_descriptors); |
928 | 928 |
929 { // Add length. | 929 { // Add length. |
930 CallbacksDescriptor d(*factory->length_string(), *string_length, attribs); | 930 CallbacksDescriptor d(*factory->length_string(), *string_length, attribs); |
931 string_map->AppendDescriptor(&d, witness); | 931 string_map->AppendDescriptor(&d, witness); |
932 } | 932 } |
933 } | 933 } |
934 | 934 |
935 { // --- D a t e --- | 935 { // --- D a t e --- |
936 // Builtin functions for Date.prototype. | 936 // Builtin functions for Date.prototype. |
(...skipping 1780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2717 return from + sizeof(NestingCounterType); | 2717 return from + sizeof(NestingCounterType); |
2718 } | 2718 } |
2719 | 2719 |
2720 | 2720 |
2721 // Called when the top-level V8 mutex is destroyed. | 2721 // Called when the top-level V8 mutex is destroyed. |
2722 void Bootstrapper::FreeThreadResources() { | 2722 void Bootstrapper::FreeThreadResources() { |
2723 ASSERT(!IsActive()); | 2723 ASSERT(!IsActive()); |
2724 } | 2724 } |
2725 | 2725 |
2726 } } // namespace v8::internal | 2726 } } // namespace v8::internal |
OLD | NEW |