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/base/ieee754.h" | 9 #include "src/base/ieee754.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 void SimpleInstallGetterSetter(Handle<JSObject> base, Handle<String> name, | 452 void SimpleInstallGetterSetter(Handle<JSObject> base, Handle<String> name, |
453 Builtins::Name call_getter, | 453 Builtins::Name call_getter, |
454 Builtins::Name call_setter, | 454 Builtins::Name call_setter, |
455 PropertyAttributes attribs) { | 455 PropertyAttributes attribs) { |
456 Isolate* const isolate = base->GetIsolate(); | 456 Isolate* const isolate = base->GetIsolate(); |
457 | 457 |
458 Handle<String> getter_name = | 458 Handle<String> getter_name = |
459 Name::ToFunctionName(name, isolate->factory()->get_string()) | 459 Name::ToFunctionName(name, isolate->factory()->get_string()) |
460 .ToHandleChecked(); | 460 .ToHandleChecked(); |
461 Handle<JSFunction> getter = | 461 Handle<JSFunction> getter = |
462 SimpleCreateFunction(isolate, getter_name, call_getter, 0, true); | 462 SimpleCreateFunction(isolate, getter_name, call_getter, 0, false); |
463 getter->shared()->set_native(true); | 463 getter->shared()->set_native(true); |
464 | 464 |
465 Handle<String> setter_name = | 465 Handle<String> setter_name = |
466 Name::ToFunctionName(name, isolate->factory()->set_string()) | 466 Name::ToFunctionName(name, isolate->factory()->set_string()) |
467 .ToHandleChecked(); | 467 .ToHandleChecked(); |
468 Handle<JSFunction> setter = | 468 Handle<JSFunction> setter = |
469 SimpleCreateFunction(isolate, setter_name, call_setter, 1, true); | 469 SimpleCreateFunction(isolate, setter_name, call_setter, 0, false); |
470 setter->shared()->set_native(true); | 470 setter->shared()->set_native(true); |
471 | 471 |
472 JSObject::DefineAccessor(base, name, getter, setter, attribs).Check(); | 472 JSObject::DefineAccessor(base, name, getter, setter, attribs).Check(); |
473 } | 473 } |
474 | 474 |
475 Handle<JSFunction> SimpleInstallGetter(Handle<JSObject> base, | 475 Handle<JSFunction> SimpleInstallGetter(Handle<JSObject> base, |
476 Handle<String> name, | 476 Handle<String> name, |
477 Handle<Name> property_name, | 477 Handle<Name> property_name, |
478 Builtins::Name call, bool adapt) { | 478 Builtins::Name call, bool adapt) { |
479 Isolate* const isolate = base->GetIsolate(); | 479 Isolate* const isolate = base->GetIsolate(); |
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1191 Builtins::kObjectHasOwnProperty, 1, true); | 1191 Builtins::kObjectHasOwnProperty, 1, true); |
1192 SimpleInstallFunction(isolate->initial_object_prototype(), | 1192 SimpleInstallFunction(isolate->initial_object_prototype(), |
1193 "__lookupGetter__", Builtins::kObjectLookupGetter, 1, | 1193 "__lookupGetter__", Builtins::kObjectLookupGetter, 1, |
1194 true); | 1194 true); |
1195 SimpleInstallFunction(isolate->initial_object_prototype(), | 1195 SimpleInstallFunction(isolate->initial_object_prototype(), |
1196 "__lookupSetter__", Builtins::kObjectLookupSetter, 1, | 1196 "__lookupSetter__", Builtins::kObjectLookupSetter, 1, |
1197 true); | 1197 true); |
1198 SimpleInstallFunction( | 1198 SimpleInstallFunction( |
1199 isolate->initial_object_prototype(), "propertyIsEnumerable", | 1199 isolate->initial_object_prototype(), "propertyIsEnumerable", |
1200 Builtins::kObjectPrototypePropertyIsEnumerable, 1, false); | 1200 Builtins::kObjectPrototypePropertyIsEnumerable, 1, false); |
1201 | |
1202 SimpleInstallGetterSetter(isolate->initial_object_prototype(), | |
1203 factory->proto_string(), | |
1204 Builtins::kObjectPrototypeGetProto, | |
1205 Builtins::kObjectPrototypeSetProto, DONT_ENUM); | |
1206 } | 1201 } |
1207 | 1202 |
1208 Handle<JSObject> global(native_context()->global_object()); | 1203 Handle<JSObject> global(native_context()->global_object()); |
1209 | 1204 |
1210 { // --- F u n c t i o n --- | 1205 { // --- F u n c t i o n --- |
1211 Handle<JSFunction> prototype = empty_function; | 1206 Handle<JSFunction> prototype = empty_function; |
1212 Handle<JSFunction> function_fun = | 1207 Handle<JSFunction> function_fun = |
1213 InstallFunction(global, "Function", JS_FUNCTION_TYPE, JSFunction::kSize, | 1208 InstallFunction(global, "Function", JS_FUNCTION_TYPE, JSFunction::kSize, |
1214 prototype, Builtins::kFunctionConstructor); | 1209 prototype, Builtins::kFunctionConstructor); |
1215 function_fun->set_prototype_or_initial_map( | 1210 function_fun->set_prototype_or_initial_map( |
(...skipping 3244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4460 } | 4455 } |
4461 | 4456 |
4462 | 4457 |
4463 // Called when the top-level V8 mutex is destroyed. | 4458 // Called when the top-level V8 mutex is destroyed. |
4464 void Bootstrapper::FreeThreadResources() { | 4459 void Bootstrapper::FreeThreadResources() { |
4465 DCHECK(!IsActive()); | 4460 DCHECK(!IsActive()); |
4466 } | 4461 } |
4467 | 4462 |
4468 } // namespace internal | 4463 } // namespace internal |
4469 } // namespace v8 | 4464 } // namespace v8 |
OLD | NEW |