Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(437)

Side by Side Diff: src/objects.h

Issue 8700001: Relax inlining limits for simple leaf functions (second version). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/isolate.h ('k') | src/objects-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 inline int ast_node_count();
5034 inline void set_ast_node_count(int age);
5035
5036 // Indicates whether the function is primitive or not.
5037 DECL_BOOLEAN_ACCESSORS(is_primitive)
5038
5039 DECL_BOOLEAN_ACCESSORS(is_inlineable)
5040
5031 // For functions which only contains this property assignments this provides 5041 // For functions which only contains this property assignments this provides
5032 // access to the names for the properties assigned. 5042 // access to the names for the properties assigned.
5033 DECL_ACCESSORS(this_property_assignments, Object) 5043 DECL_ACCESSORS(this_property_assignments, Object)
5034 inline int this_property_assignments_count(); 5044 inline int this_property_assignments_count();
5035 inline void set_this_property_assignments_count(int value); 5045 inline void set_this_property_assignments_count(int value);
5036 String* GetThisPropertyAssignmentName(int index); 5046 String* GetThisPropertyAssignmentName(int index);
5037 bool IsThisPropertyAssignmentArgument(int index); 5047 bool IsThisPropertyAssignmentArgument(int index);
5038 int GetThisPropertyAssignmentArgument(int index); 5048 int GetThisPropertyAssignmentArgument(int index);
5039 Object* GetThisPropertyAssignmentConstant(int index); 5049 Object* GetThisPropertyAssignmentConstant(int index);
5040 5050
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
5184 // the start_position_and_type field. 5194 // the start_position_and_type field.
5185 static const int kIsExpressionBit = 0; 5195 static const int kIsExpressionBit = 0;
5186 static const int kIsTopLevelBit = 1; 5196 static const int kIsTopLevelBit = 1;
5187 static const int kStartPositionShift = 2; 5197 static const int kStartPositionShift = 2;
5188 static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1); 5198 static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1);
5189 5199
5190 // Bit positions in compiler_hints. 5200 // Bit positions in compiler_hints.
5191 static const int kCodeAgeSize = 3; 5201 static const int kCodeAgeSize = 3;
5192 static const int kCodeAgeMask = (1 << kCodeAgeSize) - 1; 5202 static const int kCodeAgeMask = (1 << kCodeAgeSize) - 1;
5193 5203
5204 // Make sure that kAstNodeCountMask > HGraphBuilder::kMaxInlinedSize.
5205 static const int kAstNodeCountSize = 8;
5206 static const int kAstNodeCountMask = (1 << kAstNodeCountSize) - 1;
5207
5194 enum CompilerHints { 5208 enum CompilerHints {
5195 kHasOnlySimpleThisPropertyAssignments, 5209 kHasOnlySimpleThisPropertyAssignments,
5196 kAllowLazyCompilation, 5210 kAllowLazyCompilation,
5197 kLiveObjectsMayExist, 5211 kLiveObjectsMayExist,
5198 kCodeAgeShift, 5212 kCodeAgeShift,
5199 kOptimizationDisabled = kCodeAgeShift + kCodeAgeSize, 5213 kOptimizationDisabled = kCodeAgeShift + kCodeAgeSize,
5200 kStrictModeFunction, 5214 kStrictModeFunction,
5201 kUsesArguments, 5215 kUsesArguments,
5202 kHasDuplicateParameters, 5216 kHasDuplicateParameters,
5203 kNative, 5217 kNative,
5204 kBoundFunction, 5218 kBoundFunction,
5205 kIsAnonymous, 5219 kIsAnonymous,
5206 kNameShouldPrintAsAnonymous, 5220 kNameShouldPrintAsAnonymous,
5221 kIsInlineable,
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
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_
OLDNEW
« no previous file with comments | « src/isolate.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698