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

Side by Side Diff: src/bootstrapper.cc

Issue 1344893002: [builtins] Unify the String constructor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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 | « src/arm64/builtins-arm64.cc ('k') | 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/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
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
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
OLDNEW
« no previous file with comments | « src/arm64/builtins-arm64.cc ('k') | src/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698