| 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 7222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7233 | 7233 |
| 7234 // Bit field containing various information collected by the compiler to | 7234 // Bit field containing various information collected by the compiler to |
| 7235 // drive optimization. | 7235 // drive optimization. |
| 7236 inline int compiler_hints(); | 7236 inline int compiler_hints(); |
| 7237 inline void set_compiler_hints(int value); | 7237 inline void set_compiler_hints(int value); |
| 7238 | 7238 |
| 7239 inline int ast_node_count(); | 7239 inline int ast_node_count(); |
| 7240 inline void set_ast_node_count(int count); | 7240 inline void set_ast_node_count(int count); |
| 7241 | 7241 |
| 7242 inline int profiler_ticks(); | 7242 inline int profiler_ticks(); |
| 7243 inline void set_profiler_ticks(int ticks); |
| 7243 | 7244 |
| 7244 // Inline cache age is used to infer whether the function survived a context | 7245 // Inline cache age is used to infer whether the function survived a context |
| 7245 // disposal or not. In the former case we reset the opt_count. | 7246 // disposal or not. In the former case we reset the opt_count. |
| 7246 inline int ic_age(); | 7247 inline int ic_age(); |
| 7247 inline void set_ic_age(int age); | 7248 inline void set_ic_age(int age); |
| 7248 | 7249 |
| 7249 // Indicates if this function can be lazy compiled. | 7250 // Indicates if this function can be lazy compiled. |
| 7250 // This is used to determine if we can safely flush code from a function | 7251 // This is used to determine if we can safely flush code from a function |
| 7251 // when doing GC if we expect that the function will no longer be used. | 7252 // when doing GC if we expect that the function will no longer be used. |
| 7252 DECL_BOOLEAN_ACCESSORS(allows_lazy_compilation) | 7253 DECL_BOOLEAN_ACCESSORS(allows_lazy_compilation) |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7406 static const int kConstructStubOffset = kScopeInfoOffset + kPointerSize; | 7407 static const int kConstructStubOffset = kScopeInfoOffset + kPointerSize; |
| 7407 static const int kInstanceClassNameOffset = | 7408 static const int kInstanceClassNameOffset = |
| 7408 kConstructStubOffset + kPointerSize; | 7409 kConstructStubOffset + kPointerSize; |
| 7409 static const int kFunctionDataOffset = | 7410 static const int kFunctionDataOffset = |
| 7410 kInstanceClassNameOffset + kPointerSize; | 7411 kInstanceClassNameOffset + kPointerSize; |
| 7411 static const int kScriptOffset = kFunctionDataOffset + kPointerSize; | 7412 static const int kScriptOffset = kFunctionDataOffset + kPointerSize; |
| 7412 static const int kDebugInfoOffset = kScriptOffset + kPointerSize; | 7413 static const int kDebugInfoOffset = kScriptOffset + kPointerSize; |
| 7413 static const int kInferredNameOffset = kDebugInfoOffset + kPointerSize; | 7414 static const int kInferredNameOffset = kDebugInfoOffset + kPointerSize; |
| 7414 static const int kInitialMapOffset = | 7415 static const int kInitialMapOffset = |
| 7415 kInferredNameOffset + kPointerSize; | 7416 kInferredNameOffset + kPointerSize; |
| 7416 // ast_node_count is a Smi field. It could be grouped with another Smi field | |
| 7417 // into a PSEUDO_SMI_ACCESSORS pair (on x64), if one becomes available. | |
| 7418 static const int kAstNodeCountOffset = | |
| 7419 kInitialMapOffset + kPointerSize; | |
| 7420 #if V8_HOST_ARCH_32_BIT | 7417 #if V8_HOST_ARCH_32_BIT |
| 7421 // Smi fields. | 7418 // Smi fields. |
| 7422 static const int kLengthOffset = | 7419 static const int kLengthOffset = |
| 7423 kAstNodeCountOffset + kPointerSize; | 7420 kInitialMapOffset + kPointerSize; |
| 7424 static const int kFormalParameterCountOffset = kLengthOffset + kPointerSize; | 7421 static const int kFormalParameterCountOffset = kLengthOffset + kPointerSize; |
| 7425 static const int kExpectedNofPropertiesOffset = | 7422 static const int kExpectedNofPropertiesOffset = |
| 7426 kFormalParameterCountOffset + kPointerSize; | 7423 kFormalParameterCountOffset + kPointerSize; |
| 7427 static const int kNumLiteralsOffset = | 7424 static const int kNumLiteralsOffset = |
| 7428 kExpectedNofPropertiesOffset + kPointerSize; | 7425 kExpectedNofPropertiesOffset + kPointerSize; |
| 7429 static const int kStartPositionAndTypeOffset = | 7426 static const int kStartPositionAndTypeOffset = |
| 7430 kNumLiteralsOffset + kPointerSize; | 7427 kNumLiteralsOffset + kPointerSize; |
| 7431 static const int kEndPositionOffset = | 7428 static const int kEndPositionOffset = |
| 7432 kStartPositionAndTypeOffset + kPointerSize; | 7429 kStartPositionAndTypeOffset + kPointerSize; |
| 7433 static const int kFunctionTokenPositionOffset = | 7430 static const int kFunctionTokenPositionOffset = |
| 7434 kEndPositionOffset + kPointerSize; | 7431 kEndPositionOffset + kPointerSize; |
| 7435 static const int kCompilerHintsOffset = | 7432 static const int kCompilerHintsOffset = |
| 7436 kFunctionTokenPositionOffset + kPointerSize; | 7433 kFunctionTokenPositionOffset + kPointerSize; |
| 7437 static const int kOptCountAndBailoutReasonOffset = | 7434 static const int kOptCountAndBailoutReasonOffset = |
| 7438 kCompilerHintsOffset + kPointerSize; | 7435 kCompilerHintsOffset + kPointerSize; |
| 7439 static const int kCountersOffset = | 7436 static const int kCountersOffset = |
| 7440 kOptCountAndBailoutReasonOffset + kPointerSize; | 7437 kOptCountAndBailoutReasonOffset + kPointerSize; |
| 7438 static const int kAstNodeCountOffset = |
| 7439 kCountersOffset + kPointerSize; |
| 7440 static const int kProfilerTicksOffset = |
| 7441 kAstNodeCountOffset + kPointerSize; |
| 7441 | 7442 |
| 7442 // Total size. | 7443 // Total size. |
| 7443 static const int kSize = kCountersOffset + kPointerSize; | 7444 static const int kSize = kProfilerTicksOffset + kPointerSize; |
| 7444 #else | 7445 #else |
| 7445 // The only reason to use smi fields instead of int fields | 7446 // The only reason to use smi fields instead of int fields |
| 7446 // is to allow iteration without maps decoding during | 7447 // is to allow iteration without maps decoding during |
| 7447 // garbage collections. | 7448 // garbage collections. |
| 7448 // To avoid wasting space on 64-bit architectures we use | 7449 // To avoid wasting space on 64-bit architectures we use |
| 7449 // the following trick: we group integer fields into pairs | 7450 // the following trick: we group integer fields into pairs |
| 7450 // First integer in each pair is shifted left by 1. | 7451 // First integer in each pair is shifted left by 1. |
| 7451 // By doing this we guarantee that LSB of each kPointerSize aligned | 7452 // By doing this we guarantee that LSB of each kPointerSize aligned |
| 7452 // word is not set and thus this word cannot be treated as pointer | 7453 // word is not set and thus this word cannot be treated as pointer |
| 7453 // to HeapObject during old space traversal. | 7454 // to HeapObject during old space traversal. |
| 7454 static const int kLengthOffset = | 7455 static const int kLengthOffset = |
| 7455 kAstNodeCountOffset + kPointerSize; | 7456 kInitialMapOffset + kPointerSize; |
| 7456 static const int kFormalParameterCountOffset = | 7457 static const int kFormalParameterCountOffset = |
| 7457 kLengthOffset + kIntSize; | 7458 kLengthOffset + kIntSize; |
| 7458 | 7459 |
| 7459 static const int kExpectedNofPropertiesOffset = | 7460 static const int kExpectedNofPropertiesOffset = |
| 7460 kFormalParameterCountOffset + kIntSize; | 7461 kFormalParameterCountOffset + kIntSize; |
| 7461 static const int kNumLiteralsOffset = | 7462 static const int kNumLiteralsOffset = |
| 7462 kExpectedNofPropertiesOffset + kIntSize; | 7463 kExpectedNofPropertiesOffset + kIntSize; |
| 7463 | 7464 |
| 7464 static const int kEndPositionOffset = | 7465 static const int kEndPositionOffset = |
| 7465 kNumLiteralsOffset + kIntSize; | 7466 kNumLiteralsOffset + kIntSize; |
| 7466 static const int kStartPositionAndTypeOffset = | 7467 static const int kStartPositionAndTypeOffset = |
| 7467 kEndPositionOffset + kIntSize; | 7468 kEndPositionOffset + kIntSize; |
| 7468 | 7469 |
| 7469 static const int kFunctionTokenPositionOffset = | 7470 static const int kFunctionTokenPositionOffset = |
| 7470 kStartPositionAndTypeOffset + kIntSize; | 7471 kStartPositionAndTypeOffset + kIntSize; |
| 7471 static const int kCompilerHintsOffset = | 7472 static const int kCompilerHintsOffset = |
| 7472 kFunctionTokenPositionOffset + kIntSize; | 7473 kFunctionTokenPositionOffset + kIntSize; |
| 7473 | 7474 |
| 7474 static const int kOptCountAndBailoutReasonOffset = | 7475 static const int kOptCountAndBailoutReasonOffset = |
| 7475 kCompilerHintsOffset + kIntSize; | 7476 kCompilerHintsOffset + kIntSize; |
| 7476 | |
| 7477 static const int kCountersOffset = | 7477 static const int kCountersOffset = |
| 7478 kOptCountAndBailoutReasonOffset + kIntSize; | 7478 kOptCountAndBailoutReasonOffset + kIntSize; |
| 7479 | 7479 |
| 7480 static const int kAstNodeCountOffset = |
| 7481 kCountersOffset + kIntSize; |
| 7482 static const int kProfilerTicksOffset = |
| 7483 kAstNodeCountOffset + kIntSize; |
| 7484 |
| 7480 // Total size. | 7485 // Total size. |
| 7481 static const int kSize = kCountersOffset + kIntSize; | 7486 static const int kSize = kProfilerTicksOffset + kIntSize; |
| 7482 | 7487 |
| 7483 #endif | 7488 #endif |
| 7484 | 7489 |
| 7485 // The construction counter for inobject slack tracking is stored in the | 7490 // The construction counter for inobject slack tracking is stored in the |
| 7486 // most significant byte of compiler_hints which is otherwise unused. | 7491 // most significant byte of compiler_hints which is otherwise unused. |
| 7487 // Its offset depends on the endian-ness of the architecture. | 7492 // Its offset depends on the endian-ness of the architecture. |
| 7488 #if defined(V8_TARGET_LITTLE_ENDIAN) | 7493 #if defined(V8_TARGET_LITTLE_ENDIAN) |
| 7489 static const int kConstructionCountOffset = kCompilerHintsOffset + 3; | 7494 static const int kConstructionCountOffset = kCompilerHintsOffset + 3; |
| 7490 #elif defined(V8_TARGET_BIG_ENDIAN) | 7495 #elif defined(V8_TARGET_BIG_ENDIAN) |
| 7491 static const int kConstructionCountOffset = kCompilerHintsOffset + 0; | 7496 static const int kConstructionCountOffset = kCompilerHintsOffset + 0; |
| (...skipping 3787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11279 } else { | 11284 } else { |
| 11280 value &= ~(1 << bit_position); | 11285 value &= ~(1 << bit_position); |
| 11281 } | 11286 } |
| 11282 return value; | 11287 return value; |
| 11283 } | 11288 } |
| 11284 }; | 11289 }; |
| 11285 | 11290 |
| 11286 } } // namespace v8::internal | 11291 } } // namespace v8::internal |
| 11287 | 11292 |
| 11288 #endif // V8_OBJECTS_H_ | 11293 #endif // V8_OBJECTS_H_ |
| OLD | NEW |