OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 3512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3523 } | 3523 } |
3524 FOR_EACH_NUMERIC_FIELD(FIELD_ACCESSORS) | 3524 FOR_EACH_NUMERIC_FIELD(FIELD_ACCESSORS) |
3525 #undef FIELD_ACCESSORS | 3525 #undef FIELD_ACCESSORS |
3526 | 3526 |
3527 private: | 3527 private: |
3528 enum { | 3528 enum { |
3529 #define DECL_INDEX(name) k##name, | 3529 #define DECL_INDEX(name) k##name, |
3530 FOR_EACH_NUMERIC_FIELD(DECL_INDEX) | 3530 FOR_EACH_NUMERIC_FIELD(DECL_INDEX) |
3531 #undef DECL_INDEX | 3531 #undef DECL_INDEX |
3532 #undef FOR_EACH_NUMERIC_FIELD | 3532 #undef FOR_EACH_NUMERIC_FIELD |
3533 kVariablePartIndex | 3533 kVariablePartIndex |
3534 }; | 3534 }; |
3535 | 3535 |
3536 // The layout of the variable part of a ScopeInfo is as follows: | 3536 // The layout of the variable part of a ScopeInfo is as follows: |
3537 // 1. ParameterEntries: | 3537 // 1. ParameterEntries: |
3538 // This part stores the names of the parameters for function scopes. One | 3538 // This part stores the names of the parameters for function scopes. One |
3539 // slot is used per parameter, so in total this part occupies | 3539 // slot is used per parameter, so in total this part occupies |
3540 // ParameterCount() slots in the array. For other scopes than function | 3540 // ParameterCount() slots in the array. For other scopes than function |
3541 // scopes ParameterCount() is 0. | 3541 // scopes ParameterCount() is 0. |
3542 // 2. StackLocalEntries: | 3542 // 2. StackLocalEntries: |
3543 // Contains the names of local variables that are allocated on the stack, | 3543 // Contains the names of local variables that are allocated on the stack, |
(...skipping 2004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5548 | 5548 |
5549 // Is this a function or top-level/eval code. | 5549 // Is this a function or top-level/eval code. |
5550 DECL_BOOLEAN_ACCESSORS(is_function) | 5550 DECL_BOOLEAN_ACCESSORS(is_function) |
5551 | 5551 |
5552 // Indicates that the function cannot be optimized. | 5552 // Indicates that the function cannot be optimized. |
5553 DECL_BOOLEAN_ACCESSORS(dont_optimize) | 5553 DECL_BOOLEAN_ACCESSORS(dont_optimize) |
5554 | 5554 |
5555 // Indicates that the function cannot be inlined. | 5555 // Indicates that the function cannot be inlined. |
5556 DECL_BOOLEAN_ACCESSORS(dont_inline) | 5556 DECL_BOOLEAN_ACCESSORS(dont_inline) |
5557 | 5557 |
5558 // Indicates that code for this function cannot be cached. | |
5559 DECL_BOOLEAN_ACCESSORS(dont_cache) | |
5560 | |
5558 // Indicates whether or not the code in the shared function support | 5561 // Indicates whether or not the code in the shared function support |
5559 // deoptimization. | 5562 // deoptimization. |
5560 inline bool has_deoptimization_support(); | 5563 inline bool has_deoptimization_support(); |
5561 | 5564 |
5562 // Enable deoptimization support through recompiled code. | 5565 // Enable deoptimization support through recompiled code. |
5563 void EnableDeoptimizationSupport(Code* recompiled); | 5566 void EnableDeoptimizationSupport(Code* recompiled); |
5564 | 5567 |
5565 // Disable (further) attempted optimization of all functions sharing this | 5568 // Disable (further) attempted optimization of all functions sharing this |
5566 // shared function info. | 5569 // shared function info. |
5567 void DisableOptimization(); | 5570 void DisableOptimization(); |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5782 kExtendedModeFunction, | 5785 kExtendedModeFunction, |
5783 kUsesArguments, | 5786 kUsesArguments, |
5784 kHasDuplicateParameters, | 5787 kHasDuplicateParameters, |
5785 kNative, | 5788 kNative, |
5786 kBoundFunction, | 5789 kBoundFunction, |
5787 kIsAnonymous, | 5790 kIsAnonymous, |
5788 kNameShouldPrintAsAnonymous, | 5791 kNameShouldPrintAsAnonymous, |
5789 kIsFunction, | 5792 kIsFunction, |
5790 kDontOptimize, | 5793 kDontOptimize, |
5791 kDontInline, | 5794 kDontInline, |
5795 kDontCache, | |
5792 kCompilerHintsCount // Pseudo entry | 5796 kCompilerHintsCount // Pseudo entry |
5793 }; | 5797 }; |
5794 | 5798 |
5795 class DeoptCountBits: public BitField<int, 0, 4> {}; | 5799 class DeoptCountBits: public BitField<int, 0, 4> {}; |
5796 class OptReenableTriesBits: public BitField<int, 4, 18> {}; | 5800 class OptReenableTriesBits: public BitField<int, 4, 18> {}; |
5797 class ICAgeBits: public BitField<int, 22, 8> {}; | 5801 class ICAgeBits: public BitField<int, 22, 8> {}; |
5798 | 5802 |
5799 private: | 5803 private: |
5800 #if V8_HOST_ARCH_32_BIT | 5804 #if V8_HOST_ARCH_32_BIT |
5801 // On 32 bit platforms, compiler hints is a smi. | 5805 // On 32 bit platforms, compiler hints is a smi. |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5847 private: | 5851 private: |
5848 DISALLOW_IMPLICIT_CONSTRUCTORS(SharedFunctionInfo); | 5852 DISALLOW_IMPLICIT_CONSTRUCTORS(SharedFunctionInfo); |
5849 }; | 5853 }; |
5850 | 5854 |
5851 | 5855 |
5852 // Representation for module instance objects. | 5856 // Representation for module instance objects. |
5853 class JSModule: public JSObject { | 5857 class JSModule: public JSObject { |
5854 public: | 5858 public: |
5855 // [context]: the context holding the module's locals, or undefined if none. | 5859 // [context]: the context holding the module's locals, or undefined if none. |
5856 DECL_ACCESSORS(context, Object) | 5860 DECL_ACCESSORS(context, Object) |
5861 // [scope_info]: Scope info. | |
Michael Starzinger
2012/07/06 10:53:22
Empty newline between accessors.
rossberg
2012/07/06 15:39:28
Done.
| |
5862 DECL_ACCESSORS(scope_info, ScopeInfo) | |
5857 | 5863 |
5858 // Casting. | 5864 // Casting. |
5859 static inline JSModule* cast(Object* obj); | 5865 static inline JSModule* cast(Object* obj); |
5860 | 5866 |
5861 // Dispatched behavior. | 5867 // Dispatched behavior. |
5862 #ifdef OBJECT_PRINT | 5868 #ifdef OBJECT_PRINT |
5863 inline void JSModulePrint() { | 5869 inline void JSModulePrint() { |
5864 JSModulePrint(stdout); | 5870 JSModulePrint(stdout); |
5865 } | 5871 } |
5866 void JSModulePrint(FILE* out); | 5872 void JSModulePrint(FILE* out); |
5867 #endif | 5873 #endif |
5868 #ifdef DEBUG | 5874 #ifdef DEBUG |
5869 void JSModuleVerify(); | 5875 void JSModuleVerify(); |
5870 #endif | 5876 #endif |
5871 | 5877 |
5872 // Layout description. | 5878 // Layout description. |
5873 static const int kContextOffset = JSObject::kHeaderSize; | 5879 static const int kContextOffset = JSObject::kHeaderSize; |
5874 static const int kSize = kContextOffset + kPointerSize; | 5880 static const int kScopeInfoOffset = kContextOffset + kPointerSize; |
5881 static const int kSize = kScopeInfoOffset + kPointerSize; | |
5875 | 5882 |
5876 private: | 5883 private: |
5877 DISALLOW_IMPLICIT_CONSTRUCTORS(JSModule); | 5884 DISALLOW_IMPLICIT_CONSTRUCTORS(JSModule); |
5878 }; | 5885 }; |
5879 | 5886 |
5880 | 5887 |
5881 // JSFunction describes JavaScript functions. | 5888 // JSFunction describes JavaScript functions. |
5882 class JSFunction: public JSObject { | 5889 class JSFunction: public JSObject { |
5883 public: | 5890 public: |
5884 // [prototype_or_initial_map]: | 5891 // [prototype_or_initial_map]: |
(...skipping 2929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8814 } else { | 8821 } else { |
8815 value &= ~(1 << bit_position); | 8822 value &= ~(1 << bit_position); |
8816 } | 8823 } |
8817 return value; | 8824 return value; |
8818 } | 8825 } |
8819 }; | 8826 }; |
8820 | 8827 |
8821 } } // namespace v8::internal | 8828 } } // namespace v8::internal |
8822 | 8829 |
8823 #endif // V8_OBJECTS_H_ | 8830 #endif // V8_OBJECTS_H_ |
OLD | NEW |