| 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 4802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4813 #define DECLARE_CODE_AGE_ENUM(X) k##X##CodeAge, | 4813 #define DECLARE_CODE_AGE_ENUM(X) k##X##CodeAge, |
| 4814 enum Age { | 4814 enum Age { |
| 4815 kNoAge = 0, | 4815 kNoAge = 0, |
| 4816 CODE_AGE_LIST(DECLARE_CODE_AGE_ENUM) | 4816 CODE_AGE_LIST(DECLARE_CODE_AGE_ENUM) |
| 4817 kAfterLastCodeAge, | 4817 kAfterLastCodeAge, |
| 4818 kLastCodeAge = kAfterLastCodeAge - 1, | 4818 kLastCodeAge = kAfterLastCodeAge - 1, |
| 4819 kCodeAgeCount = kAfterLastCodeAge - 1 | 4819 kCodeAgeCount = kAfterLastCodeAge - 1 |
| 4820 }; | 4820 }; |
| 4821 #undef DECLARE_CODE_AGE_ENUM | 4821 #undef DECLARE_CODE_AGE_ENUM |
| 4822 | 4822 |
| 4823 // Code aging | 4823 // Code aging. Indicates how many full GCs this code has survived without |
| 4824 // being entered through the prologue. Used to determine when it is |
| 4825 // relatively safe to flush this code object and replace it with the lazy |
| 4826 // compilation stub. |
| 4824 static void MakeCodeAgeSequenceYoung(byte* sequence); | 4827 static void MakeCodeAgeSequenceYoung(byte* sequence); |
| 4825 void MakeOlder(MarkingParity); | 4828 void MakeOlder(MarkingParity); |
| 4826 static bool IsYoungSequence(byte* sequence); | 4829 static bool IsYoungSequence(byte* sequence); |
| 4827 bool IsOld(); | 4830 bool IsOld(); |
| 4828 int GetAge(); | 4831 int GetAge(); |
| 4829 | 4832 |
| 4830 void PrintDeoptLocation(int bailout_id); | 4833 void PrintDeoptLocation(int bailout_id); |
| 4831 | 4834 |
| 4832 #ifdef VERIFY_HEAP | 4835 #ifdef VERIFY_HEAP |
| 4833 void VerifyEmbeddedMapsDependency(); | 4836 void VerifyEmbeddedMapsDependency(); |
| (...skipping 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6132 // This is used to determine if we can safely flush code from a function | 6135 // This is used to determine if we can safely flush code from a function |
| 6133 // when doing GC if we expect that the function will no longer be used. | 6136 // when doing GC if we expect that the function will no longer be used. |
| 6134 DECL_BOOLEAN_ACCESSORS(allows_lazy_compilation) | 6137 DECL_BOOLEAN_ACCESSORS(allows_lazy_compilation) |
| 6135 | 6138 |
| 6136 // Indicates if this function can be lazy compiled without a context. | 6139 // Indicates if this function can be lazy compiled without a context. |
| 6137 // This is used to determine if we can force compilation without reaching | 6140 // This is used to determine if we can force compilation without reaching |
| 6138 // the function through program execution but through other means (e.g. heap | 6141 // the function through program execution but through other means (e.g. heap |
| 6139 // iteration by the debugger). | 6142 // iteration by the debugger). |
| 6140 DECL_BOOLEAN_ACCESSORS(allows_lazy_compilation_without_context) | 6143 DECL_BOOLEAN_ACCESSORS(allows_lazy_compilation_without_context) |
| 6141 | 6144 |
| 6142 // Indicates how many full GCs this function has survived with assigned | |
| 6143 // code object. Used to determine when it is relatively safe to flush | |
| 6144 // this code object and replace it with lazy compilation stub. | |
| 6145 // Age is reset when GC notices that the code object is referenced | |
| 6146 // from the stack or compilation cache. | |
| 6147 inline int code_age(); | |
| 6148 inline void set_code_age(int age); | |
| 6149 | |
| 6150 // Indicates whether optimizations have been disabled for this | 6145 // Indicates whether optimizations have been disabled for this |
| 6151 // shared function info. If a function is repeatedly optimized or if | 6146 // shared function info. If a function is repeatedly optimized or if |
| 6152 // we cannot optimize the function we disable optimization to avoid | 6147 // we cannot optimize the function we disable optimization to avoid |
| 6153 // spending time attempting to optimize it again. | 6148 // spending time attempting to optimize it again. |
| 6154 DECL_BOOLEAN_ACCESSORS(optimization_disabled) | 6149 DECL_BOOLEAN_ACCESSORS(optimization_disabled) |
| 6155 | 6150 |
| 6156 // Indicates the language mode of the function's code as defined by the | 6151 // Indicates the language mode of the function's code as defined by the |
| 6157 // current harmony drafts for the next ES language standard. Possible | 6152 // current harmony drafts for the next ES language standard. Possible |
| 6158 // values are: | 6153 // values are: |
| 6159 // 1. CLASSIC_MODE - Unrestricted syntax and semantics, same as in ES5. | 6154 // 1. CLASSIC_MODE - Unrestricted syntax and semantics, same as in ES5. |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6383 | 6378 |
| 6384 // Bit positions in start_position_and_type. | 6379 // Bit positions in start_position_and_type. |
| 6385 // The source code start position is in the 30 most significant bits of | 6380 // The source code start position is in the 30 most significant bits of |
| 6386 // the start_position_and_type field. | 6381 // the start_position_and_type field. |
| 6387 static const int kIsExpressionBit = 0; | 6382 static const int kIsExpressionBit = 0; |
| 6388 static const int kIsTopLevelBit = 1; | 6383 static const int kIsTopLevelBit = 1; |
| 6389 static const int kStartPositionShift = 2; | 6384 static const int kStartPositionShift = 2; |
| 6390 static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1); | 6385 static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1); |
| 6391 | 6386 |
| 6392 // Bit positions in compiler_hints. | 6387 // Bit positions in compiler_hints. |
| 6393 static const int kCodeAgeSize = 3; | |
| 6394 static const int kCodeAgeMask = (1 << kCodeAgeSize) - 1; | |
| 6395 | |
| 6396 enum CompilerHints { | 6388 enum CompilerHints { |
| 6397 kAllowLazyCompilation, | 6389 kAllowLazyCompilation, |
| 6398 kAllowLazyCompilationWithoutContext, | 6390 kAllowLazyCompilationWithoutContext, |
| 6399 kLiveObjectsMayExist, | 6391 kLiveObjectsMayExist, |
| 6400 kCodeAgeShift, | 6392 kOptimizationDisabled, |
| 6401 kOptimizationDisabled = kCodeAgeShift + kCodeAgeSize, | |
| 6402 kStrictModeFunction, | 6393 kStrictModeFunction, |
| 6403 kExtendedModeFunction, | 6394 kExtendedModeFunction, |
| 6404 kUsesArguments, | 6395 kUsesArguments, |
| 6405 kHasDuplicateParameters, | 6396 kHasDuplicateParameters, |
| 6406 kNative, | 6397 kNative, |
| 6407 kBoundFunction, | 6398 kBoundFunction, |
| 6408 kIsAnonymous, | 6399 kIsAnonymous, |
| 6409 kNameShouldPrintAsAnonymous, | 6400 kNameShouldPrintAsAnonymous, |
| 6410 kIsFunction, | 6401 kIsFunction, |
| 6411 kDontOptimize, | 6402 kDontOptimize, |
| (...skipping 3288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9700 } else { | 9691 } else { |
| 9701 value &= ~(1 << bit_position); | 9692 value &= ~(1 << bit_position); |
| 9702 } | 9693 } |
| 9703 return value; | 9694 return value; |
| 9704 } | 9695 } |
| 9705 }; | 9696 }; |
| 9706 | 9697 |
| 9707 } } // namespace v8::internal | 9698 } } // namespace v8::internal |
| 9708 | 9699 |
| 9709 #endif // V8_OBJECTS_H_ | 9700 #endif // V8_OBJECTS_H_ |
| OLD | NEW |