Chromium Code Reviews

Side by Side Diff: src/objects.h

Issue 9403009: Count ICs that have type information. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | 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 5223 matching lines...)
5234 // deopt. 5234 // deopt.
5235 inline int deopt_counter(); 5235 inline int deopt_counter();
5236 inline void set_deopt_counter(int counter); 5236 inline void set_deopt_counter(int counter);
5237 5237
5238 inline int profiler_ticks(); 5238 inline int profiler_ticks();
5239 inline void set_profiler_ticks(int ticks); 5239 inline void set_profiler_ticks(int ticks);
5240 5240
5241 inline int ast_node_count(); 5241 inline int ast_node_count();
5242 inline void set_ast_node_count(int count); 5242 inline void set_ast_node_count(int count);
5243 5243
5244 inline int ic_total_count();
5245 inline void set_ic_total_count(int count);
5246
5247 inline int ic_typeinfo_count();
5248 inline void set_ic_typeinfo_count(int count);
5249
5244 // Add information on assignments of the form this.x = ...; 5250 // Add information on assignments of the form this.x = ...;
5245 void SetThisPropertyAssignmentsInfo( 5251 void SetThisPropertyAssignmentsInfo(
5246 bool has_only_simple_this_property_assignments, 5252 bool has_only_simple_this_property_assignments,
5247 FixedArray* this_property_assignments); 5253 FixedArray* this_property_assignments);
5248 5254
5249 // Clear information on assignments of the form this.x = ...; 5255 // Clear information on assignments of the form this.x = ...;
5250 void ClearThisPropertyAssignmentsInfo(); 5256 void ClearThisPropertyAssignmentsInfo();
5251 5257
5252 // Indicate that this function only consists of assignments of the form 5258 // Indicate that this function only consists of assignments of the form
5253 // this.x = y; where y is either a constant or refers to an argument. 5259 // this.x = y; where y is either a constant or refers to an argument.
(...skipping 180 matching lines...)
5434 kEndPositionOffset + kPointerSize; 5440 kEndPositionOffset + kPointerSize;
5435 static const int kCompilerHintsOffset = 5441 static const int kCompilerHintsOffset =
5436 kFunctionTokenPositionOffset + kPointerSize; 5442 kFunctionTokenPositionOffset + kPointerSize;
5437 static const int kThisPropertyAssignmentsCountOffset = 5443 static const int kThisPropertyAssignmentsCountOffset =
5438 kCompilerHintsOffset + kPointerSize; 5444 kCompilerHintsOffset + kPointerSize;
5439 static const int kOptCountOffset = 5445 static const int kOptCountOffset =
5440 kThisPropertyAssignmentsCountOffset + kPointerSize; 5446 kThisPropertyAssignmentsCountOffset + kPointerSize;
5441 static const int kAstNodeCountOffset = kOptCountOffset + kPointerSize; 5447 static const int kAstNodeCountOffset = kOptCountOffset + kPointerSize;
5442 static const int kDeoptCounterOffset = 5448 static const int kDeoptCounterOffset =
5443 kAstNodeCountOffset + kPointerSize; 5449 kAstNodeCountOffset + kPointerSize;
5450 static const int kIcTotalCountOffset = kDeoptCounterOffset + kPointerSize;
5451 static const int kIcTypeInfoCountOffset = kIcTotalCountOffset + kPointerSize;
5444 // Total size. 5452 // Total size.
5445 static const int kSize = kDeoptCounterOffset + kPointerSize; 5453 static const int kSize = kIcTypeInfoCountOffset + kPointerSize;
5446 #else 5454 #else
5447 // The only reason to use smi fields instead of int fields 5455 // The only reason to use smi fields instead of int fields
5448 // is to allow iteration without maps decoding during 5456 // is to allow iteration without maps decoding during
5449 // garbage collections. 5457 // garbage collections.
5450 // To avoid wasting space on 64-bit architectures we use 5458 // To avoid wasting space on 64-bit architectures we use
5451 // the following trick: we group integer fields into pairs 5459 // the following trick: we group integer fields into pairs
5452 // First integer in each pair is shifted left by 1. 5460 // First integer in each pair is shifted left by 1.
5453 // By doing this we guarantee that LSB of each kPointerSize aligned 5461 // By doing this we guarantee that LSB of each kPointerSize aligned
5454 // word is not set and thus this word cannot be treated as pointer 5462 // word is not set and thus this word cannot be treated as pointer
5455 // to HeapObject during old space traversal. 5463 // to HeapObject during old space traversal.
(...skipping 18 matching lines...)
5474 kFunctionTokenPositionOffset + kIntSize; 5482 kFunctionTokenPositionOffset + kIntSize;
5475 5483
5476 static const int kThisPropertyAssignmentsCountOffset = 5484 static const int kThisPropertyAssignmentsCountOffset =
5477 kCompilerHintsOffset + kIntSize; 5485 kCompilerHintsOffset + kIntSize;
5478 static const int kOptCountOffset = 5486 static const int kOptCountOffset =
5479 kThisPropertyAssignmentsCountOffset + kIntSize; 5487 kThisPropertyAssignmentsCountOffset + kIntSize;
5480 5488
5481 static const int kAstNodeCountOffset = kOptCountOffset + kIntSize; 5489 static const int kAstNodeCountOffset = kOptCountOffset + kIntSize;
5482 static const int kDeoptCounterOffset = kAstNodeCountOffset + kIntSize; 5490 static const int kDeoptCounterOffset = kAstNodeCountOffset + kIntSize;
5483 5491
5492 static const int kIcTotalCountOffset = kDeoptCounterOffset + kIntSize;
5493 static const int kIcTypeInfoCountOffset = kIcTotalCountOffset + kIntSize;
5494
5484 // Total size. 5495 // Total size.
5485 static const int kSize = kDeoptCounterOffset + kIntSize; 5496 static const int kSize = kIcTypeInfoCountOffset + kIntSize;
5486 5497
5487 #endif 5498 #endif
5488 5499
5489 // The construction counter for inobject slack tracking is stored in the 5500 // The construction counter for inobject slack tracking is stored in the
5490 // most significant byte of compiler_hints which is otherwise unused. 5501 // most significant byte of compiler_hints which is otherwise unused.
5491 // Its offset depends on the endian-ness of the architecture. 5502 // Its offset depends on the endian-ness of the architecture.
5492 #if __BYTE_ORDER == __LITTLE_ENDIAN 5503 #if __BYTE_ORDER == __LITTLE_ENDIAN
5493 static const int kConstructionCountOffset = kCompilerHintsOffset + 3; 5504 static const int kConstructionCountOffset = kCompilerHintsOffset + 3;
5494 #elif __BYTE_ORDER == __BIG_ENDIAN 5505 #elif __BYTE_ORDER == __BIG_ENDIAN
5495 static const int kConstructionCountOffset = kCompilerHintsOffset + 0; 5506 static const int kConstructionCountOffset = kCompilerHintsOffset + 0;
(...skipping 2803 matching lines...)
8299 } else { 8310 } else {
8300 value &= ~(1 << bit_position); 8311 value &= ~(1 << bit_position);
8301 } 8312 }
8302 return value; 8313 return value;
8303 } 8314 }
8304 }; 8315 };
8305 8316
8306 } } // namespace v8::internal 8317 } } // namespace v8::internal
8307 8318
8308 #endif // V8_OBJECTS_H_ 8319 #endif // V8_OBJECTS_H_
OLDNEW

Powered by Google App Engine