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/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/extensions/externalize-string-extension.h" | 10 #include "src/extensions/externalize-string-extension.h" |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 Handle<Map> map, FunctionMode function_mode) { | 381 Handle<Map> map, FunctionMode function_mode) { |
382 int size = IsFunctionModeWithPrototype(function_mode) ? 5 : 4; | 382 int size = IsFunctionModeWithPrototype(function_mode) ? 5 : 4; |
383 Map::EnsureDescriptorSlack(map, size); | 383 Map::EnsureDescriptorSlack(map, size); |
384 | 384 |
385 PropertyAttributes ro_attribs = | 385 PropertyAttributes ro_attribs = |
386 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); | 386 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); |
387 PropertyAttributes roc_attribs = | 387 PropertyAttributes roc_attribs = |
388 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY); | 388 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY); |
389 | 389 |
390 Handle<AccessorInfo> length = | 390 Handle<AccessorInfo> length = |
391 Accessors::FunctionLengthInfo(isolate(), ro_attribs); | 391 Accessors::FunctionLengthInfo(isolate(), roc_attribs); |
392 { // Add length. | 392 { // Add length. |
393 AccessorConstantDescriptor d(Handle<Name>(Name::cast(length->name())), | 393 AccessorConstantDescriptor d(Handle<Name>(Name::cast(length->name())), |
394 length, ro_attribs); | 394 length, roc_attribs); |
395 map->AppendDescriptor(&d); | 395 map->AppendDescriptor(&d); |
396 } | 396 } |
397 Handle<AccessorInfo> name = | 397 Handle<AccessorInfo> name = |
398 Accessors::FunctionNameInfo(isolate(), ro_attribs); | 398 Accessors::FunctionNameInfo(isolate(), ro_attribs); |
399 { // Add name. | 399 { // Add name. |
400 AccessorConstantDescriptor d(Handle<Name>(Name::cast(name->name())), name, | 400 AccessorConstantDescriptor d(Handle<Name>(Name::cast(name->name())), name, |
401 roc_attribs); | 401 roc_attribs); |
402 map->AppendDescriptor(&d); | 402 map->AppendDescriptor(&d); |
403 } | 403 } |
404 Handle<AccessorInfo> args = | 404 Handle<AccessorInfo> args = |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 // Add length. | 548 // Add length. |
549 if (function_mode == BOUND_FUNCTION) { | 549 if (function_mode == BOUND_FUNCTION) { |
550 Handle<String> length_string = isolate()->factory()->length_string(); | 550 Handle<String> length_string = isolate()->factory()->length_string(); |
551 DataDescriptor d(length_string, 0, ro_attribs, Representation::Tagged()); | 551 DataDescriptor d(length_string, 0, ro_attribs, Representation::Tagged()); |
552 map->AppendDescriptor(&d); | 552 map->AppendDescriptor(&d); |
553 } else { | 553 } else { |
554 DCHECK(function_mode == FUNCTION_WITH_WRITEABLE_PROTOTYPE || | 554 DCHECK(function_mode == FUNCTION_WITH_WRITEABLE_PROTOTYPE || |
555 function_mode == FUNCTION_WITH_READONLY_PROTOTYPE || | 555 function_mode == FUNCTION_WITH_READONLY_PROTOTYPE || |
556 function_mode == FUNCTION_WITHOUT_PROTOTYPE); | 556 function_mode == FUNCTION_WITHOUT_PROTOTYPE); |
557 Handle<AccessorInfo> length = | 557 Handle<AccessorInfo> length = |
558 Accessors::FunctionLengthInfo(isolate(), ro_attribs); | 558 Accessors::FunctionLengthInfo(isolate(), roc_attribs); |
559 AccessorConstantDescriptor d(Handle<Name>(Name::cast(length->name())), | 559 AccessorConstantDescriptor d(Handle<Name>(Name::cast(length->name())), |
560 length, ro_attribs); | 560 length, roc_attribs); |
561 map->AppendDescriptor(&d); | 561 map->AppendDescriptor(&d); |
562 } | 562 } |
563 Handle<AccessorInfo> name = | 563 Handle<AccessorInfo> name = |
564 Accessors::FunctionNameInfo(isolate(), roc_attribs); | 564 Accessors::FunctionNameInfo(isolate(), roc_attribs); |
565 { // Add name. | 565 { // Add name. |
566 AccessorConstantDescriptor d(Handle<Name>(Name::cast(name->name())), name, | 566 AccessorConstantDescriptor d(Handle<Name>(Name::cast(name->name())), name, |
567 roc_attribs); | 567 roc_attribs); |
568 map->AppendDescriptor(&d); | 568 map->AppendDescriptor(&d); |
569 } | 569 } |
570 { // Add arguments. | 570 { // Add arguments. |
(...skipping 2353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2924 return from + sizeof(NestingCounterType); | 2924 return from + sizeof(NestingCounterType); |
2925 } | 2925 } |
2926 | 2926 |
2927 | 2927 |
2928 // Called when the top-level V8 mutex is destroyed. | 2928 // Called when the top-level V8 mutex is destroyed. |
2929 void Bootstrapper::FreeThreadResources() { | 2929 void Bootstrapper::FreeThreadResources() { |
2930 DCHECK(!IsActive()); | 2930 DCHECK(!IsActive()); |
2931 } | 2931 } |
2932 | 2932 |
2933 } } // namespace v8::internal | 2933 } } // namespace v8::internal |
OLD | NEW |