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 2987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2998 | 2998 |
2999 // [type]: the script type. | 2999 // [type]: the script type. |
3000 DECL_ACCESSORS(type, Smi) | 3000 DECL_ACCESSORS(type, Smi) |
3001 | 3001 |
3002 // [compilation]: how the the script was compiled. | 3002 // [compilation]: how the the script was compiled. |
3003 DECL_ACCESSORS(compilation_type, Smi) | 3003 DECL_ACCESSORS(compilation_type, Smi) |
3004 | 3004 |
3005 // [line_ends]: FixedArray of line ends positions. | 3005 // [line_ends]: FixedArray of line ends positions. |
3006 DECL_ACCESSORS(line_ends, Object) | 3006 DECL_ACCESSORS(line_ends, Object) |
3007 | 3007 |
3008 // [eval_from_function]: for eval scripts the funcion from which eval was | 3008 // [eval_from_shared]: for eval scripts the shared funcion info for the |
3009 // called. | 3009 // function from which eval was called. |
3010 DECL_ACCESSORS(eval_from_function, Object) | 3010 DECL_ACCESSORS(eval_from_shared, Object) |
3011 | 3011 |
3012 // [eval_from_instructions_offset]: the instruction offset in the code for the | 3012 // [eval_from_instructions_offset]: the instruction offset in the code for the |
3013 // function from which eval was called where eval was called. | 3013 // function from which eval was called where eval was called. |
3014 DECL_ACCESSORS(eval_from_instructions_offset, Smi) | 3014 DECL_ACCESSORS(eval_from_instructions_offset, Smi) |
3015 | 3015 |
3016 static inline Script* cast(Object* obj); | 3016 static inline Script* cast(Object* obj); |
3017 | 3017 |
3018 // If script source is an external string, check that the underlying | 3018 // If script source is an external string, check that the underlying |
3019 // resource is accessible. Otherwise, always return true. | 3019 // resource is accessible. Otherwise, always return true. |
3020 inline bool HasValidSource(); | 3020 inline bool HasValidSource(); |
3021 | 3021 |
3022 #ifdef DEBUG | 3022 #ifdef DEBUG |
3023 void ScriptPrint(); | 3023 void ScriptPrint(); |
3024 void ScriptVerify(); | 3024 void ScriptVerify(); |
3025 #endif | 3025 #endif |
3026 | 3026 |
3027 static const int kSourceOffset = HeapObject::kHeaderSize; | 3027 static const int kSourceOffset = HeapObject::kHeaderSize; |
3028 static const int kNameOffset = kSourceOffset + kPointerSize; | 3028 static const int kNameOffset = kSourceOffset + kPointerSize; |
3029 static const int kLineOffsetOffset = kNameOffset + kPointerSize; | 3029 static const int kLineOffsetOffset = kNameOffset + kPointerSize; |
3030 static const int kColumnOffsetOffset = kLineOffsetOffset + kPointerSize; | 3030 static const int kColumnOffsetOffset = kLineOffsetOffset + kPointerSize; |
3031 static const int kDataOffset = kColumnOffsetOffset + kPointerSize; | 3031 static const int kDataOffset = kColumnOffsetOffset + kPointerSize; |
3032 static const int kContextOffset = kDataOffset + kPointerSize; | 3032 static const int kContextOffset = kDataOffset + kPointerSize; |
3033 static const int kWrapperOffset = kContextOffset + kPointerSize; | 3033 static const int kWrapperOffset = kContextOffset + kPointerSize; |
3034 static const int kTypeOffset = kWrapperOffset + kPointerSize; | 3034 static const int kTypeOffset = kWrapperOffset + kPointerSize; |
3035 static const int kCompilationTypeOffset = kTypeOffset + kPointerSize; | 3035 static const int kCompilationTypeOffset = kTypeOffset + kPointerSize; |
3036 static const int kLineEndsOffset = kCompilationTypeOffset + kPointerSize; | 3036 static const int kLineEndsOffset = kCompilationTypeOffset + kPointerSize; |
3037 static const int kIdOffset = kLineEndsOffset + kPointerSize; | 3037 static const int kIdOffset = kLineEndsOffset + kPointerSize; |
3038 static const int kEvalFromFunctionOffset = kIdOffset + kPointerSize; | 3038 static const int kEvalFromSharedOffset = kIdOffset + kPointerSize; |
3039 static const int kEvalFrominstructionsOffsetOffset = | 3039 static const int kEvalFrominstructionsOffsetOffset = |
3040 kEvalFromFunctionOffset + kPointerSize; | 3040 kEvalFromSharedOffset + kPointerSize; |
3041 static const int kSize = kEvalFrominstructionsOffsetOffset + kPointerSize; | 3041 static const int kSize = kEvalFrominstructionsOffsetOffset + kPointerSize; |
3042 | 3042 |
3043 private: | 3043 private: |
3044 DISALLOW_IMPLICIT_CONSTRUCTORS(Script); | 3044 DISALLOW_IMPLICIT_CONSTRUCTORS(Script); |
3045 }; | 3045 }; |
3046 | 3046 |
3047 | 3047 |
3048 // SharedFunctionInfo describes the JSFunction information that can be | 3048 // SharedFunctionInfo describes the JSFunction information that can be |
3049 // shared by multiple instances of the function. | 3049 // shared by multiple instances of the function. |
3050 class SharedFunctionInfo: public HeapObject { | 3050 class SharedFunctionInfo: public HeapObject { |
(...skipping 1812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4863 } else { | 4863 } else { |
4864 value &= ~(1 << bit_position); | 4864 value &= ~(1 << bit_position); |
4865 } | 4865 } |
4866 return value; | 4866 return value; |
4867 } | 4867 } |
4868 }; | 4868 }; |
4869 | 4869 |
4870 } } // namespace v8::internal | 4870 } } // namespace v8::internal |
4871 | 4871 |
4872 #endif // V8_OBJECTS_H_ | 4872 #endif // V8_OBJECTS_H_ |
OLD | NEW |