| 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 4589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4600 SMI_ACCESSORS(SharedFunctionInfo, expected_nof_properties, | 4600 SMI_ACCESSORS(SharedFunctionInfo, expected_nof_properties, |
| 4601 kExpectedNofPropertiesOffset) | 4601 kExpectedNofPropertiesOffset) |
| 4602 SMI_ACCESSORS(SharedFunctionInfo, num_literals, kNumLiteralsOffset) | 4602 SMI_ACCESSORS(SharedFunctionInfo, num_literals, kNumLiteralsOffset) |
| 4603 SMI_ACCESSORS(SharedFunctionInfo, start_position_and_type, | 4603 SMI_ACCESSORS(SharedFunctionInfo, start_position_and_type, |
| 4604 kStartPositionAndTypeOffset) | 4604 kStartPositionAndTypeOffset) |
| 4605 SMI_ACCESSORS(SharedFunctionInfo, end_position, kEndPositionOffset) | 4605 SMI_ACCESSORS(SharedFunctionInfo, end_position, kEndPositionOffset) |
| 4606 SMI_ACCESSORS(SharedFunctionInfo, function_token_position, | 4606 SMI_ACCESSORS(SharedFunctionInfo, function_token_position, |
| 4607 kFunctionTokenPositionOffset) | 4607 kFunctionTokenPositionOffset) |
| 4608 SMI_ACCESSORS(SharedFunctionInfo, compiler_hints, | 4608 SMI_ACCESSORS(SharedFunctionInfo, compiler_hints, |
| 4609 kCompilerHintsOffset) | 4609 kCompilerHintsOffset) |
| 4610 SMI_ACCESSORS(SharedFunctionInfo, opt_count, kOptCountOffset) | 4610 SMI_ACCESSORS(SharedFunctionInfo, opt_count_and_bailout_reason, |
| 4611 kOptCountAndBailoutReasonOffset) |
| 4611 SMI_ACCESSORS(SharedFunctionInfo, counters, kCountersOffset) | 4612 SMI_ACCESSORS(SharedFunctionInfo, counters, kCountersOffset) |
| 4612 | 4613 |
| 4613 #else | 4614 #else |
| 4614 | 4615 |
| 4615 #define PSEUDO_SMI_ACCESSORS_LO(holder, name, offset) \ | 4616 #define PSEUDO_SMI_ACCESSORS_LO(holder, name, offset) \ |
| 4616 STATIC_ASSERT(holder::offset % kPointerSize == 0); \ | 4617 STATIC_ASSERT(holder::offset % kPointerSize == 0); \ |
| 4617 int holder::name() { \ | 4618 int holder::name() { \ |
| 4618 int value = READ_INT_FIELD(this, offset); \ | 4619 int value = READ_INT_FIELD(this, offset); \ |
| 4619 ASSERT(kHeapObjectTag == 1); \ | 4620 ASSERT(kHeapObjectTag == 1); \ |
| 4620 ASSERT((value & kHeapObjectTag) == 0); \ | 4621 ASSERT((value & kHeapObjectTag) == 0); \ |
| (...skipping 28 matching lines...) Expand all Loading... |
| 4649 start_position_and_type, | 4650 start_position_and_type, |
| 4650 kStartPositionAndTypeOffset) | 4651 kStartPositionAndTypeOffset) |
| 4651 | 4652 |
| 4652 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, | 4653 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, |
| 4653 function_token_position, | 4654 function_token_position, |
| 4654 kFunctionTokenPositionOffset) | 4655 kFunctionTokenPositionOffset) |
| 4655 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, | 4656 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, |
| 4656 compiler_hints, | 4657 compiler_hints, |
| 4657 kCompilerHintsOffset) | 4658 kCompilerHintsOffset) |
| 4658 | 4659 |
| 4659 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, opt_count, kOptCountOffset) | 4660 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, |
| 4661 opt_count_and_bailout_reason, |
| 4662 kOptCountAndBailoutReasonOffset) |
| 4660 | 4663 |
| 4661 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, counters, kCountersOffset) | 4664 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, counters, kCountersOffset) |
| 4662 | 4665 |
| 4663 #endif | 4666 #endif |
| 4664 | 4667 |
| 4665 | 4668 |
| 4666 int SharedFunctionInfo::construction_count() { | 4669 int SharedFunctionInfo::construction_count() { |
| 4667 return READ_BYTE_FIELD(this, kConstructionCountOffset); | 4670 return READ_BYTE_FIELD(this, kConstructionCountOffset); |
| 4668 } | 4671 } |
| 4669 | 4672 |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4896 int SharedFunctionInfo::opt_reenable_tries() { | 4899 int SharedFunctionInfo::opt_reenable_tries() { |
| 4897 return OptReenableTriesBits::decode(counters()); | 4900 return OptReenableTriesBits::decode(counters()); |
| 4898 } | 4901 } |
| 4899 | 4902 |
| 4900 | 4903 |
| 4901 void SharedFunctionInfo::set_opt_reenable_tries(int tries) { | 4904 void SharedFunctionInfo::set_opt_reenable_tries(int tries) { |
| 4902 set_counters(OptReenableTriesBits::update(counters(), tries)); | 4905 set_counters(OptReenableTriesBits::update(counters(), tries)); |
| 4903 } | 4906 } |
| 4904 | 4907 |
| 4905 | 4908 |
| 4909 int SharedFunctionInfo::opt_count() { |
| 4910 return OptCountBits::decode(opt_count_and_bailout_reason()); |
| 4911 } |
| 4912 |
| 4913 |
| 4914 void SharedFunctionInfo::set_opt_count(int opt_count) { |
| 4915 set_opt_count_and_bailout_reason( |
| 4916 OptCountBits::update(opt_count_and_bailout_reason(), opt_count)); |
| 4917 } |
| 4918 |
| 4919 |
| 4920 BailoutReason SharedFunctionInfo::DisableOptimizationReason() { |
| 4921 BailoutReason reason = static_cast<BailoutReason>( |
| 4922 DisabledOptimizationReasonBits::decode(opt_count_and_bailout_reason())); |
| 4923 return reason; |
| 4924 } |
| 4925 |
| 4926 |
| 4906 bool SharedFunctionInfo::has_deoptimization_support() { | 4927 bool SharedFunctionInfo::has_deoptimization_support() { |
| 4907 Code* code = this->code(); | 4928 Code* code = this->code(); |
| 4908 return code->kind() == Code::FUNCTION && code->has_deoptimization_support(); | 4929 return code->kind() == Code::FUNCTION && code->has_deoptimization_support(); |
| 4909 } | 4930 } |
| 4910 | 4931 |
| 4911 | 4932 |
| 4912 void SharedFunctionInfo::TryReenableOptimization() { | 4933 void SharedFunctionInfo::TryReenableOptimization() { |
| 4913 int tries = opt_reenable_tries(); | 4934 int tries = opt_reenable_tries(); |
| 4914 set_opt_reenable_tries((tries + 1) & OptReenableTriesBits::kMax); | 4935 set_opt_reenable_tries((tries + 1) & OptReenableTriesBits::kMax); |
| 4915 // We reenable optimization whenever the number of tries is a large | 4936 // We reenable optimization whenever the number of tries is a large |
| (...skipping 1364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6280 #undef WRITE_UINT32_FIELD | 6301 #undef WRITE_UINT32_FIELD |
| 6281 #undef READ_SHORT_FIELD | 6302 #undef READ_SHORT_FIELD |
| 6282 #undef WRITE_SHORT_FIELD | 6303 #undef WRITE_SHORT_FIELD |
| 6283 #undef READ_BYTE_FIELD | 6304 #undef READ_BYTE_FIELD |
| 6284 #undef WRITE_BYTE_FIELD | 6305 #undef WRITE_BYTE_FIELD |
| 6285 | 6306 |
| 6286 | 6307 |
| 6287 } } // namespace v8::internal | 6308 } } // namespace v8::internal |
| 6288 | 6309 |
| 6289 #endif // V8_OBJECTS_INL_H_ | 6310 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |