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 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1285 PropertyAttributes attribs = static_cast<PropertyAttributes>( | 1285 PropertyAttributes attribs = static_cast<PropertyAttributes>( |
1286 DONT_ENUM | DONT_DELETE | READ_ONLY); | 1286 DONT_ENUM | DONT_DELETE | READ_ONLY); |
1287 Handle<AccessorInfo> string_length( | 1287 Handle<AccessorInfo> string_length( |
1288 Accessors::StringLengthInfo(isolate, attribs)); | 1288 Accessors::StringLengthInfo(isolate, attribs)); |
1289 | 1289 |
1290 { // Add length. | 1290 { // Add length. |
1291 AccessorConstantDescriptor d(factory->length_string(), string_length, | 1291 AccessorConstantDescriptor d(factory->length_string(), string_length, |
1292 attribs); | 1292 attribs); |
1293 string_map->AppendDescriptor(&d); | 1293 string_map->AppendDescriptor(&d); |
1294 } | 1294 } |
| 1295 |
| 1296 // Install the String.fromCharCode function. |
| 1297 SimpleInstallFunction(string_fun, "fromCharCode", |
| 1298 Builtins::kStringFromCharCode, 1, false); |
1295 } | 1299 } |
1296 | 1300 |
1297 { | 1301 { |
1298 // --- S y m b o l --- | 1302 // --- S y m b o l --- |
1299 Handle<JSObject> prototype = | 1303 Handle<JSObject> prototype = |
1300 factory->NewJSObject(isolate->object_function(), TENURED); | 1304 factory->NewJSObject(isolate->object_function(), TENURED); |
1301 Handle<JSFunction> symbol_fun = | 1305 Handle<JSFunction> symbol_fun = |
1302 InstallFunction(global, "Symbol", JS_VALUE_TYPE, JSValue::kSize, | 1306 InstallFunction(global, "Symbol", JS_VALUE_TYPE, JSValue::kSize, |
1303 prototype, Builtins::kSymbolConstructor); | 1307 prototype, Builtins::kSymbolConstructor); |
1304 symbol_fun->shared()->set_construct_stub( | 1308 symbol_fun->shared()->set_construct_stub( |
(...skipping 2368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3673 } | 3677 } |
3674 | 3678 |
3675 | 3679 |
3676 // Called when the top-level V8 mutex is destroyed. | 3680 // Called when the top-level V8 mutex is destroyed. |
3677 void Bootstrapper::FreeThreadResources() { | 3681 void Bootstrapper::FreeThreadResources() { |
3678 DCHECK(!IsActive()); | 3682 DCHECK(!IsActive()); |
3679 } | 3683 } |
3680 | 3684 |
3681 } // namespace internal | 3685 } // namespace internal |
3682 } // namespace v8 | 3686 } // namespace v8 |
OLD | NEW |