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 2985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2996 // [wrapper]: the wrapper cache. | 2996 // [wrapper]: the wrapper cache. |
2997 DECL_ACCESSORS(wrapper, Proxy) | 2997 DECL_ACCESSORS(wrapper, Proxy) |
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_fixed_array, Object) | 3006 DECL_ACCESSORS(line_ends, Object) |
3007 | |
3008 // [line_ends]: JSArray of line ends positions. | |
3009 DECL_ACCESSORS(line_ends_js_array, Object) | |
3010 | 3007 |
3011 // [eval_from_function]: for eval scripts the funcion from which eval was | 3008 // [eval_from_function]: for eval scripts the funcion from which eval was |
3012 // called. | 3009 // called. |
3013 DECL_ACCESSORS(eval_from_function, Object) | 3010 DECL_ACCESSORS(eval_from_function, Object) |
3014 | 3011 |
3015 // [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 |
3016 // function from which eval was called where eval was called. | 3013 // function from which eval was called where eval was called. |
3017 DECL_ACCESSORS(eval_from_instructions_offset, Smi) | 3014 DECL_ACCESSORS(eval_from_instructions_offset, Smi) |
3018 | 3015 |
3019 static inline Script* cast(Object* obj); | 3016 static inline Script* cast(Object* obj); |
3020 | 3017 |
3021 // If script source is an external string, check that the underlying | 3018 // If script source is an external string, check that the underlying |
3022 // resource is accessible. Otherwise, always return true. | 3019 // resource is accessible. Otherwise, always return true. |
3023 inline bool HasValidSource(); | 3020 inline bool HasValidSource(); |
3024 | 3021 |
3025 #ifdef DEBUG | 3022 #ifdef DEBUG |
3026 void ScriptPrint(); | 3023 void ScriptPrint(); |
3027 void ScriptVerify(); | 3024 void ScriptVerify(); |
3028 #endif | 3025 #endif |
3029 | 3026 |
3030 static const int kSourceOffset = HeapObject::kHeaderSize; | 3027 static const int kSourceOffset = HeapObject::kHeaderSize; |
3031 static const int kNameOffset = kSourceOffset + kPointerSize; | 3028 static const int kNameOffset = kSourceOffset + kPointerSize; |
3032 static const int kLineOffsetOffset = kNameOffset + kPointerSize; | 3029 static const int kLineOffsetOffset = kNameOffset + kPointerSize; |
3033 static const int kColumnOffsetOffset = kLineOffsetOffset + kPointerSize; | 3030 static const int kColumnOffsetOffset = kLineOffsetOffset + kPointerSize; |
3034 static const int kDataOffset = kColumnOffsetOffset + kPointerSize; | 3031 static const int kDataOffset = kColumnOffsetOffset + kPointerSize; |
3035 static const int kContextOffset = kDataOffset + kPointerSize; | 3032 static const int kContextOffset = kDataOffset + kPointerSize; |
3036 static const int kWrapperOffset = kContextOffset + kPointerSize; | 3033 static const int kWrapperOffset = kContextOffset + kPointerSize; |
3037 static const int kTypeOffset = kWrapperOffset + kPointerSize; | 3034 static const int kTypeOffset = kWrapperOffset + kPointerSize; |
3038 static const int kCompilationTypeOffset = kTypeOffset + kPointerSize; | 3035 static const int kCompilationTypeOffset = kTypeOffset + kPointerSize; |
3039 // We have the line ends array both in FixedArray form and in JSArray form. | 3036 static const int kLineEndsOffset = kCompilationTypeOffset + kPointerSize; |
3040 // The FixedArray form is useful when we don't have a context and so can't | 3037 static const int kIdOffset = kLineEndsOffset + kPointerSize; |
3041 // create a JSArray. The JSArray form is useful when we want to see the | |
3042 // array from JS code (e.g. debug-delay.js) which cannot handle unboxed | |
3043 // FixedArray objects. | |
3044 static const int kLineEndsFixedArrayOffset = | |
3045 kCompilationTypeOffset + kPointerSize; | |
3046 static const int kLineEndsJSArrayOffset = | |
3047 kLineEndsFixedArrayOffset + kPointerSize; | |
3048 static const int kIdOffset = kLineEndsJSArrayOffset + kPointerSize; | |
3049 static const int kEvalFromFunctionOffset = kIdOffset + kPointerSize; | 3038 static const int kEvalFromFunctionOffset = kIdOffset + kPointerSize; |
3050 static const int kEvalFrominstructionsOffsetOffset = | 3039 static const int kEvalFrominstructionsOffsetOffset = |
3051 kEvalFromFunctionOffset + kPointerSize; | 3040 kEvalFromFunctionOffset + kPointerSize; |
3052 static const int kSize = kEvalFrominstructionsOffsetOffset + kPointerSize; | 3041 static const int kSize = kEvalFrominstructionsOffsetOffset + kPointerSize; |
3053 | 3042 |
3054 private: | 3043 private: |
3055 DISALLOW_IMPLICIT_CONSTRUCTORS(Script); | 3044 DISALLOW_IMPLICIT_CONSTRUCTORS(Script); |
3056 }; | 3045 }; |
3057 | 3046 |
3058 | 3047 |
(...skipping 1815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4874 } else { | 4863 } else { |
4875 value &= ~(1 << bit_position); | 4864 value &= ~(1 << bit_position); |
4876 } | 4865 } |
4877 return value; | 4866 return value; |
4878 } | 4867 } |
4879 }; | 4868 }; |
4880 | 4869 |
4881 } } // namespace v8::internal | 4870 } } // namespace v8::internal |
4882 | 4871 |
4883 #endif // V8_OBJECTS_H_ | 4872 #endif // V8_OBJECTS_H_ |
OLD | NEW |