OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2880 static inline InlineCacheState ExtractICStateFromFlags(Flags flags); | 2880 static inline InlineCacheState ExtractICStateFromFlags(Flags flags); |
2881 static inline InLoopFlag ExtractICInLoopFromFlags(Flags flags); | 2881 static inline InLoopFlag ExtractICInLoopFromFlags(Flags flags); |
2882 static inline PropertyType ExtractTypeFromFlags(Flags flags); | 2882 static inline PropertyType ExtractTypeFromFlags(Flags flags); |
2883 static inline int ExtractArgumentsCountFromFlags(Flags flags); | 2883 static inline int ExtractArgumentsCountFromFlags(Flags flags); |
2884 static inline InlineCacheHolderFlag ExtractCacheHolderFromFlags(Flags flags); | 2884 static inline InlineCacheHolderFlag ExtractCacheHolderFromFlags(Flags flags); |
2885 static inline Flags RemoveTypeFromFlags(Flags flags); | 2885 static inline Flags RemoveTypeFromFlags(Flags flags); |
2886 | 2886 |
2887 // Convert a target address into a code object. | 2887 // Convert a target address into a code object. |
2888 static inline Code* GetCodeFromTargetAddress(Address address); | 2888 static inline Code* GetCodeFromTargetAddress(Address address); |
2889 | 2889 |
| 2890 // Convert an entry address into an object. |
| 2891 static inline Object* GetObjectFromEntryAddress(Address location_of_address); |
| 2892 |
2890 // Returns the address of the first instruction. | 2893 // Returns the address of the first instruction. |
2891 inline byte* instruction_start(); | 2894 inline byte* instruction_start(); |
2892 | 2895 |
2893 // Returns the address right after the last instruction. | 2896 // Returns the address right after the last instruction. |
2894 inline byte* instruction_end(); | 2897 inline byte* instruction_end(); |
2895 | 2898 |
2896 // Returns the size of the instructions, padding, and relocation information. | 2899 // Returns the size of the instructions, padding, and relocation information. |
2897 inline int body_size(); | 2900 inline int body_size(); |
2898 | 2901 |
2899 // Returns the address of the first relocation info (read backwards!). | 2902 // Returns the address of the first relocation info (read backwards!). |
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3700 // set to 'value', but there is no guarantees on instances created | 3703 // set to 'value', but there is no guarantees on instances created |
3701 // before. | 3704 // before. |
3702 Object* SetInstanceClassName(String* name); | 3705 Object* SetInstanceClassName(String* name); |
3703 | 3706 |
3704 // Returns if this function has been compiled to native code yet. | 3707 // Returns if this function has been compiled to native code yet. |
3705 inline bool is_compiled(); | 3708 inline bool is_compiled(); |
3706 | 3709 |
3707 // Casting. | 3710 // Casting. |
3708 static inline JSFunction* cast(Object* obj); | 3711 static inline JSFunction* cast(Object* obj); |
3709 | 3712 |
| 3713 // Iterates the objects, including code objects indirectly referenced |
| 3714 // through pointers to the first instruction in the code object. |
| 3715 void JSFunctionIterateBody(int object_size, ObjectVisitor* v); |
| 3716 |
3710 // Dispatched behavior. | 3717 // Dispatched behavior. |
3711 #ifdef DEBUG | 3718 #ifdef DEBUG |
3712 void JSFunctionPrint(); | 3719 void JSFunctionPrint(); |
3713 void JSFunctionVerify(); | 3720 void JSFunctionVerify(); |
3714 #endif | 3721 #endif |
3715 | 3722 |
3716 // Returns the number of allocated literals. | 3723 // Returns the number of allocated literals. |
3717 inline int NumberOfLiterals(); | 3724 inline int NumberOfLiterals(); |
3718 | 3725 |
3719 // Retrieve the global context from a function's literal array. | 3726 // Retrieve the global context from a function's literal array. |
3720 static Context* GlobalContextFromLiterals(FixedArray* literals); | 3727 static Context* GlobalContextFromLiterals(FixedArray* literals); |
3721 | 3728 |
3722 // Layout descriptors. | 3729 // Layout descriptors. |
3723 static const int kCodeOffset = JSObject::kHeaderSize; | 3730 static const int kCodeEntryOffset = JSObject::kHeaderSize; |
3724 static const int kPrototypeOrInitialMapOffset = | 3731 static const int kPrototypeOrInitialMapOffset = |
3725 kCodeOffset + kPointerSize; | 3732 kCodeEntryOffset + kPointerSize; |
3726 static const int kSharedFunctionInfoOffset = | 3733 static const int kSharedFunctionInfoOffset = |
3727 kPrototypeOrInitialMapOffset + kPointerSize; | 3734 kPrototypeOrInitialMapOffset + kPointerSize; |
3728 static const int kContextOffset = kSharedFunctionInfoOffset + kPointerSize; | 3735 static const int kContextOffset = kSharedFunctionInfoOffset + kPointerSize; |
3729 static const int kLiteralsOffset = kContextOffset + kPointerSize; | 3736 static const int kLiteralsOffset = kContextOffset + kPointerSize; |
3730 static const int kSize = kLiteralsOffset + kPointerSize; | 3737 static const int kSize = kLiteralsOffset + kPointerSize; |
3731 | 3738 |
3732 // Layout of the literals array. | 3739 // Layout of the literals array. |
3733 static const int kLiteralsPrefixSize = 1; | 3740 static const int kLiteralsPrefixSize = 1; |
3734 static const int kLiteralGlobalContextIndex = 0; | 3741 static const int kLiteralGlobalContextIndex = 0; |
3735 private: | 3742 private: |
(...skipping 1694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5430 // Visits a contiguous arrays of pointers in the half-open range | 5437 // Visits a contiguous arrays of pointers in the half-open range |
5431 // [start, end). Any or all of the values may be modified on return. | 5438 // [start, end). Any or all of the values may be modified on return. |
5432 virtual void VisitPointers(Object** start, Object** end) = 0; | 5439 virtual void VisitPointers(Object** start, Object** end) = 0; |
5433 | 5440 |
5434 // To allow lazy clearing of inline caches the visitor has | 5441 // To allow lazy clearing of inline caches the visitor has |
5435 // a rich interface for iterating over Code objects.. | 5442 // a rich interface for iterating over Code objects.. |
5436 | 5443 |
5437 // Visits a code target in the instruction stream. | 5444 // Visits a code target in the instruction stream. |
5438 virtual void VisitCodeTarget(RelocInfo* rinfo); | 5445 virtual void VisitCodeTarget(RelocInfo* rinfo); |
5439 | 5446 |
| 5447 // Visits a code entry in a JS function. |
| 5448 virtual void VisitCodeEntry(Address entry_address); |
| 5449 |
5440 // Visits a runtime entry in the instruction stream. | 5450 // Visits a runtime entry in the instruction stream. |
5441 virtual void VisitRuntimeEntry(RelocInfo* rinfo) {} | 5451 virtual void VisitRuntimeEntry(RelocInfo* rinfo) {} |
5442 | 5452 |
5443 // Visits the resource of an ASCII or two-byte string. | 5453 // Visits the resource of an ASCII or two-byte string. |
5444 virtual void VisitExternalAsciiString( | 5454 virtual void VisitExternalAsciiString( |
5445 v8::String::ExternalAsciiStringResource** resource) {} | 5455 v8::String::ExternalAsciiStringResource** resource) {} |
5446 virtual void VisitExternalTwoByteString( | 5456 virtual void VisitExternalTwoByteString( |
5447 v8::String::ExternalStringResource** resource) {} | 5457 v8::String::ExternalStringResource** resource) {} |
5448 | 5458 |
5449 // Visits a debug call target in the instruction stream. | 5459 // Visits a debug call target in the instruction stream. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5502 } else { | 5512 } else { |
5503 value &= ~(1 << bit_position); | 5513 value &= ~(1 << bit_position); |
5504 } | 5514 } |
5505 return value; | 5515 return value; |
5506 } | 5516 } |
5507 }; | 5517 }; |
5508 | 5518 |
5509 } } // namespace v8::internal | 5519 } } // namespace v8::internal |
5510 | 5520 |
5511 #endif // V8_OBJECTS_H_ | 5521 #endif // V8_OBJECTS_H_ |
OLD | NEW |