Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(899)

Side by Side Diff: src/bootstrapper.cc

Issue 2004733002: [builtins] Migrate String.fromCharCode to C++. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/builtins.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | src/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698