Chromium Code Reviews| 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); | |
|
ulan
2012/03/27 11:40:58
Now profiler ticks have to fit into one byte, and
Jakob Kummerow
2012/03/27 12:19:10
Done.
| |
| 3094 } | |
| 3095 | |
| 3096 | |
| 3097 void Code::set_profiler_ticks(int ticks) { | |
|
ulan
2012/03/27 11:40:58
ASSERT(ticks < 256);
Jakob Kummerow
2012/03/27 12:19:10
Done.
| |
| 3098 ASSERT(kind() == FUNCTION); | |
| 3099 WRITE_BYTE_FIELD(this, kProfilerTicksOffset, ticks); | |
| 3100 } | |
| 3101 | |
| 3102 | |
| 3091 unsigned Code::stack_slots() { | 3103 unsigned Code::stack_slots() { |
| 3092 ASSERT(kind() == OPTIMIZED_FUNCTION); | 3104 ASSERT(kind() == OPTIMIZED_FUNCTION); |
| 3093 return READ_UINT32_FIELD(this, kStackSlotsOffset); | 3105 return READ_UINT32_FIELD(this, kStackSlotsOffset); |
| 3094 } | 3106 } |
| 3095 | 3107 |
| 3096 | 3108 |
| 3097 void Code::set_stack_slots(unsigned slots) { | 3109 void Code::set_stack_slots(unsigned slots) { |
| 3098 ASSERT(kind() == OPTIMIZED_FUNCTION); | 3110 ASSERT(kind() == OPTIMIZED_FUNCTION); |
| 3099 WRITE_UINT32_FIELD(this, kStackSlotsOffset, slots); | 3111 WRITE_UINT32_FIELD(this, kStackSlotsOffset, slots); |
| 3100 } | 3112 } |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3500 ACCESSORS(SharedFunctionInfo, construct_stub, Code, kConstructStubOffset) | 3512 ACCESSORS(SharedFunctionInfo, construct_stub, Code, kConstructStubOffset) |
| 3501 ACCESSORS(SharedFunctionInfo, initial_map, Object, kInitialMapOffset) | 3513 ACCESSORS(SharedFunctionInfo, initial_map, Object, kInitialMapOffset) |
| 3502 ACCESSORS(SharedFunctionInfo, instance_class_name, Object, | 3514 ACCESSORS(SharedFunctionInfo, instance_class_name, Object, |
| 3503 kInstanceClassNameOffset) | 3515 kInstanceClassNameOffset) |
| 3504 ACCESSORS(SharedFunctionInfo, function_data, Object, kFunctionDataOffset) | 3516 ACCESSORS(SharedFunctionInfo, function_data, Object, kFunctionDataOffset) |
| 3505 ACCESSORS(SharedFunctionInfo, script, Object, kScriptOffset) | 3517 ACCESSORS(SharedFunctionInfo, script, Object, kScriptOffset) |
| 3506 ACCESSORS(SharedFunctionInfo, debug_info, Object, kDebugInfoOffset) | 3518 ACCESSORS(SharedFunctionInfo, debug_info, Object, kDebugInfoOffset) |
| 3507 ACCESSORS(SharedFunctionInfo, inferred_name, String, kInferredNameOffset) | 3519 ACCESSORS(SharedFunctionInfo, inferred_name, String, kInferredNameOffset) |
| 3508 ACCESSORS(SharedFunctionInfo, this_property_assignments, Object, | 3520 ACCESSORS(SharedFunctionInfo, this_property_assignments, Object, |
| 3509 kThisPropertyAssignmentsOffset) | 3521 kThisPropertyAssignmentsOffset) |
| 3522 SMI_ACCESSORS(SharedFunctionInfo, ic_age, kICAgeOffset) | |
| 3510 | 3523 |
| 3511 | 3524 |
| 3512 BOOL_ACCESSORS(FunctionTemplateInfo, flag, hidden_prototype, | 3525 BOOL_ACCESSORS(FunctionTemplateInfo, flag, hidden_prototype, |
| 3513 kHiddenPrototypeBit) | 3526 kHiddenPrototypeBit) |
| 3514 BOOL_ACCESSORS(FunctionTemplateInfo, flag, undetectable, kUndetectableBit) | 3527 BOOL_ACCESSORS(FunctionTemplateInfo, flag, undetectable, kUndetectableBit) |
| 3515 BOOL_ACCESSORS(FunctionTemplateInfo, flag, needs_access_check, | 3528 BOOL_ACCESSORS(FunctionTemplateInfo, flag, needs_access_check, |
| 3516 kNeedsAccessCheckBit) | 3529 kNeedsAccessCheckBit) |
| 3517 BOOL_ACCESSORS(FunctionTemplateInfo, flag, read_only_prototype, | 3530 BOOL_ACCESSORS(FunctionTemplateInfo, flag, read_only_prototype, |
| 3518 kReadOnlyPrototypeBit) | 3531 kReadOnlyPrototypeBit) |
| 3519 BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_expression, | 3532 BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_expression, |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 3550 SMI_ACCESSORS(SharedFunctionInfo, end_position, kEndPositionOffset) | 3563 SMI_ACCESSORS(SharedFunctionInfo, end_position, kEndPositionOffset) |
| 3551 SMI_ACCESSORS(SharedFunctionInfo, function_token_position, | 3564 SMI_ACCESSORS(SharedFunctionInfo, function_token_position, |
| 3552 kFunctionTokenPositionOffset) | 3565 kFunctionTokenPositionOffset) |
| 3553 SMI_ACCESSORS(SharedFunctionInfo, compiler_hints, | 3566 SMI_ACCESSORS(SharedFunctionInfo, compiler_hints, |
| 3554 kCompilerHintsOffset) | 3567 kCompilerHintsOffset) |
| 3555 SMI_ACCESSORS(SharedFunctionInfo, this_property_assignments_count, | 3568 SMI_ACCESSORS(SharedFunctionInfo, this_property_assignments_count, |
| 3556 kThisPropertyAssignmentsCountOffset) | 3569 kThisPropertyAssignmentsCountOffset) |
| 3557 SMI_ACCESSORS(SharedFunctionInfo, opt_count, kOptCountOffset) | 3570 SMI_ACCESSORS(SharedFunctionInfo, opt_count, kOptCountOffset) |
| 3558 SMI_ACCESSORS(SharedFunctionInfo, ast_node_count, kAstNodeCountOffset) | 3571 SMI_ACCESSORS(SharedFunctionInfo, ast_node_count, kAstNodeCountOffset) |
| 3559 SMI_ACCESSORS(SharedFunctionInfo, deopt_counter, kDeoptCounterOffset) | 3572 SMI_ACCESSORS(SharedFunctionInfo, deopt_counter, kDeoptCounterOffset) |
| 3560 SMI_ACCESSORS(SharedFunctionInfo, profiler_ticks, kProfilerTicksOffset) | |
| 3561 SMI_ACCESSORS(SharedFunctionInfo, ic_age, kICAgeOffset) | |
| 3562 #else | 3573 #else |
| 3563 | 3574 |
| 3564 #define PSEUDO_SMI_ACCESSORS_LO(holder, name, offset) \ | 3575 #define PSEUDO_SMI_ACCESSORS_LO(holder, name, offset) \ |
| 3565 STATIC_ASSERT(holder::offset % kPointerSize == 0); \ | 3576 STATIC_ASSERT(holder::offset % kPointerSize == 0); \ |
| 3566 int holder::name() { \ | 3577 int holder::name() { \ |
| 3567 int value = READ_INT_FIELD(this, offset); \ | 3578 int value = READ_INT_FIELD(this, offset); \ |
| 3568 ASSERT(kHeapObjectTag == 1); \ | 3579 ASSERT(kHeapObjectTag == 1); \ |
| 3569 ASSERT((value & kHeapObjectTag) == 0); \ | 3580 ASSERT((value & kHeapObjectTag) == 0); \ |
| 3570 return value >> 1; \ | 3581 return value >> 1; \ |
| 3571 } \ | 3582 } \ |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3605 compiler_hints, | 3616 compiler_hints, |
| 3606 kCompilerHintsOffset) | 3617 kCompilerHintsOffset) |
| 3607 | 3618 |
| 3608 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, | 3619 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, |
| 3609 this_property_assignments_count, | 3620 this_property_assignments_count, |
| 3610 kThisPropertyAssignmentsCountOffset) | 3621 kThisPropertyAssignmentsCountOffset) |
| 3611 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, opt_count, kOptCountOffset) | 3622 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, opt_count, kOptCountOffset) |
| 3612 | 3623 |
| 3613 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, ast_node_count, kAstNodeCountOffset) | 3624 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, ast_node_count, kAstNodeCountOffset) |
| 3614 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, deopt_counter, kDeoptCounterOffset) | 3625 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 | 3626 #endif |
| 3621 | 3627 |
| 3622 | 3628 |
| 3623 int SharedFunctionInfo::construction_count() { | 3629 int SharedFunctionInfo::construction_count() { |
| 3624 return READ_BYTE_FIELD(this, kConstructionCountOffset); | 3630 return READ_BYTE_FIELD(this, kConstructionCountOffset); |
| 3625 } | 3631 } |
| 3626 | 3632 |
| 3627 | 3633 |
| 3628 void SharedFunctionInfo::set_construction_count(int value) { | 3634 void SharedFunctionInfo::set_construction_count(int value) { |
| 3629 ASSERT(0 <= value && value < 256); | 3635 ASSERT(0 <= value && value < 256); |
| (...skipping 1304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4934 #undef WRITE_UINT32_FIELD | 4940 #undef WRITE_UINT32_FIELD |
| 4935 #undef READ_SHORT_FIELD | 4941 #undef READ_SHORT_FIELD |
| 4936 #undef WRITE_SHORT_FIELD | 4942 #undef WRITE_SHORT_FIELD |
| 4937 #undef READ_BYTE_FIELD | 4943 #undef READ_BYTE_FIELD |
| 4938 #undef WRITE_BYTE_FIELD | 4944 #undef WRITE_BYTE_FIELD |
| 4939 | 4945 |
| 4940 | 4946 |
| 4941 } } // namespace v8::internal | 4947 } } // namespace v8::internal |
| 4942 | 4948 |
| 4943 #endif // V8_OBJECTS_INL_H_ | 4949 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |