| 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 2501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2512 map = Map::Copy(map, "SlowAliasedArguments"); | 2512 map = Map::Copy(map, "SlowAliasedArguments"); |
| 2513 map->set_elements_kind(SLOW_SLOPPY_ARGUMENTS_ELEMENTS); | 2513 map->set_elements_kind(SLOW_SLOPPY_ARGUMENTS_ELEMENTS); |
| 2514 DCHECK_EQ(2, map->GetInObjectProperties()); | 2514 DCHECK_EQ(2, map->GetInObjectProperties()); |
| 2515 native_context()->set_slow_aliased_arguments_map(*map); | 2515 native_context()->set_slow_aliased_arguments_map(*map); |
| 2516 } | 2516 } |
| 2517 | 2517 |
| 2518 { // --- strict mode arguments map | 2518 { // --- strict mode arguments map |
| 2519 const PropertyAttributes attributes = | 2519 const PropertyAttributes attributes = |
| 2520 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); | 2520 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); |
| 2521 | 2521 |
| 2522 // Create the ThrowTypeError functions. | 2522 // Create the ThrowTypeError function. |
| 2523 Handle<AccessorPair> callee = factory->NewAccessorPair(); | 2523 Handle<AccessorPair> callee = factory->NewAccessorPair(); |
| 2524 Handle<AccessorPair> caller = factory->NewAccessorPair(); | |
| 2525 | 2524 |
| 2526 Handle<JSFunction> poison = GetStrictArgumentsPoisonFunction(); | 2525 Handle<JSFunction> poison = GetStrictArgumentsPoisonFunction(); |
| 2527 | 2526 |
| 2528 // Install the ThrowTypeError functions. | 2527 // Install the ThrowTypeError function. |
| 2529 callee->set_getter(*poison); | 2528 callee->set_getter(*poison); |
| 2530 callee->set_setter(*poison); | 2529 callee->set_setter(*poison); |
| 2531 caller->set_getter(*poison); | |
| 2532 caller->set_setter(*poison); | |
| 2533 | 2530 |
| 2534 // Create the map. Allocate one in-object field for length. | 2531 // Create the map. Allocate one in-object field for length. |
| 2535 Handle<Map> map = factory->NewMap( | 2532 Handle<Map> map = factory->NewMap( |
| 2536 JS_ARGUMENTS_TYPE, JSStrictArgumentsObject::kSize, FAST_ELEMENTS); | 2533 JS_ARGUMENTS_TYPE, JSStrictArgumentsObject::kSize, FAST_ELEMENTS); |
| 2537 // Create the descriptor array for the arguments object. | 2534 // Create the descriptor array for the arguments object. |
| 2538 Map::EnsureDescriptorSlack(map, 3); | 2535 Map::EnsureDescriptorSlack(map, 2); |
| 2539 | 2536 |
| 2540 { // length | 2537 { // length |
| 2541 DataDescriptor d(factory->length_string(), | 2538 DataDescriptor d(factory->length_string(), |
| 2542 JSStrictArgumentsObject::kLengthIndex, DONT_ENUM, | 2539 JSStrictArgumentsObject::kLengthIndex, DONT_ENUM, |
| 2543 Representation::Tagged()); | 2540 Representation::Tagged()); |
| 2544 map->AppendDescriptor(&d); | 2541 map->AppendDescriptor(&d); |
| 2545 } | 2542 } |
| 2546 { // callee | 2543 { // callee |
| 2547 AccessorConstantDescriptor d(factory->callee_string(), callee, | 2544 AccessorConstantDescriptor d(factory->callee_string(), callee, |
| 2548 attributes); | 2545 attributes); |
| 2549 map->AppendDescriptor(&d); | 2546 map->AppendDescriptor(&d); |
| 2550 } | 2547 } |
| 2551 { // caller | |
| 2552 AccessorConstantDescriptor d(factory->caller_string(), caller, | |
| 2553 attributes); | |
| 2554 map->AppendDescriptor(&d); | |
| 2555 } | |
| 2556 // @@iterator method is added later. | 2548 // @@iterator method is added later. |
| 2557 | 2549 |
| 2558 DCHECK_EQ(native_context()->object_function()->prototype(), | 2550 DCHECK_EQ(native_context()->object_function()->prototype(), |
| 2559 *isolate->initial_object_prototype()); | 2551 *isolate->initial_object_prototype()); |
| 2560 Map::SetPrototype(map, isolate->initial_object_prototype()); | 2552 Map::SetPrototype(map, isolate->initial_object_prototype()); |
| 2561 map->SetInObjectProperties(1); | 2553 map->SetInObjectProperties(1); |
| 2562 | 2554 |
| 2563 // Copy constructor from the sloppy arguments boilerplate. | 2555 // Copy constructor from the sloppy arguments boilerplate. |
| 2564 map->SetConstructor( | 2556 map->SetConstructor( |
| 2565 native_context()->sloppy_arguments_map()->GetConstructor()); | 2557 native_context()->sloppy_arguments_map()->GetConstructor()); |
| (...skipping 1977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4543 } | 4535 } |
| 4544 | 4536 |
| 4545 | 4537 |
| 4546 // Called when the top-level V8 mutex is destroyed. | 4538 // Called when the top-level V8 mutex is destroyed. |
| 4547 void Bootstrapper::FreeThreadResources() { | 4539 void Bootstrapper::FreeThreadResources() { |
| 4548 DCHECK(!IsActive()); | 4540 DCHECK(!IsActive()); |
| 4549 } | 4541 } |
| 4550 | 4542 |
| 4551 } // namespace internal | 4543 } // namespace internal |
| 4552 } // namespace v8 | 4544 } // namespace v8 |
| OLD | NEW |