| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 2607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2618 SMI_ACCESSORS(SharedFunctionInfo, end_position, kEndPositionOffset) | 2618 SMI_ACCESSORS(SharedFunctionInfo, end_position, kEndPositionOffset) |
| 2619 SMI_ACCESSORS(SharedFunctionInfo, function_token_position, | 2619 SMI_ACCESSORS(SharedFunctionInfo, function_token_position, |
| 2620 kFunctionTokenPositionOffset) | 2620 kFunctionTokenPositionOffset) |
| 2621 SMI_ACCESSORS(SharedFunctionInfo, compiler_hints, | 2621 SMI_ACCESSORS(SharedFunctionInfo, compiler_hints, |
| 2622 kCompilerHintsOffset) | 2622 kCompilerHintsOffset) |
| 2623 SMI_ACCESSORS(SharedFunctionInfo, this_property_assignments_count, | 2623 SMI_ACCESSORS(SharedFunctionInfo, this_property_assignments_count, |
| 2624 kThisPropertyAssignmentsCountOffset) | 2624 kThisPropertyAssignmentsCountOffset) |
| 2625 #else | 2625 #else |
| 2626 | 2626 |
| 2627 #define PSEUDO_SMI_ACCESSORS_LO(holder, name, offset) \ | 2627 #define PSEUDO_SMI_ACCESSORS_LO(holder, name, offset) \ |
| 2628 STATIC_ASSERT(holder::offset % kPointerSize == 0); \ |
| 2628 int holder::name() { \ | 2629 int holder::name() { \ |
| 2629 int value = READ_INT_FIELD(this, offset); \ | 2630 int value = READ_INT_FIELD(this, offset); \ |
| 2630 ASSERT(kHeapObjectTag == 1); \ | 2631 ASSERT(kHeapObjectTag == 1); \ |
| 2631 ASSERT((value & kHeapObjectTag) == 0); \ | 2632 ASSERT((value & kHeapObjectTag) == 0); \ |
| 2632 return value >> 1; \ | 2633 return value >> 1; \ |
| 2633 } \ | 2634 } \ |
| 2634 void holder::set_##name(int value) { \ | 2635 void holder::set_##name(int value) { \ |
| 2635 ASSERT(kHeapObjectTag == 1); \ | 2636 ASSERT(kHeapObjectTag == 1); \ |
| 2636 ASSERT((value & 0xC0000000) == 0xC0000000 || \ | 2637 ASSERT((value & 0xC0000000) == 0xC0000000 || \ |
| 2637 (value & 0xC0000000) == 0x000000000); \ | 2638 (value & 0xC0000000) == 0x000000000); \ |
| 2638 WRITE_INT_FIELD(this, \ | 2639 WRITE_INT_FIELD(this, \ |
| 2639 offset, \ | 2640 offset, \ |
| 2640 (value << 1) & ~kHeapObjectTag); \ | 2641 (value << 1) & ~kHeapObjectTag); \ |
| 2641 } | 2642 } |
| 2642 | 2643 |
| 2643 #define PSEUDO_SMI_ACCESSORS_HI(holder, name, offset) \ | 2644 #define PSEUDO_SMI_ACCESSORS_HI(holder, name, offset) \ |
| 2645 STATIC_ASSERT(holder::offset % kPointerSize == kIntSize); \ |
| 2644 INT_ACCESSORS(holder, name, offset) | 2646 INT_ACCESSORS(holder, name, offset) |
| 2645 | 2647 |
| 2646 | 2648 |
| 2649 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, length, kLengthOffset) |
| 2650 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, |
| 2651 formal_parameter_count, |
| 2652 kFormalParameterCountOffset) |
| 2647 | 2653 |
| 2648 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, length, kLengthOffset) | 2654 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, |
| 2649 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, formal_parameter_count, | 2655 expected_nof_properties, |
| 2650 kFormalParameterCountOffset) | 2656 kExpectedNofPropertiesOffset) |
| 2651 | |
| 2652 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, expected_nof_properties, | |
| 2653 kExpectedNofPropertiesOffset) | |
| 2654 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, num_literals, kNumLiteralsOffset) | 2657 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, num_literals, kNumLiteralsOffset) |
| 2655 | 2658 |
| 2656 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, start_position_and_type, | 2659 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, end_position, kEndPositionOffset) |
| 2657 kStartPositionAndTypeOffset) | 2660 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, |
| 2658 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, end_position, kEndPositionOffset) | 2661 start_position_and_type, |
| 2662 kStartPositionAndTypeOffset) |
| 2659 | 2663 |
| 2660 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, function_token_position, | 2664 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, |
| 2661 kFunctionTokenPositionOffset) | 2665 function_token_position, |
| 2662 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, compiler_hints, | 2666 kFunctionTokenPositionOffset) |
| 2663 kCompilerHintsOffset) | 2667 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, |
| 2668 compiler_hints, |
| 2669 kCompilerHintsOffset) |
| 2664 | 2670 |
| 2665 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, this_property_assignments_count, | 2671 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, |
| 2666 kThisPropertyAssignmentsCountOffset) | 2672 this_property_assignments_count, |
| 2673 kThisPropertyAssignmentsCountOffset) |
| 2667 #endif | 2674 #endif |
| 2668 | 2675 |
| 2669 ACCESSORS(CodeCache, default_cache, FixedArray, kDefaultCacheOffset) | 2676 ACCESSORS(CodeCache, default_cache, FixedArray, kDefaultCacheOffset) |
| 2670 ACCESSORS(CodeCache, normal_type_cache, Object, kNormalTypeCacheOffset) | 2677 ACCESSORS(CodeCache, normal_type_cache, Object, kNormalTypeCacheOffset) |
| 2671 | 2678 |
| 2672 bool Script::HasValidSource() { | 2679 bool Script::HasValidSource() { |
| 2673 Object* src = this->source(); | 2680 Object* src = this->source(); |
| 2674 if (!src->IsString()) return true; | 2681 if (!src->IsString()) return true; |
| 2675 String* src_str = String::cast(src); | 2682 String* src_str = String::cast(src); |
| 2676 if (!StringShape(src_str).IsExternal()) return true; | 2683 if (!StringShape(src_str).IsExternal()) return true; |
| (...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3493 #undef WRITE_INT_FIELD | 3500 #undef WRITE_INT_FIELD |
| 3494 #undef READ_SHORT_FIELD | 3501 #undef READ_SHORT_FIELD |
| 3495 #undef WRITE_SHORT_FIELD | 3502 #undef WRITE_SHORT_FIELD |
| 3496 #undef READ_BYTE_FIELD | 3503 #undef READ_BYTE_FIELD |
| 3497 #undef WRITE_BYTE_FIELD | 3504 #undef WRITE_BYTE_FIELD |
| 3498 | 3505 |
| 3499 | 3506 |
| 3500 } } // namespace v8::internal | 3507 } } // namespace v8::internal |
| 3501 | 3508 |
| 3502 #endif // V8_OBJECTS_INL_H_ | 3509 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |