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/base/utils/random-number-generator.h" | 9 #include "src/base/utils/random-number-generator.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1111 | 1111 |
1112 { // --- B o o l e a n --- | 1112 { // --- B o o l e a n --- |
1113 Handle<JSFunction> boolean_fun = | 1113 Handle<JSFunction> boolean_fun = |
1114 InstallFunction(global, "Boolean", JS_VALUE_TYPE, JSValue::kSize, | 1114 InstallFunction(global, "Boolean", JS_VALUE_TYPE, JSValue::kSize, |
1115 isolate->initial_object_prototype(), | 1115 isolate->initial_object_prototype(), |
1116 Builtins::kIllegal); | 1116 Builtins::kIllegal); |
1117 native_context()->set_boolean_function(*boolean_fun); | 1117 native_context()->set_boolean_function(*boolean_fun); |
1118 } | 1118 } |
1119 | 1119 |
1120 { // --- S t r i n g --- | 1120 { // --- S t r i n g --- |
1121 Handle<JSFunction> string_fun = | 1121 Handle<JSFunction> string_fun = InstallFunction( |
1122 InstallFunction(global, "String", JS_VALUE_TYPE, JSValue::kSize, | 1122 global, "String", JS_VALUE_TYPE, JSValue::kSize, |
1123 isolate->initial_object_prototype(), | 1123 isolate->initial_object_prototype(), Builtins::kStringConstructor); |
1124 Builtins::kIllegal); | 1124 string_fun->shared()->set_construct_stub(isolate->builtins()->builtin( |
1125 string_fun->shared()->set_construct_stub( | 1125 Builtins::kStringConstructor_ConstructStub)); |
1126 isolate->builtins()->builtin(Builtins::kStringConstructCode)); | 1126 string_fun->shared()->DontAdaptArguments(); |
| 1127 string_fun->shared()->set_length(1); |
1127 native_context()->set_string_function(*string_fun); | 1128 native_context()->set_string_function(*string_fun); |
1128 | 1129 |
1129 Handle<Map> string_map = | 1130 Handle<Map> string_map = |
1130 Handle<Map>(native_context()->string_function()->initial_map()); | 1131 Handle<Map>(native_context()->string_function()->initial_map()); |
1131 Map::EnsureDescriptorSlack(string_map, 1); | 1132 Map::EnsureDescriptorSlack(string_map, 1); |
1132 | 1133 |
1133 PropertyAttributes attribs = static_cast<PropertyAttributes>( | 1134 PropertyAttributes attribs = static_cast<PropertyAttributes>( |
1134 DONT_ENUM | DONT_DELETE | READ_ONLY); | 1135 DONT_ENUM | DONT_DELETE | READ_ONLY); |
1135 Handle<AccessorInfo> string_length( | 1136 Handle<AccessorInfo> string_length( |
1136 Accessors::StringLengthInfo(isolate, attribs)); | 1137 Accessors::StringLengthInfo(isolate, attribs)); |
(...skipping 2088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3225 } | 3226 } |
3226 | 3227 |
3227 | 3228 |
3228 // Called when the top-level V8 mutex is destroyed. | 3229 // Called when the top-level V8 mutex is destroyed. |
3229 void Bootstrapper::FreeThreadResources() { | 3230 void Bootstrapper::FreeThreadResources() { |
3230 DCHECK(!IsActive()); | 3231 DCHECK(!IsActive()); |
3231 } | 3232 } |
3232 | 3233 |
3233 } // namespace internal | 3234 } // namespace internal |
3234 } // namespace v8 | 3235 } // namespace v8 |
OLD | NEW |