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

Side by Side Diff: src/objects.h

Issue 9221011: Collect AstNode type information (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: refactor to AstVisitor approach Created 8 years, 10 months 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
OLDNEW
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 5179 matching lines...) Expand 10 before | Expand all | Expand 10 after
5190 // Bit field containing various information collected by the compiler to 5190 // Bit field containing various information collected by the compiler to
5191 // drive optimization. 5191 // drive optimization.
5192 inline int compiler_hints(); 5192 inline int compiler_hints();
5193 inline void set_compiler_hints(int value); 5193 inline void set_compiler_hints(int value);
5194 5194
5195 // A counter used to determine when to stress the deoptimizer with a 5195 // A counter used to determine when to stress the deoptimizer with a
5196 // deopt. 5196 // deopt.
5197 inline Smi* deopt_counter(); 5197 inline Smi* deopt_counter();
5198 inline void set_deopt_counter(Smi* counter); 5198 inline void set_deopt_counter(Smi* counter);
5199 5199
5200 inline int ast_node_count();
5201 inline void set_ast_node_count(int count);
5202
5200 // Add information on assignments of the form this.x = ...; 5203 // Add information on assignments of the form this.x = ...;
5201 void SetThisPropertyAssignmentsInfo( 5204 void SetThisPropertyAssignmentsInfo(
5202 bool has_only_simple_this_property_assignments, 5205 bool has_only_simple_this_property_assignments,
5203 FixedArray* this_property_assignments); 5206 FixedArray* this_property_assignments);
5204 5207
5205 // Clear information on assignments of the form this.x = ...; 5208 // Clear information on assignments of the form this.x = ...;
5206 void ClearThisPropertyAssignmentsInfo(); 5209 void ClearThisPropertyAssignmentsInfo();
5207 5210
5208 // Indicate that this function only consists of assignments of the form 5211 // Indicate that this function only consists of assignments of the form
5209 // this.x = y; where y is either a constant or refers to an argument. 5212 // this.x = y; where y is either a constant or refers to an argument.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
5262 DECL_BOOLEAN_ACCESSORS(name_should_print_as_anonymous) 5265 DECL_BOOLEAN_ACCESSORS(name_should_print_as_anonymous)
5263 5266
5264 // Indicates whether the function is a bound function created using 5267 // Indicates whether the function is a bound function created using
5265 // the bind function. 5268 // the bind function.
5266 DECL_BOOLEAN_ACCESSORS(bound) 5269 DECL_BOOLEAN_ACCESSORS(bound)
5267 5270
5268 // Indicates that the function is anonymous (the name field can be set 5271 // Indicates that the function is anonymous (the name field can be set
5269 // through the API, which does not change this flag). 5272 // through the API, which does not change this flag).
5270 DECL_BOOLEAN_ACCESSORS(is_anonymous) 5273 DECL_BOOLEAN_ACCESSORS(is_anonymous)
5271 5274
5275 // Indicates that the function cannot be crankshafted.
5276 DECL_BOOLEAN_ACCESSORS(dont_crankshaft)
5277
5278 // Indicates that the function cannot be inlined.
5279 DECL_BOOLEAN_ACCESSORS(dont_inline)
5280
5272 // Indicates whether or not the code in the shared function support 5281 // Indicates whether or not the code in the shared function support
5273 // deoptimization. 5282 // deoptimization.
5274 inline bool has_deoptimization_support(); 5283 inline bool has_deoptimization_support();
5275 5284
5276 // Enable deoptimization support through recompiled code. 5285 // Enable deoptimization support through recompiled code.
5277 void EnableDeoptimizationSupport(Code* recompiled); 5286 void EnableDeoptimizationSupport(Code* recompiled);
5278 5287
5279 // Disable (further) attempted optimization of all functions sharing this 5288 // Disable (further) attempted optimization of all functions sharing this
5280 // shared function info. The function is the one we actually tried to 5289 // shared function info. The function is the one we actually tried to
5281 // optimize. 5290 // optimize.
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
5358 kInstanceClassNameOffset + kPointerSize; 5367 kInstanceClassNameOffset + kPointerSize;
5359 static const int kScriptOffset = kFunctionDataOffset + kPointerSize; 5368 static const int kScriptOffset = kFunctionDataOffset + kPointerSize;
5360 static const int kDebugInfoOffset = kScriptOffset + kPointerSize; 5369 static const int kDebugInfoOffset = kScriptOffset + kPointerSize;
5361 static const int kInferredNameOffset = kDebugInfoOffset + kPointerSize; 5370 static const int kInferredNameOffset = kDebugInfoOffset + kPointerSize;
5362 static const int kInitialMapOffset = 5371 static const int kInitialMapOffset =
5363 kInferredNameOffset + kPointerSize; 5372 kInferredNameOffset + kPointerSize;
5364 static const int kThisPropertyAssignmentsOffset = 5373 static const int kThisPropertyAssignmentsOffset =
5365 kInitialMapOffset + kPointerSize; 5374 kInitialMapOffset + kPointerSize;
5366 static const int kDeoptCounterOffset = 5375 static const int kDeoptCounterOffset =
5367 kThisPropertyAssignmentsOffset + kPointerSize; 5376 kThisPropertyAssignmentsOffset + kPointerSize;
5377 static const int kAstNodeCountOffset = kDeoptCounterOffset + kPointerSize;
5368 #if V8_HOST_ARCH_32_BIT 5378 #if V8_HOST_ARCH_32_BIT
5369 // Smi fields. 5379 // Smi fields.
5370 static const int kLengthOffset = 5380 static const int kLengthOffset =
5371 kDeoptCounterOffset + kPointerSize; 5381 kAstNodeCountOffset + kPointerSize;
5372 static const int kFormalParameterCountOffset = kLengthOffset + kPointerSize; 5382 static const int kFormalParameterCountOffset = kLengthOffset + kPointerSize;
5373 static const int kExpectedNofPropertiesOffset = 5383 static const int kExpectedNofPropertiesOffset =
5374 kFormalParameterCountOffset + kPointerSize; 5384 kFormalParameterCountOffset + kPointerSize;
5375 static const int kNumLiteralsOffset = 5385 static const int kNumLiteralsOffset =
5376 kExpectedNofPropertiesOffset + kPointerSize; 5386 kExpectedNofPropertiesOffset + kPointerSize;
5377 static const int kStartPositionAndTypeOffset = 5387 static const int kStartPositionAndTypeOffset =
5378 kNumLiteralsOffset + kPointerSize; 5388 kNumLiteralsOffset + kPointerSize;
5379 static const int kEndPositionOffset = 5389 static const int kEndPositionOffset =
5380 kStartPositionAndTypeOffset + kPointerSize; 5390 kStartPositionAndTypeOffset + kPointerSize;
5381 static const int kFunctionTokenPositionOffset = 5391 static const int kFunctionTokenPositionOffset =
(...skipping 10 matching lines...) Expand all
5392 // The only reason to use smi fields instead of int fields 5402 // The only reason to use smi fields instead of int fields
5393 // is to allow iteration without maps decoding during 5403 // is to allow iteration without maps decoding during
5394 // garbage collections. 5404 // garbage collections.
5395 // To avoid wasting space on 64-bit architectures we use 5405 // To avoid wasting space on 64-bit architectures we use
5396 // the following trick: we group integer fields into pairs 5406 // the following trick: we group integer fields into pairs
5397 // First integer in each pair is shifted left by 1. 5407 // First integer in each pair is shifted left by 1.
5398 // By doing this we guarantee that LSB of each kPointerSize aligned 5408 // By doing this we guarantee that LSB of each kPointerSize aligned
5399 // word is not set and thus this word cannot be treated as pointer 5409 // word is not set and thus this word cannot be treated as pointer
5400 // to HeapObject during old space traversal. 5410 // to HeapObject during old space traversal.
5401 static const int kLengthOffset = 5411 static const int kLengthOffset =
5402 kDeoptCounterOffset + kPointerSize; 5412 kAstNodeCountOffset + kPointerSize;
fschneider 2012/01/30 13:54:26 You could reduce the x64 version by pairing two pr
Jakob Kummerow 2012/02/01 14:46:09 Done.
5403 static const int kFormalParameterCountOffset = 5413 static const int kFormalParameterCountOffset =
5404 kLengthOffset + kIntSize; 5414 kLengthOffset + kIntSize;
5405 5415
5406 static const int kExpectedNofPropertiesOffset = 5416 static const int kExpectedNofPropertiesOffset =
5407 kFormalParameterCountOffset + kIntSize; 5417 kFormalParameterCountOffset + kIntSize;
5408 static const int kNumLiteralsOffset = 5418 static const int kNumLiteralsOffset =
5409 kExpectedNofPropertiesOffset + kIntSize; 5419 kExpectedNofPropertiesOffset + kIntSize;
5410 5420
5411 static const int kEndPositionOffset = 5421 static const int kEndPositionOffset =
5412 kNumLiteralsOffset + kIntSize; 5422 kNumLiteralsOffset + kIntSize;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
5464 kCodeAgeShift, 5474 kCodeAgeShift,
5465 kOptimizationDisabled = kCodeAgeShift + kCodeAgeSize, 5475 kOptimizationDisabled = kCodeAgeShift + kCodeAgeSize,
5466 kStrictModeFunction, 5476 kStrictModeFunction,
5467 kExtendedModeFunction, 5477 kExtendedModeFunction,
5468 kUsesArguments, 5478 kUsesArguments,
5469 kHasDuplicateParameters, 5479 kHasDuplicateParameters,
5470 kNative, 5480 kNative,
5471 kBoundFunction, 5481 kBoundFunction,
5472 kIsAnonymous, 5482 kIsAnonymous,
5473 kNameShouldPrintAsAnonymous, 5483 kNameShouldPrintAsAnonymous,
5484 kDontCrankshaft,
5485 kDontInline,
5474 kCompilerHintsCount // Pseudo entry 5486 kCompilerHintsCount // Pseudo entry
5475 }; 5487 };
5476 5488
5477 private: 5489 private:
5478 #if V8_HOST_ARCH_32_BIT 5490 #if V8_HOST_ARCH_32_BIT
5479 // On 32 bit platforms, compiler hints is a smi. 5491 // On 32 bit platforms, compiler hints is a smi.
5480 static const int kCompilerHintsSmiTagSize = kSmiTagSize; 5492 static const int kCompilerHintsSmiTagSize = kSmiTagSize;
5481 static const int kCompilerHintsSize = kPointerSize; 5493 static const int kCompilerHintsSize = kPointerSize;
5482 #else 5494 #else
5483 // On 64 bit platforms, compiler hints is not a smi, see comment above. 5495 // On 64 bit platforms, compiler hints is not a smi, see comment above.
(...skipping 2752 matching lines...) Expand 10 before | Expand all | Expand 10 after
8236 } else { 8248 } else {
8237 value &= ~(1 << bit_position); 8249 value &= ~(1 << bit_position);
8238 } 8250 }
8239 return value; 8251 return value;
8240 } 8252 }
8241 }; 8253 };
8242 8254
8243 } } // namespace v8::internal 8255 } } // namespace v8::internal
8244 8256
8245 #endif // V8_OBJECTS_H_ 8257 #endif // V8_OBJECTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698