| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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) |
| 5857 | 5861 |
| 5862 // [scope_info]: Scope info. |
| 5863 DECL_ACCESSORS(scope_info, ScopeInfo) |
| 5864 |
| 5858 // Casting. | 5865 // Casting. |
| 5859 static inline JSModule* cast(Object* obj); | 5866 static inline JSModule* cast(Object* obj); |
| 5860 | 5867 |
| 5861 // Dispatched behavior. | 5868 // Dispatched behavior. |
| 5862 #ifdef OBJECT_PRINT | 5869 #ifdef OBJECT_PRINT |
| 5863 inline void JSModulePrint() { | 5870 inline void JSModulePrint() { |
| 5864 JSModulePrint(stdout); | 5871 JSModulePrint(stdout); |
| 5865 } | 5872 } |
| 5866 void JSModulePrint(FILE* out); | 5873 void JSModulePrint(FILE* out); |
| 5867 #endif | 5874 #endif |
| 5868 #ifdef DEBUG | 5875 #ifdef DEBUG |
| 5869 void JSModuleVerify(); | 5876 void JSModuleVerify(); |
| 5870 #endif | 5877 #endif |
| 5871 | 5878 |
| 5872 // Layout description. | 5879 // Layout description. |
| 5873 static const int kContextOffset = JSObject::kHeaderSize; | 5880 static const int kContextOffset = JSObject::kHeaderSize; |
| 5874 static const int kSize = kContextOffset + kPointerSize; | 5881 static const int kScopeInfoOffset = kContextOffset + kPointerSize; |
| 5882 static const int kSize = kScopeInfoOffset + kPointerSize; |
| 5875 | 5883 |
| 5876 private: | 5884 private: |
| 5877 DISALLOW_IMPLICIT_CONSTRUCTORS(JSModule); | 5885 DISALLOW_IMPLICIT_CONSTRUCTORS(JSModule); |
| 5878 }; | 5886 }; |
| 5879 | 5887 |
| 5880 | 5888 |
| 5881 // JSFunction describes JavaScript functions. | 5889 // JSFunction describes JavaScript functions. |
| 5882 class JSFunction: public JSObject { | 5890 class JSFunction: public JSObject { |
| 5883 public: | 5891 public: |
| 5884 // [prototype_or_initial_map]: | 5892 // [prototype_or_initial_map]: |
| (...skipping 2929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8814 } else { | 8822 } else { |
| 8815 value &= ~(1 << bit_position); | 8823 value &= ~(1 << bit_position); |
| 8816 } | 8824 } |
| 8817 return value; | 8825 return value; |
| 8818 } | 8826 } |
| 8819 }; | 8827 }; |
| 8820 | 8828 |
| 8821 } } // namespace v8::internal | 8829 } } // namespace v8::internal |
| 8822 | 8830 |
| 8823 #endif // V8_OBJECTS_H_ | 8831 #endif // V8_OBJECTS_H_ |
| OLD | NEW |