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 3418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3429 | 3429 |
3430 | 3430 |
3431 int Code::arguments_count() { | 3431 int Code::arguments_count() { |
3432 ASSERT(is_call_stub() || is_keyed_call_stub() || kind() == STUB); | 3432 ASSERT(is_call_stub() || is_keyed_call_stub() || kind() == STUB); |
3433 return ExtractArgumentsCountFromFlags(flags()); | 3433 return ExtractArgumentsCountFromFlags(flags()); |
3434 } | 3434 } |
3435 | 3435 |
3436 | 3436 |
3437 int Code::major_key() { | 3437 int Code::major_key() { |
3438 ASSERT(kind() == STUB || | 3438 ASSERT(kind() == STUB || |
3439 kind() == COMPILED_STUB || | |
3440 kind() == UNARY_OP_IC || | 3439 kind() == UNARY_OP_IC || |
3441 kind() == BINARY_OP_IC || | 3440 kind() == BINARY_OP_IC || |
3442 kind() == COMPARE_IC || | 3441 kind() == COMPARE_IC || |
3443 kind() == TO_BOOLEAN_IC); | 3442 kind() == TO_BOOLEAN_IC); |
3444 return StubMajorKeyField::decode( | 3443 return StubMajorKeyField::decode( |
3445 READ_UINT32_FIELD(this, kKindSpecificFlags2Offset)); | 3444 READ_UINT32_FIELD(this, kKindSpecificFlags2Offset)); |
3446 } | 3445 } |
3447 | 3446 |
3448 | 3447 |
3449 void Code::set_major_key(int major) { | 3448 void Code::set_major_key(int major) { |
3450 ASSERT(kind() == STUB || | 3449 ASSERT(kind() == STUB || |
3451 kind() == COMPILED_STUB || | |
3452 kind() == UNARY_OP_IC || | 3450 kind() == UNARY_OP_IC || |
3453 kind() == BINARY_OP_IC || | 3451 kind() == BINARY_OP_IC || |
3454 kind() == COMPARE_IC || | 3452 kind() == COMPARE_IC || |
3455 kind() == TO_BOOLEAN_IC); | 3453 kind() == TO_BOOLEAN_IC); |
3456 ASSERT(0 <= major && major < 256); | 3454 ASSERT(0 <= major && major < 256); |
3457 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); | 3455 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); |
3458 int updated = StubMajorKeyField::update(previous, major); | 3456 int updated = StubMajorKeyField::update(previous, major); |
3459 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated); | 3457 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated); |
3460 } | 3458 } |
3461 | 3459 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3550 | 3548 |
3551 | 3549 |
3552 void Code::set_profiler_ticks(int ticks) { | 3550 void Code::set_profiler_ticks(int ticks) { |
3553 ASSERT_EQ(FUNCTION, kind()); | 3551 ASSERT_EQ(FUNCTION, kind()); |
3554 ASSERT(ticks < 256); | 3552 ASSERT(ticks < 256); |
3555 WRITE_BYTE_FIELD(this, kProfilerTicksOffset, ticks); | 3553 WRITE_BYTE_FIELD(this, kProfilerTicksOffset, ticks); |
3556 } | 3554 } |
3557 | 3555 |
3558 | 3556 |
3559 unsigned Code::stack_slots() { | 3557 unsigned Code::stack_slots() { |
3560 ASSERT(kind() == OPTIMIZED_FUNCTION || kind() == COMPILED_STUB); | 3558 ASSERT(kind() == OPTIMIZED_FUNCTION); |
3561 return StackSlotsField::decode( | 3559 return StackSlotsField::decode( |
3562 READ_UINT32_FIELD(this, kKindSpecificFlags1Offset)); | 3560 READ_UINT32_FIELD(this, kKindSpecificFlags1Offset)); |
3563 } | 3561 } |
3564 | 3562 |
3565 | 3563 |
3566 void Code::set_stack_slots(unsigned slots) { | 3564 void Code::set_stack_slots(unsigned slots) { |
3567 CHECK(slots <= (1 << kStackSlotsBitCount)); | 3565 CHECK(slots <= (1 << kStackSlotsBitCount)); |
3568 ASSERT(kind() == OPTIMIZED_FUNCTION || kind() == COMPILED_STUB); | 3566 ASSERT(kind() == OPTIMIZED_FUNCTION); |
3569 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); | 3567 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); |
3570 int updated = StackSlotsField::update(previous, slots); | 3568 int updated = StackSlotsField::update(previous, slots); |
3571 WRITE_UINT32_FIELD(this, kKindSpecificFlags1Offset, updated); | 3569 WRITE_UINT32_FIELD(this, kKindSpecificFlags1Offset, updated); |
3572 } | 3570 } |
3573 | 3571 |
3574 | 3572 |
3575 unsigned Code::safepoint_table_offset() { | 3573 unsigned Code::safepoint_table_offset() { |
3576 ASSERT(kind() == OPTIMIZED_FUNCTION || kind() == COMPILED_STUB); | 3574 ASSERT(kind() == OPTIMIZED_FUNCTION); |
3577 return SafepointTableOffsetField::decode( | 3575 return SafepointTableOffsetField::decode( |
3578 READ_UINT32_FIELD(this, kKindSpecificFlags2Offset)); | 3576 READ_UINT32_FIELD(this, kKindSpecificFlags2Offset)); |
3579 } | 3577 } |
3580 | 3578 |
3581 | 3579 |
3582 void Code::set_safepoint_table_offset(unsigned offset) { | 3580 void Code::set_safepoint_table_offset(unsigned offset) { |
3583 CHECK(offset <= (1 << kSafepointTableOffsetBitCount)); | 3581 CHECK(offset <= (1 << kSafepointTableOffsetBitCount)); |
3584 ASSERT(kind() == OPTIMIZED_FUNCTION || kind() == COMPILED_STUB); | 3582 ASSERT(kind() == OPTIMIZED_FUNCTION); |
3585 ASSERT(IsAligned(offset, static_cast<unsigned>(kIntSize))); | 3583 ASSERT(IsAligned(offset, static_cast<unsigned>(kIntSize))); |
3586 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); | 3584 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); |
3587 int updated = SafepointTableOffsetField::update(previous, offset); | 3585 int updated = SafepointTableOffsetField::update(previous, offset); |
3588 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated); | 3586 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated); |
3589 } | 3587 } |
3590 | 3588 |
3591 | 3589 |
3592 unsigned Code::stack_check_table_offset() { | 3590 unsigned Code::stack_check_table_offset() { |
3593 ASSERT_EQ(FUNCTION, kind()); | 3591 ASSERT_EQ(FUNCTION, kind()); |
3594 return StackCheckTableOffsetField::decode( | 3592 return StackCheckTableOffsetField::decode( |
(...skipping 2171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5766 #undef WRITE_UINT32_FIELD | 5764 #undef WRITE_UINT32_FIELD |
5767 #undef READ_SHORT_FIELD | 5765 #undef READ_SHORT_FIELD |
5768 #undef WRITE_SHORT_FIELD | 5766 #undef WRITE_SHORT_FIELD |
5769 #undef READ_BYTE_FIELD | 5767 #undef READ_BYTE_FIELD |
5770 #undef WRITE_BYTE_FIELD | 5768 #undef WRITE_BYTE_FIELD |
5771 | 5769 |
5772 | 5770 |
5773 } } // namespace v8::internal | 5771 } } // namespace v8::internal |
5774 | 5772 |
5775 #endif // V8_OBJECTS_INL_H_ | 5773 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |