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

Side by Side Diff: src/bootstrapper.cc

Issue 2851063002: Revert of [turbofan] Avoid going through ArgumentsAdaptorTrampoline for CSA/C++ builtins (Closed)
Patch Set: Created 3 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/builtins-array-gen.cc » ('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/ieee754.h" 9 #include "src/base/ieee754.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 170
171 #define DECLARE_FEATURE_INITIALIZATION(id, descr) \ 171 #define DECLARE_FEATURE_INITIALIZATION(id, descr) \
172 void InitializeGlobal_##id(); 172 void InitializeGlobal_##id();
173 173
174 HARMONY_INPROGRESS(DECLARE_FEATURE_INITIALIZATION) 174 HARMONY_INPROGRESS(DECLARE_FEATURE_INITIALIZATION)
175 HARMONY_STAGED(DECLARE_FEATURE_INITIALIZATION) 175 HARMONY_STAGED(DECLARE_FEATURE_INITIALIZATION)
176 HARMONY_SHIPPING(DECLARE_FEATURE_INITIALIZATION) 176 HARMONY_SHIPPING(DECLARE_FEATURE_INITIALIZATION)
177 #undef DECLARE_FEATURE_INITIALIZATION 177 #undef DECLARE_FEATURE_INITIALIZATION
178 178
179 void InstallOneBuiltinFunction(Handle<Object> prototype, const char* method, 179 void InstallOneBuiltinFunction(Handle<Object> prototype, const char* method,
180 Builtins::Name name, 180 Builtins::Name name);
181 int internal_formal_parameter_count);
182 void InitializeGlobal_experimental_fast_array_builtins(); 181 void InitializeGlobal_experimental_fast_array_builtins();
183 182
184 Handle<JSFunction> InstallArrayBuffer(Handle<JSObject> target, 183 Handle<JSFunction> InstallArrayBuffer(Handle<JSObject> target,
185 const char* name, 184 const char* name,
186 Builtins::Name call_byteLength, 185 Builtins::Name call_byteLength,
187 BuiltinFunctionId byteLength_id, 186 BuiltinFunctionId byteLength_id,
188 Builtins::Name call_slice); 187 Builtins::Name call_slice);
189 Handle<JSFunction> InstallInternalArray(Handle<JSObject> target, 188 Handle<JSFunction> InstallInternalArray(Handle<JSObject> target,
190 const char* name, 189 const char* name,
191 ElementsKind elements_kind); 190 ElementsKind elements_kind);
(...skipping 3664 matching lines...) Expand 10 before | Expand all | Expand 10 after
3856 Handle<JSObject> symbol = Handle<JSObject>::cast( 3855 Handle<JSObject> symbol = Handle<JSObject>::cast(
3857 JSObject::GetProperty(global, symbol_string).ToHandleChecked()); 3856 JSObject::GetProperty(global, symbol_string).ToHandleChecked());
3858 Handle<String> name_string = factory->InternalizeUtf8String(name); 3857 Handle<String> name_string = factory->InternalizeUtf8String(name);
3859 PropertyAttributes attributes = 3858 PropertyAttributes attributes =
3860 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); 3859 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY);
3861 JSObject::AddProperty(symbol, name_string, value, attributes); 3860 JSObject::AddProperty(symbol, name_string, value, attributes);
3862 } 3861 }
3863 3862
3864 void Genesis::InstallOneBuiltinFunction(Handle<Object> prototype, 3863 void Genesis::InstallOneBuiltinFunction(Handle<Object> prototype,
3865 const char* method_name, 3864 const char* method_name,
3866 Builtins::Name builtin_name, 3865 Builtins::Name builtin_name) {
3867 int internal_formal_parameter_count) {
3868 LookupIterator it( 3866 LookupIterator it(
3869 prototype, isolate()->factory()->NewStringFromAsciiChecked(method_name), 3867 prototype, isolate()->factory()->NewStringFromAsciiChecked(method_name),
3870 LookupIterator::OWN_SKIP_INTERCEPTOR); 3868 LookupIterator::OWN_SKIP_INTERCEPTOR);
3871 Handle<Object> function = Object::GetProperty(&it).ToHandleChecked(); 3869 Handle<Object> function = Object::GetProperty(&it).ToHandleChecked();
3872 Handle<JSFunction>::cast(function)->set_code( 3870 Handle<JSFunction>::cast(function)->set_code(
3873 isolate()->builtins()->builtin(builtin_name)); 3871 isolate()->builtins()->builtin(builtin_name));
3874 SharedFunctionInfo* info = Handle<JSFunction>::cast(function)->shared(); 3872 Handle<JSFunction>::cast(function)->shared()->set_code(
3875 info->set_code(isolate()->builtins()->builtin(builtin_name)); 3873 isolate()->builtins()->builtin(builtin_name));
3876 info->set_internal_formal_parameter_count(internal_formal_parameter_count);
3877 } 3874 }
3878 3875
3879 void Genesis::InitializeGlobal_experimental_fast_array_builtins() { 3876 void Genesis::InitializeGlobal_experimental_fast_array_builtins() {
3880 if (!FLAG_experimental_fast_array_builtins) return; 3877 if (!FLAG_experimental_fast_array_builtins) return;
3881 { 3878 {
3882 Handle<Object> typed_array_prototype( 3879 Handle<Object> typed_array_prototype(
3883 native_context()->typed_array_prototype(), isolate()); 3880 native_context()->typed_array_prototype(), isolate());
3884 // Insert experimental fast TypedArray builtins here. 3881 // Insert experimental fast TypedArray builtins here.
3885 InstallOneBuiltinFunction(typed_array_prototype, "every", 3882 InstallOneBuiltinFunction(typed_array_prototype, "every",
3886 Builtins::kTypedArrayPrototypeEvery, 3883 Builtins::kTypedArrayPrototypeEvery);
3887 SharedFunctionInfo::kDontAdaptArgumentsSentinel);
3888 InstallOneBuiltinFunction(typed_array_prototype, "some", 3884 InstallOneBuiltinFunction(typed_array_prototype, "some",
3889 Builtins::kTypedArrayPrototypeSome, 3885 Builtins::kTypedArrayPrototypeSome);
3890 SharedFunctionInfo::kDontAdaptArgumentsSentinel);
3891 InstallOneBuiltinFunction(typed_array_prototype, "reduce", 3886 InstallOneBuiltinFunction(typed_array_prototype, "reduce",
3892 Builtins::kTypedArrayPrototypeReduce, 3887 Builtins::kTypedArrayPrototypeReduce);
3893 SharedFunctionInfo::kDontAdaptArgumentsSentinel);
3894 InstallOneBuiltinFunction(typed_array_prototype, "reduceRight", 3888 InstallOneBuiltinFunction(typed_array_prototype, "reduceRight",
3895 Builtins::kTypedArrayPrototypeReduceRight, 3889 Builtins::kTypedArrayPrototypeReduceRight);
3896 SharedFunctionInfo::kDontAdaptArgumentsSentinel);
3897 } 3890 }
3898 } 3891 }
3899 3892
3900 void Genesis::InitializeGlobal_harmony_sharedarraybuffer() { 3893 void Genesis::InitializeGlobal_harmony_sharedarraybuffer() {
3901 if (!FLAG_harmony_sharedarraybuffer) return; 3894 if (!FLAG_harmony_sharedarraybuffer) return;
3902 3895
3903 Handle<JSGlobalObject> global(native_context()->global_object()); 3896 Handle<JSGlobalObject> global(native_context()->global_object());
3904 Isolate* isolate = global->GetIsolate(); 3897 Isolate* isolate = global->GetIsolate();
3905 Factory* factory = isolate->factory(); 3898 Factory* factory = isolate->factory();
3906 3899
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
4352 // Make sure that Array.prototype.concat appears to be compiled. 4345 // Make sure that Array.prototype.concat appears to be compiled.
4353 // The code will never be called, but inline caching for call will 4346 // The code will never be called, but inline caching for call will
4354 // only work if it appears to be compiled. 4347 // only work if it appears to be compiled.
4355 concat->shared()->DontAdaptArguments(); 4348 concat->shared()->DontAdaptArguments();
4356 DCHECK(concat->is_compiled()); 4349 DCHECK(concat->is_compiled());
4357 // Set the lengths for the functions to satisfy ECMA-262. 4350 // Set the lengths for the functions to satisfy ECMA-262.
4358 concat->shared()->set_length(1); 4351 concat->shared()->set_length(1);
4359 4352
4360 // Install Array.prototype.forEach 4353 // Install Array.prototype.forEach
4361 Handle<JSFunction> forEach = InstallArrayBuiltinFunction( 4354 Handle<JSFunction> forEach = InstallArrayBuiltinFunction(
4362 proto, "forEach", Builtins::kArrayForEach, 4355 proto, "forEach", Builtins::kArrayForEach, 2);
4363 SharedFunctionInfo::kDontAdaptArgumentsSentinel);
4364 // Add forEach to the context. 4356 // Add forEach to the context.
4365 native_context()->set_array_for_each_iterator(*forEach); 4357 native_context()->set_array_for_each_iterator(*forEach);
4366 4358
4367 // Install Array.prototype.filter 4359 // Install Array.prototype.filter
4368 InstallArrayBuiltinFunction( 4360 InstallArrayBuiltinFunction(proto, "filter", Builtins::kArrayFilter, 2);
4369 proto, "filter", Builtins::kArrayFilter,
4370 SharedFunctionInfo::kDontAdaptArgumentsSentinel);
4371 4361
4372 // Install Array.prototype.map 4362 // Install Array.prototype.map
4373 InstallArrayBuiltinFunction( 4363 InstallArrayBuiltinFunction(proto, "map", Builtins::kArrayMap, 2);
4374 proto, "map", Builtins::kArrayMap,
4375 SharedFunctionInfo::kDontAdaptArgumentsSentinel);
4376 4364
4377 // Install Array.prototype.every 4365 // Install Array.prototype.every
4378 InstallArrayBuiltinFunction( 4366 InstallArrayBuiltinFunction(proto, "every", Builtins::kArrayEvery, 2);
4379 proto, "every", Builtins::kArrayEvery,
4380 SharedFunctionInfo::kDontAdaptArgumentsSentinel);
4381 4367
4382 // Install Array.prototype.some 4368 // Install Array.prototype.some
4383 InstallArrayBuiltinFunction( 4369 InstallArrayBuiltinFunction(proto, "some", Builtins::kArraySome, 2);
4384 proto, "some", Builtins::kArraySome,
4385 SharedFunctionInfo::kDontAdaptArgumentsSentinel);
4386 4370
4387 // Install Array.prototype.reduce 4371 // Install Array.prototype.reduce
4388 InstallArrayBuiltinFunction( 4372 InstallArrayBuiltinFunction(proto, "reduce", Builtins::kArrayReduce, 2);
4389 proto, "reduce", Builtins::kArrayReduce,
4390 SharedFunctionInfo::kDontAdaptArgumentsSentinel);
4391 4373
4392 // Install Array.prototype.reduceRight 4374 // Install Array.prototype.reduceRight
4393 InstallArrayBuiltinFunction( 4375 InstallArrayBuiltinFunction(proto, "reduceRight",
4394 proto, "reduceRight", Builtins::kArrayReduceRight, 4376 Builtins::kArrayReduceRight, 2);
4395 SharedFunctionInfo::kDontAdaptArgumentsSentinel);
4396 } 4377 }
4397 4378
4398 // Install InternalArray.prototype.concat 4379 // Install InternalArray.prototype.concat
4399 { 4380 {
4400 Handle<JSFunction> array_constructor( 4381 Handle<JSFunction> array_constructor(
4401 native_context()->internal_array_function()); 4382 native_context()->internal_array_function());
4402 Handle<JSObject> proto(JSObject::cast(array_constructor->prototype())); 4383 Handle<JSObject> proto(JSObject::cast(array_constructor->prototype()));
4403 Handle<JSFunction> concat = 4384 Handle<JSFunction> concat =
4404 InstallFunction(proto, "concat", JS_OBJECT_TYPE, JSObject::kHeaderSize, 4385 InstallFunction(proto, "concat", JS_OBJECT_TYPE, JSObject::kHeaderSize,
4405 MaybeHandle<JSObject>(), Builtins::kArrayConcat); 4386 MaybeHandle<JSObject>(), Builtins::kArrayConcat);
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after
5290 } 5271 }
5291 5272
5292 5273
5293 // Called when the top-level V8 mutex is destroyed. 5274 // Called when the top-level V8 mutex is destroyed.
5294 void Bootstrapper::FreeThreadResources() { 5275 void Bootstrapper::FreeThreadResources() {
5295 DCHECK(!IsActive()); 5276 DCHECK(!IsActive());
5296 } 5277 }
5297 5278
5298 } // namespace internal 5279 } // namespace internal
5299 } // namespace v8 5280 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/builtins/builtins-array-gen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698