| 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/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 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1350 DCHECK(!function->has_initial_map()); | 1350 DCHECK(!function->has_initial_map()); |
| 1351 JSFunction::SetInitialMap(function, map, | 1351 JSFunction::SetInitialMap(function, map, |
| 1352 isolate->initial_object_prototype()); | 1352 isolate->initial_object_prototype()); |
| 1353 | 1353 |
| 1354 DCHECK(map->inobject_properties() > Heap::kArgumentsCalleeIndex); | 1354 DCHECK(map->inobject_properties() > Heap::kArgumentsCalleeIndex); |
| 1355 DCHECK(map->inobject_properties() > Heap::kArgumentsLengthIndex); | 1355 DCHECK(map->inobject_properties() > Heap::kArgumentsLengthIndex); |
| 1356 DCHECK(!map->is_dictionary_map()); | 1356 DCHECK(!map->is_dictionary_map()); |
| 1357 DCHECK(IsFastObjectElementsKind(map->elements_kind())); | 1357 DCHECK(IsFastObjectElementsKind(map->elements_kind())); |
| 1358 } | 1358 } |
| 1359 | 1359 |
| 1360 { // --- aliased arguments map | 1360 { // --- fast and slow aliased arguments map |
| 1361 Handle<Map> map = | 1361 Handle<Map> map = isolate->sloppy_arguments_map(); |
| 1362 Map::Copy(isolate->sloppy_arguments_map(), "AliasedArguments"); | 1362 map = Map::Copy(map, "FastAliasedArguments"); |
| 1363 map->set_elements_kind(SLOPPY_ARGUMENTS_ELEMENTS); | 1363 map->set_elements_kind(FAST_SLOPPY_ARGUMENTS_ELEMENTS); |
| 1364 DCHECK_EQ(2, map->pre_allocated_property_fields()); | 1364 DCHECK_EQ(2, map->pre_allocated_property_fields()); |
| 1365 native_context()->set_aliased_arguments_map(*map); | 1365 native_context()->set_fast_aliased_arguments_map(*map); |
| 1366 |
| 1367 map = Map::Copy(map, "SlowAliasedArguments"); |
| 1368 map->set_elements_kind(SLOW_SLOPPY_ARGUMENTS_ELEMENTS); |
| 1369 DCHECK_EQ(2, map->pre_allocated_property_fields()); |
| 1370 native_context()->set_slow_aliased_arguments_map(*map); |
| 1366 } | 1371 } |
| 1367 | 1372 |
| 1368 { // --- strict mode arguments map | 1373 { // --- strict mode arguments map |
| 1369 const PropertyAttributes attributes = | 1374 const PropertyAttributes attributes = |
| 1370 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); | 1375 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); |
| 1371 | 1376 |
| 1372 // Create the ThrowTypeError functions. | 1377 // Create the ThrowTypeError functions. |
| 1373 Handle<AccessorPair> callee = factory->NewAccessorPair(); | 1378 Handle<AccessorPair> callee = factory->NewAccessorPair(); |
| 1374 Handle<AccessorPair> caller = factory->NewAccessorPair(); | 1379 Handle<AccessorPair> caller = factory->NewAccessorPair(); |
| 1375 | 1380 |
| (...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2433 { | 2438 { |
| 2434 AccessorConstantDescriptor d(factory()->iterator_symbol(), | 2439 AccessorConstantDescriptor d(factory()->iterator_symbol(), |
| 2435 arguments_iterator, attribs); | 2440 arguments_iterator, attribs); |
| 2436 Handle<Map> map(native_context()->sloppy_arguments_map()); | 2441 Handle<Map> map(native_context()->sloppy_arguments_map()); |
| 2437 Map::EnsureDescriptorSlack(map, 1); | 2442 Map::EnsureDescriptorSlack(map, 1); |
| 2438 map->AppendDescriptor(&d); | 2443 map->AppendDescriptor(&d); |
| 2439 } | 2444 } |
| 2440 { | 2445 { |
| 2441 AccessorConstantDescriptor d(factory()->iterator_symbol(), | 2446 AccessorConstantDescriptor d(factory()->iterator_symbol(), |
| 2442 arguments_iterator, attribs); | 2447 arguments_iterator, attribs); |
| 2443 Handle<Map> map(native_context()->aliased_arguments_map()); | 2448 Handle<Map> map(native_context()->fast_aliased_arguments_map()); |
| 2444 Map::EnsureDescriptorSlack(map, 1); | 2449 Map::EnsureDescriptorSlack(map, 1); |
| 2445 map->AppendDescriptor(&d); | 2450 map->AppendDescriptor(&d); |
| 2446 } | 2451 } |
| 2452 { |
| 2453 AccessorConstantDescriptor d(factory()->iterator_symbol(), |
| 2454 arguments_iterator, attribs); |
| 2455 Handle<Map> map(native_context()->slow_aliased_arguments_map()); |
| 2456 Map::EnsureDescriptorSlack(map, 1); |
| 2457 map->AppendDescriptor(&d); |
| 2458 } |
| 2447 { | 2459 { |
| 2448 AccessorConstantDescriptor d(factory()->iterator_symbol(), | 2460 AccessorConstantDescriptor d(factory()->iterator_symbol(), |
| 2449 arguments_iterator, attribs); | 2461 arguments_iterator, attribs); |
| 2450 Handle<Map> map(native_context()->strict_arguments_map()); | 2462 Handle<Map> map(native_context()->strict_arguments_map()); |
| 2451 Map::EnsureDescriptorSlack(map, 1); | 2463 Map::EnsureDescriptorSlack(map, 1); |
| 2452 map->AppendDescriptor(&d); | 2464 map->AppendDescriptor(&d); |
| 2453 } | 2465 } |
| 2454 } | 2466 } |
| 2455 | 2467 |
| 2456 #ifdef VERIFY_HEAP | 2468 #ifdef VERIFY_HEAP |
| (...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3192 } | 3204 } |
| 3193 | 3205 |
| 3194 | 3206 |
| 3195 // Called when the top-level V8 mutex is destroyed. | 3207 // Called when the top-level V8 mutex is destroyed. |
| 3196 void Bootstrapper::FreeThreadResources() { | 3208 void Bootstrapper::FreeThreadResources() { |
| 3197 DCHECK(!IsActive()); | 3209 DCHECK(!IsActive()); |
| 3198 } | 3210 } |
| 3199 | 3211 |
| 3200 } // namespace internal | 3212 } // namespace internal |
| 3201 } // namespace v8 | 3213 } // namespace v8 |
| OLD | NEW |