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 3070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3081 } | 3081 } |
3082 | 3082 |
3083 | 3083 |
3084 void Code::set_allow_osr_at_loop_nesting_level(int level) { | 3084 void Code::set_allow_osr_at_loop_nesting_level(int level) { |
3085 ASSERT(kind() == FUNCTION); | 3085 ASSERT(kind() == FUNCTION); |
3086 ASSERT(level >= 0 && level <= kMaxLoopNestingMarker); | 3086 ASSERT(level >= 0 && level <= kMaxLoopNestingMarker); |
3087 WRITE_BYTE_FIELD(this, kAllowOSRAtLoopNestingLevelOffset, level); | 3087 WRITE_BYTE_FIELD(this, kAllowOSRAtLoopNestingLevelOffset, level); |
3088 } | 3088 } |
3089 | 3089 |
3090 | 3090 |
| 3091 int Code::profiler_ticks() { |
| 3092 ASSERT(kind() == FUNCTION); |
| 3093 return READ_BYTE_FIELD(this, kProfilerTicksOffset); |
| 3094 } |
| 3095 |
| 3096 |
| 3097 void Code::set_profiler_ticks(int ticks) { |
| 3098 ASSERT(kind() == FUNCTION); |
| 3099 ASSERT(ticks < 256); |
| 3100 WRITE_BYTE_FIELD(this, kProfilerTicksOffset, ticks); |
| 3101 } |
| 3102 |
| 3103 |
3091 unsigned Code::stack_slots() { | 3104 unsigned Code::stack_slots() { |
3092 ASSERT(kind() == OPTIMIZED_FUNCTION); | 3105 ASSERT(kind() == OPTIMIZED_FUNCTION); |
3093 return READ_UINT32_FIELD(this, kStackSlotsOffset); | 3106 return READ_UINT32_FIELD(this, kStackSlotsOffset); |
3094 } | 3107 } |
3095 | 3108 |
3096 | 3109 |
3097 void Code::set_stack_slots(unsigned slots) { | 3110 void Code::set_stack_slots(unsigned slots) { |
3098 ASSERT(kind() == OPTIMIZED_FUNCTION); | 3111 ASSERT(kind() == OPTIMIZED_FUNCTION); |
3099 WRITE_UINT32_FIELD(this, kStackSlotsOffset, slots); | 3112 WRITE_UINT32_FIELD(this, kStackSlotsOffset, slots); |
3100 } | 3113 } |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3500 ACCESSORS(SharedFunctionInfo, construct_stub, Code, kConstructStubOffset) | 3513 ACCESSORS(SharedFunctionInfo, construct_stub, Code, kConstructStubOffset) |
3501 ACCESSORS(SharedFunctionInfo, initial_map, Object, kInitialMapOffset) | 3514 ACCESSORS(SharedFunctionInfo, initial_map, Object, kInitialMapOffset) |
3502 ACCESSORS(SharedFunctionInfo, instance_class_name, Object, | 3515 ACCESSORS(SharedFunctionInfo, instance_class_name, Object, |
3503 kInstanceClassNameOffset) | 3516 kInstanceClassNameOffset) |
3504 ACCESSORS(SharedFunctionInfo, function_data, Object, kFunctionDataOffset) | 3517 ACCESSORS(SharedFunctionInfo, function_data, Object, kFunctionDataOffset) |
3505 ACCESSORS(SharedFunctionInfo, script, Object, kScriptOffset) | 3518 ACCESSORS(SharedFunctionInfo, script, Object, kScriptOffset) |
3506 ACCESSORS(SharedFunctionInfo, debug_info, Object, kDebugInfoOffset) | 3519 ACCESSORS(SharedFunctionInfo, debug_info, Object, kDebugInfoOffset) |
3507 ACCESSORS(SharedFunctionInfo, inferred_name, String, kInferredNameOffset) | 3520 ACCESSORS(SharedFunctionInfo, inferred_name, String, kInferredNameOffset) |
3508 ACCESSORS(SharedFunctionInfo, this_property_assignments, Object, | 3521 ACCESSORS(SharedFunctionInfo, this_property_assignments, Object, |
3509 kThisPropertyAssignmentsOffset) | 3522 kThisPropertyAssignmentsOffset) |
| 3523 SMI_ACCESSORS(SharedFunctionInfo, ic_age, kICAgeOffset) |
3510 | 3524 |
3511 | 3525 |
3512 BOOL_ACCESSORS(FunctionTemplateInfo, flag, hidden_prototype, | 3526 BOOL_ACCESSORS(FunctionTemplateInfo, flag, hidden_prototype, |
3513 kHiddenPrototypeBit) | 3527 kHiddenPrototypeBit) |
3514 BOOL_ACCESSORS(FunctionTemplateInfo, flag, undetectable, kUndetectableBit) | 3528 BOOL_ACCESSORS(FunctionTemplateInfo, flag, undetectable, kUndetectableBit) |
3515 BOOL_ACCESSORS(FunctionTemplateInfo, flag, needs_access_check, | 3529 BOOL_ACCESSORS(FunctionTemplateInfo, flag, needs_access_check, |
3516 kNeedsAccessCheckBit) | 3530 kNeedsAccessCheckBit) |
3517 BOOL_ACCESSORS(FunctionTemplateInfo, flag, read_only_prototype, | 3531 BOOL_ACCESSORS(FunctionTemplateInfo, flag, read_only_prototype, |
3518 kReadOnlyPrototypeBit) | 3532 kReadOnlyPrototypeBit) |
3519 BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_expression, | 3533 BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_expression, |
(...skipping 30 matching lines...) Expand all Loading... |
3550 SMI_ACCESSORS(SharedFunctionInfo, end_position, kEndPositionOffset) | 3564 SMI_ACCESSORS(SharedFunctionInfo, end_position, kEndPositionOffset) |
3551 SMI_ACCESSORS(SharedFunctionInfo, function_token_position, | 3565 SMI_ACCESSORS(SharedFunctionInfo, function_token_position, |
3552 kFunctionTokenPositionOffset) | 3566 kFunctionTokenPositionOffset) |
3553 SMI_ACCESSORS(SharedFunctionInfo, compiler_hints, | 3567 SMI_ACCESSORS(SharedFunctionInfo, compiler_hints, |
3554 kCompilerHintsOffset) | 3568 kCompilerHintsOffset) |
3555 SMI_ACCESSORS(SharedFunctionInfo, this_property_assignments_count, | 3569 SMI_ACCESSORS(SharedFunctionInfo, this_property_assignments_count, |
3556 kThisPropertyAssignmentsCountOffset) | 3570 kThisPropertyAssignmentsCountOffset) |
3557 SMI_ACCESSORS(SharedFunctionInfo, opt_count, kOptCountOffset) | 3571 SMI_ACCESSORS(SharedFunctionInfo, opt_count, kOptCountOffset) |
3558 SMI_ACCESSORS(SharedFunctionInfo, ast_node_count, kAstNodeCountOffset) | 3572 SMI_ACCESSORS(SharedFunctionInfo, ast_node_count, kAstNodeCountOffset) |
3559 SMI_ACCESSORS(SharedFunctionInfo, deopt_counter, kDeoptCounterOffset) | 3573 SMI_ACCESSORS(SharedFunctionInfo, deopt_counter, kDeoptCounterOffset) |
3560 SMI_ACCESSORS(SharedFunctionInfo, profiler_ticks, kProfilerTicksOffset) | |
3561 SMI_ACCESSORS(SharedFunctionInfo, ic_age, kICAgeOffset) | |
3562 #else | 3574 #else |
3563 | 3575 |
3564 #define PSEUDO_SMI_ACCESSORS_LO(holder, name, offset) \ | 3576 #define PSEUDO_SMI_ACCESSORS_LO(holder, name, offset) \ |
3565 STATIC_ASSERT(holder::offset % kPointerSize == 0); \ | 3577 STATIC_ASSERT(holder::offset % kPointerSize == 0); \ |
3566 int holder::name() { \ | 3578 int holder::name() { \ |
3567 int value = READ_INT_FIELD(this, offset); \ | 3579 int value = READ_INT_FIELD(this, offset); \ |
3568 ASSERT(kHeapObjectTag == 1); \ | 3580 ASSERT(kHeapObjectTag == 1); \ |
3569 ASSERT((value & kHeapObjectTag) == 0); \ | 3581 ASSERT((value & kHeapObjectTag) == 0); \ |
3570 return value >> 1; \ | 3582 return value >> 1; \ |
3571 } \ | 3583 } \ |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3605 compiler_hints, | 3617 compiler_hints, |
3606 kCompilerHintsOffset) | 3618 kCompilerHintsOffset) |
3607 | 3619 |
3608 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, | 3620 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, |
3609 this_property_assignments_count, | 3621 this_property_assignments_count, |
3610 kThisPropertyAssignmentsCountOffset) | 3622 kThisPropertyAssignmentsCountOffset) |
3611 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, opt_count, kOptCountOffset) | 3623 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, opt_count, kOptCountOffset) |
3612 | 3624 |
3613 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, ast_node_count, kAstNodeCountOffset) | 3625 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, ast_node_count, kAstNodeCountOffset) |
3614 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, deopt_counter, kDeoptCounterOffset) | 3626 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, deopt_counter, kDeoptCounterOffset) |
3615 | |
3616 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, | |
3617 profiler_ticks, | |
3618 kProfilerTicksOffset) | |
3619 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, ic_age, kICAgeOffset) | |
3620 #endif | 3627 #endif |
3621 | 3628 |
3622 | 3629 |
3623 int SharedFunctionInfo::construction_count() { | 3630 int SharedFunctionInfo::construction_count() { |
3624 return READ_BYTE_FIELD(this, kConstructionCountOffset); | 3631 return READ_BYTE_FIELD(this, kConstructionCountOffset); |
3625 } | 3632 } |
3626 | 3633 |
3627 | 3634 |
3628 void SharedFunctionInfo::set_construction_count(int value) { | 3635 void SharedFunctionInfo::set_construction_count(int value) { |
3629 ASSERT(0 <= value && value < 256); | 3636 ASSERT(0 <= value && value < 256); |
(...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4813 return isolate->factory()->undefined_value(); | 4820 return isolate->factory()->undefined_value(); |
4814 } | 4821 } |
4815 | 4822 |
4816 | 4823 |
4817 Object* TypeFeedbackCells::RawUninitializedSentinel(Heap* heap) { | 4824 Object* TypeFeedbackCells::RawUninitializedSentinel(Heap* heap) { |
4818 return heap->raw_unchecked_the_hole_value(); | 4825 return heap->raw_unchecked_the_hole_value(); |
4819 } | 4826 } |
4820 | 4827 |
4821 | 4828 |
4822 SMI_ACCESSORS(TypeFeedbackInfo, ic_total_count, kIcTotalCountOffset) | 4829 SMI_ACCESSORS(TypeFeedbackInfo, ic_total_count, kIcTotalCountOffset) |
4823 SMI_ACCESSORS(TypeFeedbackInfo, ic_with_typeinfo_count, | 4830 SMI_ACCESSORS(TypeFeedbackInfo, ic_with_type_info_count, |
4824 kIcWithTypeinfoCountOffset) | 4831 kIcWithTypeinfoCountOffset) |
4825 ACCESSORS(TypeFeedbackInfo, type_feedback_cells, TypeFeedbackCells, | 4832 ACCESSORS(TypeFeedbackInfo, type_feedback_cells, TypeFeedbackCells, |
4826 kTypeFeedbackCellsOffset) | 4833 kTypeFeedbackCellsOffset) |
4827 | 4834 |
4828 | 4835 |
4829 SMI_ACCESSORS(AliasedArgumentsEntry, aliased_context_slot, kAliasedContextSlot) | 4836 SMI_ACCESSORS(AliasedArgumentsEntry, aliased_context_slot, kAliasedContextSlot) |
4830 | 4837 |
4831 | 4838 |
4832 Relocatable::Relocatable(Isolate* isolate) { | 4839 Relocatable::Relocatable(Isolate* isolate) { |
4833 ASSERT(isolate == Isolate::Current()); | 4840 ASSERT(isolate == Isolate::Current()); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4934 #undef WRITE_UINT32_FIELD | 4941 #undef WRITE_UINT32_FIELD |
4935 #undef READ_SHORT_FIELD | 4942 #undef READ_SHORT_FIELD |
4936 #undef WRITE_SHORT_FIELD | 4943 #undef WRITE_SHORT_FIELD |
4937 #undef READ_BYTE_FIELD | 4944 #undef READ_BYTE_FIELD |
4938 #undef WRITE_BYTE_FIELD | 4945 #undef WRITE_BYTE_FIELD |
4939 | 4946 |
4940 | 4947 |
4941 } } // namespace v8::internal | 4948 } } // namespace v8::internal |
4942 | 4949 |
4943 #endif // V8_OBJECTS_INL_H_ | 4950 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |