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 6130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6141 DECL_BOOLEAN_ACCESSORS(is_toplevel) | 6141 DECL_BOOLEAN_ACCESSORS(is_toplevel) |
6142 | 6142 |
6143 // Bit field containing various information collected by the compiler to | 6143 // Bit field containing various information collected by the compiler to |
6144 // drive optimization. | 6144 // drive optimization. |
6145 inline int compiler_hints(); | 6145 inline int compiler_hints(); |
6146 inline void set_compiler_hints(int value); | 6146 inline void set_compiler_hints(int value); |
6147 | 6147 |
6148 inline int ast_node_count(); | 6148 inline int ast_node_count(); |
6149 inline void set_ast_node_count(int count); | 6149 inline void set_ast_node_count(int count); |
6150 | 6150 |
6151 // A counter used to determine when to stress the deoptimizer with a | |
6152 // deopt. | |
6153 inline int stress_deopt_counter(); | |
6154 inline void set_stress_deopt_counter(int counter); | |
6155 | |
6156 inline int profiler_ticks(); | 6151 inline int profiler_ticks(); |
6157 | 6152 |
6158 // Inline cache age is used to infer whether the function survived a context | 6153 // Inline cache age is used to infer whether the function survived a context |
6159 // disposal or not. In the former case we reset the opt_count. | 6154 // disposal or not. In the former case we reset the opt_count. |
6160 inline int ic_age(); | 6155 inline int ic_age(); |
6161 inline void set_ic_age(int age); | 6156 inline void set_ic_age(int age); |
6162 | 6157 |
6163 // Indicates if this function can be lazy compiled. | 6158 // Indicates if this function can be lazy compiled. |
6164 // This is used to determine if we can safely flush code from a function | 6159 // This is used to determine if we can safely flush code from a function |
6165 // when doing GC if we expect that the function will no longer be used. | 6160 // when doing GC if we expect that the function will no longer be used. |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6337 static const int kStartPositionAndTypeOffset = | 6332 static const int kStartPositionAndTypeOffset = |
6338 kNumLiteralsOffset + kPointerSize; | 6333 kNumLiteralsOffset + kPointerSize; |
6339 static const int kEndPositionOffset = | 6334 static const int kEndPositionOffset = |
6340 kStartPositionAndTypeOffset + kPointerSize; | 6335 kStartPositionAndTypeOffset + kPointerSize; |
6341 static const int kFunctionTokenPositionOffset = | 6336 static const int kFunctionTokenPositionOffset = |
6342 kEndPositionOffset + kPointerSize; | 6337 kEndPositionOffset + kPointerSize; |
6343 static const int kCompilerHintsOffset = | 6338 static const int kCompilerHintsOffset = |
6344 kFunctionTokenPositionOffset + kPointerSize; | 6339 kFunctionTokenPositionOffset + kPointerSize; |
6345 static const int kOptCountOffset = kCompilerHintsOffset + kPointerSize; | 6340 static const int kOptCountOffset = kCompilerHintsOffset + kPointerSize; |
6346 static const int kCountersOffset = kOptCountOffset + kPointerSize; | 6341 static const int kCountersOffset = kOptCountOffset + kPointerSize; |
6347 static const int kStressDeoptCounterOffset = kCountersOffset + kPointerSize; | |
6348 | 6342 |
6349 // Total size. | 6343 // Total size. |
6350 static const int kSize = kStressDeoptCounterOffset + kPointerSize; | 6344 static const int kSize = kCountersOffset + kPointerSize; |
6351 #else | 6345 #else |
6352 // The only reason to use smi fields instead of int fields | 6346 // The only reason to use smi fields instead of int fields |
6353 // is to allow iteration without maps decoding during | 6347 // is to allow iteration without maps decoding during |
6354 // garbage collections. | 6348 // garbage collections. |
6355 // To avoid wasting space on 64-bit architectures we use | 6349 // To avoid wasting space on 64-bit architectures we use |
6356 // the following trick: we group integer fields into pairs | 6350 // the following trick: we group integer fields into pairs |
6357 // First integer in each pair is shifted left by 1. | 6351 // First integer in each pair is shifted left by 1. |
6358 // By doing this we guarantee that LSB of each kPointerSize aligned | 6352 // By doing this we guarantee that LSB of each kPointerSize aligned |
6359 // word is not set and thus this word cannot be treated as pointer | 6353 // word is not set and thus this word cannot be treated as pointer |
6360 // to HeapObject during old space traversal. | 6354 // to HeapObject during old space traversal. |
(...skipping 13 matching lines...) Expand all Loading... |
6374 kEndPositionOffset + kIntSize; | 6368 kEndPositionOffset + kIntSize; |
6375 | 6369 |
6376 static const int kFunctionTokenPositionOffset = | 6370 static const int kFunctionTokenPositionOffset = |
6377 kStartPositionAndTypeOffset + kIntSize; | 6371 kStartPositionAndTypeOffset + kIntSize; |
6378 static const int kCompilerHintsOffset = | 6372 static const int kCompilerHintsOffset = |
6379 kFunctionTokenPositionOffset + kIntSize; | 6373 kFunctionTokenPositionOffset + kIntSize; |
6380 | 6374 |
6381 static const int kOptCountOffset = kCompilerHintsOffset + kIntSize; | 6375 static const int kOptCountOffset = kCompilerHintsOffset + kIntSize; |
6382 | 6376 |
6383 static const int kCountersOffset = kOptCountOffset + kIntSize; | 6377 static const int kCountersOffset = kOptCountOffset + kIntSize; |
6384 static const int kStressDeoptCounterOffset = kCountersOffset + kIntSize; | |
6385 | 6378 |
6386 // Total size. | 6379 // Total size. |
6387 static const int kSize = kStressDeoptCounterOffset + kIntSize; | 6380 static const int kSize = kCountersOffset + kIntSize; |
6388 | 6381 |
6389 #endif | 6382 #endif |
6390 | 6383 |
6391 // The construction counter for inobject slack tracking is stored in the | 6384 // The construction counter for inobject slack tracking is stored in the |
6392 // most significant byte of compiler_hints which is otherwise unused. | 6385 // most significant byte of compiler_hints which is otherwise unused. |
6393 // Its offset depends on the endian-ness of the architecture. | 6386 // Its offset depends on the endian-ness of the architecture. |
6394 #if __BYTE_ORDER == __LITTLE_ENDIAN | 6387 #if __BYTE_ORDER == __LITTLE_ENDIAN |
6395 static const int kConstructionCountOffset = kCompilerHintsOffset + 3; | 6388 static const int kConstructionCountOffset = kCompilerHintsOffset + 3; |
6396 #elif __BYTE_ORDER == __BIG_ENDIAN | 6389 #elif __BYTE_ORDER == __BIG_ENDIAN |
6397 static const int kConstructionCountOffset = kCompilerHintsOffset + 0; | 6390 static const int kConstructionCountOffset = kCompilerHintsOffset + 0; |
(...skipping 3421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9819 } else { | 9812 } else { |
9820 value &= ~(1 << bit_position); | 9813 value &= ~(1 << bit_position); |
9821 } | 9814 } |
9822 return value; | 9815 return value; |
9823 } | 9816 } |
9824 }; | 9817 }; |
9825 | 9818 |
9826 } } // namespace v8::internal | 9819 } } // namespace v8::internal |
9827 | 9820 |
9828 #endif // V8_OBJECTS_H_ | 9821 #endif // V8_OBJECTS_H_ |
OLD | NEW |