OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/contexts.h" | 10 #include "src/contexts.h" |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 v8::Local<v8::Name> name, | 351 v8::Local<v8::Name> name, |
352 v8::Local<v8::Value> value, | 352 v8::Local<v8::Value> value, |
353 const v8::PropertyCallbackInfo<void>& info) { | 353 const v8::PropertyCallbackInfo<void>& info) { |
354 UNREACHABLE(); | 354 UNREACHABLE(); |
355 } | 355 } |
356 | 356 |
357 | 357 |
358 Handle<AccessorInfo> Accessors::ScriptColumnOffsetInfo( | 358 Handle<AccessorInfo> Accessors::ScriptColumnOffsetInfo( |
359 Isolate* isolate, PropertyAttributes attributes) { | 359 Isolate* isolate, PropertyAttributes attributes) { |
360 Handle<String> name(isolate->factory()->InternalizeOneByteString( | 360 Handle<String> name(isolate->factory()->InternalizeOneByteString( |
361 STATIC_ASCII_VECTOR("column_offset"))); | 361 STATIC_CHAR_VECTOR("column_offset"))); |
362 return MakeAccessor(isolate, | 362 return MakeAccessor(isolate, |
363 name, | 363 name, |
364 &ScriptColumnOffsetGetter, | 364 &ScriptColumnOffsetGetter, |
365 &ScriptColumnOffsetSetter, | 365 &ScriptColumnOffsetSetter, |
366 attributes); | 366 attributes); |
367 } | 367 } |
368 | 368 |
369 | 369 |
370 // | 370 // |
371 // Accessors::ScriptId | 371 // Accessors::ScriptId |
(...skipping 15 matching lines...) Expand all Loading... |
387 void Accessors::ScriptIdSetter( | 387 void Accessors::ScriptIdSetter( |
388 v8::Local<v8::Name> name, | 388 v8::Local<v8::Name> name, |
389 v8::Local<v8::Value> value, | 389 v8::Local<v8::Value> value, |
390 const v8::PropertyCallbackInfo<void>& info) { | 390 const v8::PropertyCallbackInfo<void>& info) { |
391 UNREACHABLE(); | 391 UNREACHABLE(); |
392 } | 392 } |
393 | 393 |
394 | 394 |
395 Handle<AccessorInfo> Accessors::ScriptIdInfo( | 395 Handle<AccessorInfo> Accessors::ScriptIdInfo( |
396 Isolate* isolate, PropertyAttributes attributes) { | 396 Isolate* isolate, PropertyAttributes attributes) { |
397 Handle<String> name(isolate->factory()->InternalizeOneByteString( | 397 Handle<String> name( |
398 STATIC_ASCII_VECTOR("id"))); | 398 isolate->factory()->InternalizeOneByteString(STATIC_CHAR_VECTOR("id"))); |
399 return MakeAccessor(isolate, | 399 return MakeAccessor(isolate, |
400 name, | 400 name, |
401 &ScriptIdGetter, | 401 &ScriptIdGetter, |
402 &ScriptIdSetter, | 402 &ScriptIdSetter, |
403 attributes); | 403 attributes); |
404 } | 404 } |
405 | 405 |
406 | 406 |
407 // | 407 // |
408 // Accessors::ScriptName | 408 // Accessors::ScriptName |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 v8::Local<v8::Name> name, | 495 v8::Local<v8::Name> name, |
496 v8::Local<v8::Value> value, | 496 v8::Local<v8::Value> value, |
497 const v8::PropertyCallbackInfo<void>& info) { | 497 const v8::PropertyCallbackInfo<void>& info) { |
498 UNREACHABLE(); | 498 UNREACHABLE(); |
499 } | 499 } |
500 | 500 |
501 | 501 |
502 Handle<AccessorInfo> Accessors::ScriptLineOffsetInfo( | 502 Handle<AccessorInfo> Accessors::ScriptLineOffsetInfo( |
503 Isolate* isolate, PropertyAttributes attributes) { | 503 Isolate* isolate, PropertyAttributes attributes) { |
504 Handle<String> name(isolate->factory()->InternalizeOneByteString( | 504 Handle<String> name(isolate->factory()->InternalizeOneByteString( |
505 STATIC_ASCII_VECTOR("line_offset"))); | 505 STATIC_CHAR_VECTOR("line_offset"))); |
506 return MakeAccessor(isolate, | 506 return MakeAccessor(isolate, |
507 name, | 507 name, |
508 &ScriptLineOffsetGetter, | 508 &ScriptLineOffsetGetter, |
509 &ScriptLineOffsetSetter, | 509 &ScriptLineOffsetSetter, |
510 attributes); | 510 attributes); |
511 } | 511 } |
512 | 512 |
513 | 513 |
514 // | 514 // |
515 // Accessors::ScriptType | 515 // Accessors::ScriptType |
(...skipping 15 matching lines...) Expand all Loading... |
531 void Accessors::ScriptTypeSetter( | 531 void Accessors::ScriptTypeSetter( |
532 v8::Local<v8::Name> name, | 532 v8::Local<v8::Name> name, |
533 v8::Local<v8::Value> value, | 533 v8::Local<v8::Value> value, |
534 const v8::PropertyCallbackInfo<void>& info) { | 534 const v8::PropertyCallbackInfo<void>& info) { |
535 UNREACHABLE(); | 535 UNREACHABLE(); |
536 } | 536 } |
537 | 537 |
538 | 538 |
539 Handle<AccessorInfo> Accessors::ScriptTypeInfo( | 539 Handle<AccessorInfo> Accessors::ScriptTypeInfo( |
540 Isolate* isolate, PropertyAttributes attributes) { | 540 Isolate* isolate, PropertyAttributes attributes) { |
541 Handle<String> name(isolate->factory()->InternalizeOneByteString( | 541 Handle<String> name( |
542 STATIC_ASCII_VECTOR("type"))); | 542 isolate->factory()->InternalizeOneByteString(STATIC_CHAR_VECTOR("type"))); |
543 return MakeAccessor(isolate, | 543 return MakeAccessor(isolate, |
544 name, | 544 name, |
545 &ScriptTypeGetter, | 545 &ScriptTypeGetter, |
546 &ScriptTypeSetter, | 546 &ScriptTypeSetter, |
547 attributes); | 547 attributes); |
548 } | 548 } |
549 | 549 |
550 | 550 |
551 // | 551 // |
552 // Accessors::ScriptCompilationType | 552 // Accessors::ScriptCompilationType |
(...skipping 17 matching lines...) Expand all Loading... |
570 v8::Local<v8::Name> name, | 570 v8::Local<v8::Name> name, |
571 v8::Local<v8::Value> value, | 571 v8::Local<v8::Value> value, |
572 const v8::PropertyCallbackInfo<void>& info) { | 572 const v8::PropertyCallbackInfo<void>& info) { |
573 UNREACHABLE(); | 573 UNREACHABLE(); |
574 } | 574 } |
575 | 575 |
576 | 576 |
577 Handle<AccessorInfo> Accessors::ScriptCompilationTypeInfo( | 577 Handle<AccessorInfo> Accessors::ScriptCompilationTypeInfo( |
578 Isolate* isolate, PropertyAttributes attributes) { | 578 Isolate* isolate, PropertyAttributes attributes) { |
579 Handle<String> name(isolate->factory()->InternalizeOneByteString( | 579 Handle<String> name(isolate->factory()->InternalizeOneByteString( |
580 STATIC_ASCII_VECTOR("compilation_type"))); | 580 STATIC_CHAR_VECTOR("compilation_type"))); |
581 return MakeAccessor(isolate, | 581 return MakeAccessor(isolate, |
582 name, | 582 name, |
583 &ScriptCompilationTypeGetter, | 583 &ScriptCompilationTypeGetter, |
584 &ScriptCompilationTypeSetter, | 584 &ScriptCompilationTypeSetter, |
585 attributes); | 585 attributes); |
586 } | 586 } |
587 | 587 |
588 | 588 |
589 // | 589 // |
590 // Accessors::ScriptGetLineEnds | 590 // Accessors::ScriptGetLineEnds |
(...skipping 24 matching lines...) Expand all Loading... |
615 v8::Local<v8::Name> name, | 615 v8::Local<v8::Name> name, |
616 v8::Local<v8::Value> value, | 616 v8::Local<v8::Value> value, |
617 const v8::PropertyCallbackInfo<void>& info) { | 617 const v8::PropertyCallbackInfo<void>& info) { |
618 UNREACHABLE(); | 618 UNREACHABLE(); |
619 } | 619 } |
620 | 620 |
621 | 621 |
622 Handle<AccessorInfo> Accessors::ScriptLineEndsInfo( | 622 Handle<AccessorInfo> Accessors::ScriptLineEndsInfo( |
623 Isolate* isolate, PropertyAttributes attributes) { | 623 Isolate* isolate, PropertyAttributes attributes) { |
624 Handle<String> name(isolate->factory()->InternalizeOneByteString( | 624 Handle<String> name(isolate->factory()->InternalizeOneByteString( |
625 STATIC_ASCII_VECTOR("line_ends"))); | 625 STATIC_CHAR_VECTOR("line_ends"))); |
626 return MakeAccessor(isolate, | 626 return MakeAccessor(isolate, |
627 name, | 627 name, |
628 &ScriptLineEndsGetter, | 628 &ScriptLineEndsGetter, |
629 &ScriptLineEndsSetter, | 629 &ScriptLineEndsSetter, |
630 attributes); | 630 attributes); |
631 } | 631 } |
632 | 632 |
633 | 633 |
634 // | 634 // |
635 // Accessors::ScriptSourceUrl | 635 // Accessors::ScriptSourceUrl |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 v8::Local<v8::Name> name, | 723 v8::Local<v8::Name> name, |
724 v8::Local<v8::Value> value, | 724 v8::Local<v8::Value> value, |
725 const v8::PropertyCallbackInfo<void>& info) { | 725 const v8::PropertyCallbackInfo<void>& info) { |
726 UNREACHABLE(); | 726 UNREACHABLE(); |
727 } | 727 } |
728 | 728 |
729 | 729 |
730 Handle<AccessorInfo> Accessors::ScriptContextDataInfo( | 730 Handle<AccessorInfo> Accessors::ScriptContextDataInfo( |
731 Isolate* isolate, PropertyAttributes attributes) { | 731 Isolate* isolate, PropertyAttributes attributes) { |
732 Handle<String> name(isolate->factory()->InternalizeOneByteString( | 732 Handle<String> name(isolate->factory()->InternalizeOneByteString( |
733 STATIC_ASCII_VECTOR("context_data"))); | 733 STATIC_CHAR_VECTOR("context_data"))); |
734 return MakeAccessor(isolate, | 734 return MakeAccessor(isolate, |
735 name, | 735 name, |
736 &ScriptContextDataGetter, | 736 &ScriptContextDataGetter, |
737 &ScriptContextDataSetter, | 737 &ScriptContextDataSetter, |
738 attributes); | 738 attributes); |
739 } | 739 } |
740 | 740 |
741 | 741 |
742 // | 742 // |
743 // Accessors::ScriptGetEvalFromScript | 743 // Accessors::ScriptGetEvalFromScript |
(...skipping 26 matching lines...) Expand all Loading... |
770 v8::Local<v8::Name> name, | 770 v8::Local<v8::Name> name, |
771 v8::Local<v8::Value> value, | 771 v8::Local<v8::Value> value, |
772 const v8::PropertyCallbackInfo<void>& info) { | 772 const v8::PropertyCallbackInfo<void>& info) { |
773 UNREACHABLE(); | 773 UNREACHABLE(); |
774 } | 774 } |
775 | 775 |
776 | 776 |
777 Handle<AccessorInfo> Accessors::ScriptEvalFromScriptInfo( | 777 Handle<AccessorInfo> Accessors::ScriptEvalFromScriptInfo( |
778 Isolate* isolate, PropertyAttributes attributes) { | 778 Isolate* isolate, PropertyAttributes attributes) { |
779 Handle<String> name(isolate->factory()->InternalizeOneByteString( | 779 Handle<String> name(isolate->factory()->InternalizeOneByteString( |
780 STATIC_ASCII_VECTOR("eval_from_script"))); | 780 STATIC_CHAR_VECTOR("eval_from_script"))); |
781 return MakeAccessor(isolate, | 781 return MakeAccessor(isolate, |
782 name, | 782 name, |
783 &ScriptEvalFromScriptGetter, | 783 &ScriptEvalFromScriptGetter, |
784 &ScriptEvalFromScriptSetter, | 784 &ScriptEvalFromScriptSetter, |
785 attributes); | 785 attributes); |
786 } | 786 } |
787 | 787 |
788 | 788 |
789 // | 789 // |
790 // Accessors::ScriptGetEvalFromScriptPosition | 790 // Accessors::ScriptGetEvalFromScriptPosition |
(...skipping 25 matching lines...) Expand all Loading... |
816 v8::Local<v8::Name> name, | 816 v8::Local<v8::Name> name, |
817 v8::Local<v8::Value> value, | 817 v8::Local<v8::Value> value, |
818 const v8::PropertyCallbackInfo<void>& info) { | 818 const v8::PropertyCallbackInfo<void>& info) { |
819 UNREACHABLE(); | 819 UNREACHABLE(); |
820 } | 820 } |
821 | 821 |
822 | 822 |
823 Handle<AccessorInfo> Accessors::ScriptEvalFromScriptPositionInfo( | 823 Handle<AccessorInfo> Accessors::ScriptEvalFromScriptPositionInfo( |
824 Isolate* isolate, PropertyAttributes attributes) { | 824 Isolate* isolate, PropertyAttributes attributes) { |
825 Handle<String> name(isolate->factory()->InternalizeOneByteString( | 825 Handle<String> name(isolate->factory()->InternalizeOneByteString( |
826 STATIC_ASCII_VECTOR("eval_from_script_position"))); | 826 STATIC_CHAR_VECTOR("eval_from_script_position"))); |
827 return MakeAccessor(isolate, | 827 return MakeAccessor(isolate, |
828 name, | 828 name, |
829 &ScriptEvalFromScriptPositionGetter, | 829 &ScriptEvalFromScriptPositionGetter, |
830 &ScriptEvalFromScriptPositionSetter, | 830 &ScriptEvalFromScriptPositionSetter, |
831 attributes); | 831 attributes); |
832 } | 832 } |
833 | 833 |
834 | 834 |
835 // | 835 // |
836 // Accessors::ScriptGetEvalFromFunctionName | 836 // Accessors::ScriptGetEvalFromFunctionName |
(...skipping 25 matching lines...) Expand all Loading... |
862 v8::Local<v8::Name> name, | 862 v8::Local<v8::Name> name, |
863 v8::Local<v8::Value> value, | 863 v8::Local<v8::Value> value, |
864 const v8::PropertyCallbackInfo<void>& info) { | 864 const v8::PropertyCallbackInfo<void>& info) { |
865 UNREACHABLE(); | 865 UNREACHABLE(); |
866 } | 866 } |
867 | 867 |
868 | 868 |
869 Handle<AccessorInfo> Accessors::ScriptEvalFromFunctionNameInfo( | 869 Handle<AccessorInfo> Accessors::ScriptEvalFromFunctionNameInfo( |
870 Isolate* isolate, PropertyAttributes attributes) { | 870 Isolate* isolate, PropertyAttributes attributes) { |
871 Handle<String> name(isolate->factory()->InternalizeOneByteString( | 871 Handle<String> name(isolate->factory()->InternalizeOneByteString( |
872 STATIC_ASCII_VECTOR("eval_from_function_name"))); | 872 STATIC_CHAR_VECTOR("eval_from_function_name"))); |
873 return MakeAccessor(isolate, | 873 return MakeAccessor(isolate, |
874 name, | 874 name, |
875 &ScriptEvalFromFunctionNameGetter, | 875 &ScriptEvalFromFunctionNameGetter, |
876 &ScriptEvalFromFunctionNameSetter, | 876 &ScriptEvalFromFunctionNameSetter, |
877 attributes); | 877 attributes); |
878 } | 878 } |
879 | 879 |
880 | 880 |
881 // | 881 // |
882 // Accessors::FunctionPrototype | 882 // Accessors::FunctionPrototype |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1413 info->set_data(Smi::FromInt(index)); | 1413 info->set_data(Smi::FromInt(index)); |
1414 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); | 1414 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); |
1415 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); | 1415 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); |
1416 info->set_getter(*getter); | 1416 info->set_getter(*getter); |
1417 if (!(attributes & ReadOnly)) info->set_setter(*setter); | 1417 if (!(attributes & ReadOnly)) info->set_setter(*setter); |
1418 return info; | 1418 return info; |
1419 } | 1419 } |
1420 | 1420 |
1421 | 1421 |
1422 } } // namespace v8::internal | 1422 } } // namespace v8::internal |
OLD | NEW |