Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
|
Jakob Kummerow
2012/01/16 11:41:25
nit: 2012
fschneider
2012/01/19 10:26:11
Done.
| |
| 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 |
| 11 // with the distribution. | 11 // with the distribution. |
| (...skipping 3501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3513 SMI_ACCESSORS(SharedFunctionInfo, num_literals, kNumLiteralsOffset) | 3513 SMI_ACCESSORS(SharedFunctionInfo, num_literals, kNumLiteralsOffset) |
| 3514 SMI_ACCESSORS(SharedFunctionInfo, start_position_and_type, | 3514 SMI_ACCESSORS(SharedFunctionInfo, start_position_and_type, |
| 3515 kStartPositionAndTypeOffset) | 3515 kStartPositionAndTypeOffset) |
| 3516 SMI_ACCESSORS(SharedFunctionInfo, end_position, kEndPositionOffset) | 3516 SMI_ACCESSORS(SharedFunctionInfo, end_position, kEndPositionOffset) |
| 3517 SMI_ACCESSORS(SharedFunctionInfo, function_token_position, | 3517 SMI_ACCESSORS(SharedFunctionInfo, function_token_position, |
| 3518 kFunctionTokenPositionOffset) | 3518 kFunctionTokenPositionOffset) |
| 3519 SMI_ACCESSORS(SharedFunctionInfo, compiler_hints, | 3519 SMI_ACCESSORS(SharedFunctionInfo, compiler_hints, |
| 3520 kCompilerHintsOffset) | 3520 kCompilerHintsOffset) |
| 3521 SMI_ACCESSORS(SharedFunctionInfo, this_property_assignments_count, | 3521 SMI_ACCESSORS(SharedFunctionInfo, this_property_assignments_count, |
| 3522 kThisPropertyAssignmentsCountOffset) | 3522 kThisPropertyAssignmentsCountOffset) |
| 3523 SMI_ACCESSORS(SharedFunctionInfo, opt_count, kOptCountOffset) | 3523 SMI_ACCESSORS(SharedFunctionInfo, deopt_count, kDeoptCountOffset) |
| 3524 #else | 3524 #else |
| 3525 | 3525 |
| 3526 #define PSEUDO_SMI_ACCESSORS_LO(holder, name, offset) \ | 3526 #define PSEUDO_SMI_ACCESSORS_LO(holder, name, offset) \ |
| 3527 STATIC_ASSERT(holder::offset % kPointerSize == 0); \ | 3527 STATIC_ASSERT(holder::offset % kPointerSize == 0); \ |
| 3528 int holder::name() { \ | 3528 int holder::name() { \ |
| 3529 int value = READ_INT_FIELD(this, offset); \ | 3529 int value = READ_INT_FIELD(this, offset); \ |
| 3530 ASSERT(kHeapObjectTag == 1); \ | 3530 ASSERT(kHeapObjectTag == 1); \ |
| 3531 ASSERT((value & kHeapObjectTag) == 0); \ | 3531 ASSERT((value & kHeapObjectTag) == 0); \ |
| 3532 return value >> 1; \ | 3532 return value >> 1; \ |
| 3533 } \ | 3533 } \ |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 3563 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, | 3563 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, |
| 3564 function_token_position, | 3564 function_token_position, |
| 3565 kFunctionTokenPositionOffset) | 3565 kFunctionTokenPositionOffset) |
| 3566 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, | 3566 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, |
| 3567 compiler_hints, | 3567 compiler_hints, |
| 3568 kCompilerHintsOffset) | 3568 kCompilerHintsOffset) |
| 3569 | 3569 |
| 3570 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, | 3570 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, |
| 3571 this_property_assignments_count, | 3571 this_property_assignments_count, |
| 3572 kThisPropertyAssignmentsCountOffset) | 3572 kThisPropertyAssignmentsCountOffset) |
| 3573 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, opt_count, kOptCountOffset) | 3573 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, deopt_count, kDeoptCountOffset) |
| 3574 #endif | 3574 #endif |
| 3575 | 3575 |
| 3576 | 3576 |
| 3577 int SharedFunctionInfo::construction_count() { | 3577 int SharedFunctionInfo::construction_count() { |
| 3578 return READ_BYTE_FIELD(this, kConstructionCountOffset); | 3578 return READ_BYTE_FIELD(this, kConstructionCountOffset); |
| 3579 } | 3579 } |
| 3580 | 3580 |
| 3581 | 3581 |
| 3582 void SharedFunctionInfo::set_construction_count(int value) { | 3582 void SharedFunctionInfo::set_construction_count(int value) { |
| 3583 ASSERT(0 <= value && value < 256); | 3583 ASSERT(0 <= value && value < 256); |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3715 WriteBarrierMode mode) { | 3715 WriteBarrierMode mode) { |
| 3716 WRITE_FIELD(this, kScopeInfoOffset, reinterpret_cast<Object*>(value)); | 3716 WRITE_FIELD(this, kScopeInfoOffset, reinterpret_cast<Object*>(value)); |
| 3717 CONDITIONAL_WRITE_BARRIER(GetHeap(), | 3717 CONDITIONAL_WRITE_BARRIER(GetHeap(), |
| 3718 this, | 3718 this, |
| 3719 kScopeInfoOffset, | 3719 kScopeInfoOffset, |
| 3720 reinterpret_cast<Object*>(value), | 3720 reinterpret_cast<Object*>(value), |
| 3721 mode); | 3721 mode); |
| 3722 } | 3722 } |
| 3723 | 3723 |
| 3724 | 3724 |
| 3725 Smi* SharedFunctionInfo::deopt_counter() { | 3725 Smi* SharedFunctionInfo::stress_deopt_counter() { |
| 3726 return reinterpret_cast<Smi*>(READ_FIELD(this, kDeoptCounterOffset)); | 3726 return reinterpret_cast<Smi*>(READ_FIELD(this, kDeoptCounterOffset)); |
| 3727 } | 3727 } |
| 3728 | 3728 |
| 3729 | 3729 |
| 3730 void SharedFunctionInfo::set_deopt_counter(Smi* value) { | 3730 void SharedFunctionInfo::set_stress_deopt_counter(Smi* value) { |
| 3731 WRITE_FIELD(this, kDeoptCounterOffset, value); | 3731 WRITE_FIELD(this, kDeoptCounterOffset, value); |
| 3732 } | 3732 } |
| 3733 | 3733 |
| 3734 | 3734 |
| 3735 bool SharedFunctionInfo::is_compiled() { | 3735 bool SharedFunctionInfo::is_compiled() { |
| 3736 return code() != | 3736 return code() != |
| 3737 Isolate::Current()->builtins()->builtin(Builtins::kLazyCompile); | 3737 Isolate::Current()->builtins()->builtin(Builtins::kLazyCompile); |
| 3738 } | 3738 } |
| 3739 | 3739 |
| 3740 | 3740 |
| (...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4785 #undef WRITE_INT_FIELD | 4785 #undef WRITE_INT_FIELD |
| 4786 #undef READ_SHORT_FIELD | 4786 #undef READ_SHORT_FIELD |
| 4787 #undef WRITE_SHORT_FIELD | 4787 #undef WRITE_SHORT_FIELD |
| 4788 #undef READ_BYTE_FIELD | 4788 #undef READ_BYTE_FIELD |
| 4789 #undef WRITE_BYTE_FIELD | 4789 #undef WRITE_BYTE_FIELD |
| 4790 | 4790 |
| 4791 | 4791 |
| 4792 } } // namespace v8::internal | 4792 } } // namespace v8::internal |
| 4793 | 4793 |
| 4794 #endif // V8_OBJECTS_INL_H_ | 4794 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |