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 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1313 DONT_ENUM | DONT_DELETE | READ_ONLY); | 1313 DONT_ENUM | DONT_DELETE | READ_ONLY); |
1314 Handle<AccessorInfo> string_length( | 1314 Handle<AccessorInfo> string_length( |
1315 Accessors::StringLengthInfo(isolate, attribs)); | 1315 Accessors::StringLengthInfo(isolate, attribs)); |
1316 | 1316 |
1317 { // Add length. | 1317 { // Add length. |
1318 AccessorConstantDescriptor d(factory->length_string(), string_length, | 1318 AccessorConstantDescriptor d(factory->length_string(), string_length, |
1319 attribs); | 1319 attribs); |
1320 string_map->AppendDescriptor(&d); | 1320 string_map->AppendDescriptor(&d); |
1321 } | 1321 } |
1322 | 1322 |
| 1323 // Install the String.fromCharCode function. |
| 1324 SimpleInstallFunction(string_fun, "fromCharCode", |
| 1325 Builtins::kStringFromCharCode, 1, false); |
| 1326 |
1323 // Create the %StringPrototype% | 1327 // Create the %StringPrototype% |
1324 Handle<JSValue> prototype = | 1328 Handle<JSValue> prototype = |
1325 Handle<JSValue>::cast(factory->NewJSObject(string_fun, TENURED)); | 1329 Handle<JSValue>::cast(factory->NewJSObject(string_fun, TENURED)); |
1326 prototype->set_value(isolate->heap()->empty_string()); | 1330 prototype->set_value(isolate->heap()->empty_string()); |
1327 Accessors::FunctionSetPrototype(string_fun, prototype).Assert(); | 1331 Accessors::FunctionSetPrototype(string_fun, prototype).Assert(); |
1328 | 1332 |
1329 // Install the "constructor" property on the {prototype}. | 1333 // Install the "constructor" property on the {prototype}. |
1330 JSObject::AddProperty(prototype, factory->constructor_string(), string_fun, | 1334 JSObject::AddProperty(prototype, factory->constructor_string(), string_fun, |
1331 DONT_ENUM); | 1335 DONT_ENUM); |
1332 | 1336 |
(...skipping 2439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3772 } | 3776 } |
3773 | 3777 |
3774 | 3778 |
3775 // Called when the top-level V8 mutex is destroyed. | 3779 // Called when the top-level V8 mutex is destroyed. |
3776 void Bootstrapper::FreeThreadResources() { | 3780 void Bootstrapper::FreeThreadResources() { |
3777 DCHECK(!IsActive()); | 3781 DCHECK(!IsActive()); |
3778 } | 3782 } |
3779 | 3783 |
3780 } // namespace internal | 3784 } // namespace internal |
3781 } // namespace v8 | 3785 } // namespace v8 |
OLD | NEW |