| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 5010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5021 bool VerifyBailoutId(int id); | 5021 bool VerifyBailoutId(int id); |
| 5022 | 5022 |
| 5023 // Check whether a inlined constructor can be generated with the given | 5023 // Check whether a inlined constructor can be generated with the given |
| 5024 // prototype. | 5024 // prototype. |
| 5025 bool CanGenerateInlineConstructor(Object* prototype); | 5025 bool CanGenerateInlineConstructor(Object* prototype); |
| 5026 | 5026 |
| 5027 // Prevents further attempts to generate inline constructors. | 5027 // Prevents further attempts to generate inline constructors. |
| 5028 // To be called if generation failed for any reason. | 5028 // To be called if generation failed for any reason. |
| 5029 void ForbidInlineConstructor(); | 5029 void ForbidInlineConstructor(); |
| 5030 | 5030 |
| 5031 // Contains the number of AST nodes in the function or kAstNodeCountMask |
| 5032 // if the number of nodes is larger than kAstNodeCountMask. |
| 5033 // Returns 0 if the function was parsed lazily. |
| 5034 inline int ast_node_count(); |
| 5035 inline void set_ast_node_count(int age); |
| 5036 |
| 5037 // Indicates whether the function is primitive or not. See the comment of |
| 5038 // FunctionLiteral::is_primitive for definition of "primitive". |
| 5039 // Returns false if the function was parsed lazily. |
| 5040 DECL_BOOLEAN_ACCESSORS(is_primitive) |
| 5041 |
| 5031 // For functions which only contains this property assignments this provides | 5042 // For functions which only contains this property assignments this provides |
| 5032 // access to the names for the properties assigned. | 5043 // access to the names for the properties assigned. |
| 5033 DECL_ACCESSORS(this_property_assignments, Object) | 5044 DECL_ACCESSORS(this_property_assignments, Object) |
| 5034 inline int this_property_assignments_count(); | 5045 inline int this_property_assignments_count(); |
| 5035 inline void set_this_property_assignments_count(int value); | 5046 inline void set_this_property_assignments_count(int value); |
| 5036 String* GetThisPropertyAssignmentName(int index); | 5047 String* GetThisPropertyAssignmentName(int index); |
| 5037 bool IsThisPropertyAssignmentArgument(int index); | 5048 bool IsThisPropertyAssignmentArgument(int index); |
| 5038 int GetThisPropertyAssignmentArgument(int index); | 5049 int GetThisPropertyAssignmentArgument(int index); |
| 5039 Object* GetThisPropertyAssignmentConstant(int index); | 5050 Object* GetThisPropertyAssignmentConstant(int index); |
| 5040 | 5051 |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5184 // the start_position_and_type field. | 5195 // the start_position_and_type field. |
| 5185 static const int kIsExpressionBit = 0; | 5196 static const int kIsExpressionBit = 0; |
| 5186 static const int kIsTopLevelBit = 1; | 5197 static const int kIsTopLevelBit = 1; |
| 5187 static const int kStartPositionShift = 2; | 5198 static const int kStartPositionShift = 2; |
| 5188 static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1); | 5199 static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1); |
| 5189 | 5200 |
| 5190 // Bit positions in compiler_hints. | 5201 // Bit positions in compiler_hints. |
| 5191 static const int kCodeAgeSize = 3; | 5202 static const int kCodeAgeSize = 3; |
| 5192 static const int kCodeAgeMask = (1 << kCodeAgeSize) - 1; | 5203 static const int kCodeAgeMask = (1 << kCodeAgeSize) - 1; |
| 5193 | 5204 |
| 5205 // Make sure that kAstNodeCountMask > HGraphBuilder::kMaxInlinedSize. |
| 5206 static const int kAstNodeCountSize = 8; |
| 5207 static const int kAstNodeCountMask = (1 << kAstNodeCountSize) - 1; |
| 5208 |
| 5194 enum CompilerHints { | 5209 enum CompilerHints { |
| 5195 kHasOnlySimpleThisPropertyAssignments, | 5210 kHasOnlySimpleThisPropertyAssignments, |
| 5196 kAllowLazyCompilation, | 5211 kAllowLazyCompilation, |
| 5197 kLiveObjectsMayExist, | 5212 kLiveObjectsMayExist, |
| 5198 kCodeAgeShift, | 5213 kCodeAgeShift, |
| 5199 kOptimizationDisabled = kCodeAgeShift + kCodeAgeSize, | 5214 kOptimizationDisabled = kCodeAgeShift + kCodeAgeSize, |
| 5200 kStrictModeFunction, | 5215 kStrictModeFunction, |
| 5201 kUsesArguments, | 5216 kUsesArguments, |
| 5202 kHasDuplicateParameters, | 5217 kHasDuplicateParameters, |
| 5203 kNative, | 5218 kNative, |
| 5204 kBoundFunction, | 5219 kBoundFunction, |
| 5205 kIsAnonymous, | 5220 kIsAnonymous, |
| 5206 kNameShouldPrintAsAnonymous, | 5221 kNameShouldPrintAsAnonymous, |
| 5222 kAstNodeCountShift, |
| 5223 kIsPrimitive = kAstNodeCountShift + kAstNodeCountSize, |
| 5207 kCompilerHintsCount // Pseudo entry | 5224 kCompilerHintsCount // Pseudo entry |
| 5208 }; | 5225 }; |
| 5209 | 5226 |
| 5210 private: | 5227 private: |
| 5211 #if V8_HOST_ARCH_32_BIT | 5228 #if V8_HOST_ARCH_32_BIT |
| 5212 // On 32 bit platforms, compiler hints is a smi. | 5229 // On 32 bit platforms, compiler hints is a smi. |
| 5213 static const int kCompilerHintsSmiTagSize = kSmiTagSize; | 5230 static const int kCompilerHintsSmiTagSize = kSmiTagSize; |
| 5214 static const int kCompilerHintsSize = kPointerSize; | 5231 static const int kCompilerHintsSize = kPointerSize; |
| 5215 #else | 5232 #else |
| 5216 // On 64 bit platforms, compiler hints is not a smi, see comment above. | 5233 // On 64 bit platforms, compiler hints is not a smi, see comment above. |
| 5217 static const int kCompilerHintsSmiTagSize = 0; | 5234 static const int kCompilerHintsSmiTagSize = 0; |
| 5218 static const int kCompilerHintsSize = kIntSize; | 5235 static const int kCompilerHintsSize = kIntSize; |
| 5219 #endif | 5236 #endif |
| 5220 | 5237 |
| 5238 // One byte is reserved for the inobject slack counter. |
| 5221 STATIC_ASSERT(SharedFunctionInfo::kCompilerHintsCount <= | 5239 STATIC_ASSERT(SharedFunctionInfo::kCompilerHintsCount <= |
| 5222 SharedFunctionInfo::kCompilerHintsSize * kBitsPerByte); | 5240 (SharedFunctionInfo::kCompilerHintsSize - 1) * kBitsPerByte); |
| 5223 | 5241 |
| 5224 public: | 5242 public: |
| 5225 // Constants for optimizing codegen for strict mode function and | 5243 // Constants for optimizing codegen for strict mode function and |
| 5226 // native tests. | 5244 // native tests. |
| 5227 // Allows to use byte-width instructions. | 5245 // Allows to use byte-width instructions. |
| 5228 static const int kStrictModeBitWithinByte = | 5246 static const int kStrictModeBitWithinByte = |
| 5229 (kStrictModeFunction + kCompilerHintsSmiTagSize) % kBitsPerByte; | 5247 (kStrictModeFunction + kCompilerHintsSmiTagSize) % kBitsPerByte; |
| 5230 | 5248 |
| 5231 static const int kNativeBitWithinByte = | 5249 static const int kNativeBitWithinByte = |
| 5232 (kNative + kCompilerHintsSmiTagSize) % kBitsPerByte; | 5250 (kNative + kCompilerHintsSmiTagSize) % kBitsPerByte; |
| (...skipping 2651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7884 } else { | 7902 } else { |
| 7885 value &= ~(1 << bit_position); | 7903 value &= ~(1 << bit_position); |
| 7886 } | 7904 } |
| 7887 return value; | 7905 return value; |
| 7888 } | 7906 } |
| 7889 }; | 7907 }; |
| 7890 | 7908 |
| 7891 } } // namespace v8::internal | 7909 } } // namespace v8::internal |
| 7892 | 7910 |
| 7893 #endif // V8_OBJECTS_H_ | 7911 #endif // V8_OBJECTS_H_ |
| OLD | NEW |