| 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 "bootstrapper.h" | 5 #include "bootstrapper.h" |
| 6 | 6 |
| 7 #include "accessors.h" | 7 #include "accessors.h" |
| 8 #include "isolate-inl.h" | 8 #include "isolate-inl.h" |
| 9 #include "natives.h" | 9 #include "natives.h" |
| 10 #include "snapshot.h" | 10 #include "snapshot.h" |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 function->shared()->set_native(true); | 381 function->shared()->set_native(true); |
| 382 return function; | 382 return function; |
| 383 } | 383 } |
| 384 | 384 |
| 385 | 385 |
| 386 void Genesis::SetFunctionInstanceDescriptor( | 386 void Genesis::SetFunctionInstanceDescriptor( |
| 387 Handle<Map> map, PrototypePropertyMode prototypeMode) { | 387 Handle<Map> map, PrototypePropertyMode prototypeMode) { |
| 388 int size = (prototypeMode == DONT_ADD_PROTOTYPE) ? 4 : 5; | 388 int size = (prototypeMode == DONT_ADD_PROTOTYPE) ? 4 : 5; |
| 389 Map::EnsureDescriptorSlack(map, size); | 389 Map::EnsureDescriptorSlack(map, size); |
| 390 | 390 |
| 391 Handle<Foreign> args(factory()->NewForeign(&Accessors::FunctionArguments)); | |
| 392 Handle<Foreign> caller(factory()->NewForeign(&Accessors::FunctionCaller)); | 391 Handle<Foreign> caller(factory()->NewForeign(&Accessors::FunctionCaller)); |
| 393 PropertyAttributes attribs = static_cast<PropertyAttributes>( | 392 PropertyAttributes attribs = static_cast<PropertyAttributes>( |
| 394 DONT_ENUM | DONT_DELETE | READ_ONLY); | 393 DONT_ENUM | DONT_DELETE | READ_ONLY); |
| 395 | 394 |
| 396 Handle<AccessorInfo> length = | 395 Handle<AccessorInfo> length = |
| 397 Accessors::FunctionLengthInfo(isolate(), attribs); | 396 Accessors::FunctionLengthInfo(isolate(), attribs); |
| 398 { // Add length. | 397 { // Add length. |
| 399 CallbacksDescriptor d(Handle<Name>(Name::cast(length->name())), | 398 CallbacksDescriptor d(Handle<Name>(Name::cast(length->name())), |
| 400 length, attribs); | 399 length, attribs); |
| 401 map->AppendDescriptor(&d); | 400 map->AppendDescriptor(&d); |
| 402 } | 401 } |
| 403 Handle<AccessorInfo> name = | 402 Handle<AccessorInfo> name = |
| 404 Accessors::FunctionNameInfo(isolate(), attribs); | 403 Accessors::FunctionNameInfo(isolate(), attribs); |
| 405 { // Add name. | 404 { // Add name. |
| 406 CallbacksDescriptor d(Handle<Name>(Name::cast(name->name())), | 405 CallbacksDescriptor d(Handle<Name>(Name::cast(name->name())), |
| 407 name, attribs); | 406 name, attribs); |
| 408 map->AppendDescriptor(&d); | 407 map->AppendDescriptor(&d); |
| 409 } | 408 } |
| 409 Handle<AccessorInfo> args = |
| 410 Accessors::FunctionArgumentsInfo(isolate(), attribs); |
| 410 { // Add arguments. | 411 { // Add arguments. |
| 411 CallbacksDescriptor d(factory()->arguments_string(), args, attribs); | 412 CallbacksDescriptor d(Handle<Name>(Name::cast(args->name())), |
| 413 args, attribs); |
| 412 map->AppendDescriptor(&d); | 414 map->AppendDescriptor(&d); |
| 413 } | 415 } |
| 414 { // Add caller. | 416 { // Add caller. |
| 415 CallbacksDescriptor d(factory()->caller_string(), caller, attribs); | 417 CallbacksDescriptor d(factory()->caller_string(), caller, attribs); |
| 416 map->AppendDescriptor(&d); | 418 map->AppendDescriptor(&d); |
| 417 } | 419 } |
| 418 if (prototypeMode != DONT_ADD_PROTOTYPE) { | 420 if (prototypeMode != DONT_ADD_PROTOTYPE) { |
| 419 if (prototypeMode == ADD_WRITEABLE_PROTOTYPE) { | 421 if (prototypeMode == ADD_WRITEABLE_PROTOTYPE) { |
| 420 attribs = static_cast<PropertyAttributes>(attribs & ~READ_ONLY); | 422 attribs = static_cast<PropertyAttributes>(attribs & ~READ_ONLY); |
| 421 } | 423 } |
| (...skipping 2262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2684 return from + sizeof(NestingCounterType); | 2686 return from + sizeof(NestingCounterType); |
| 2685 } | 2687 } |
| 2686 | 2688 |
| 2687 | 2689 |
| 2688 // Called when the top-level V8 mutex is destroyed. | 2690 // Called when the top-level V8 mutex is destroyed. |
| 2689 void Bootstrapper::FreeThreadResources() { | 2691 void Bootstrapper::FreeThreadResources() { |
| 2690 ASSERT(!IsActive()); | 2692 ASSERT(!IsActive()); |
| 2691 } | 2693 } |
| 2692 | 2694 |
| 2693 } } // namespace v8::internal | 2695 } } // namespace v8::internal |
| OLD | NEW |