Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Side by Side Diff: src/objects-inl.h

Issue 14307006: Make it possible to Crankshaft all kinds of stubs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/objects.cc ('k') | src/runtime.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3627 matching lines...) Expand 10 before | Expand all | Expand 10 after
3638 return ExtractTypeFromFlags(flags()); 3638 return ExtractTypeFromFlags(flags());
3639 } 3639 }
3640 3640
3641 3641
3642 int Code::arguments_count() { 3642 int Code::arguments_count() {
3643 ASSERT(is_call_stub() || is_keyed_call_stub() || kind() == STUB); 3643 ASSERT(is_call_stub() || is_keyed_call_stub() || kind() == STUB);
3644 return ExtractArgumentsCountFromFlags(flags()); 3644 return ExtractArgumentsCountFromFlags(flags());
3645 } 3645 }
3646 3646
3647 3647
3648 inline bool Code::is_crankshafted() {
3649 return IsCrankshaftedField::decode(
3650 READ_UINT32_FIELD(this, kKindSpecificFlags2Offset));
3651 }
3652
3653
3654 inline void Code::set_is_crankshafted(bool value) {
3655 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset);
3656 int updated = IsCrankshaftedField::update(previous, value);
3657 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated);
3658 }
3659
3660
3648 int Code::major_key() { 3661 int Code::major_key() {
3649 ASSERT(kind() == STUB || 3662 ASSERT(kind() == STUB ||
3650 kind() == COMPILED_STUB ||
3651 kind() == UNARY_OP_IC || 3663 kind() == UNARY_OP_IC ||
3652 kind() == BINARY_OP_IC || 3664 kind() == BINARY_OP_IC ||
3653 kind() == COMPARE_IC || 3665 kind() == COMPARE_IC ||
3654 kind() == LOAD_IC || 3666 kind() == LOAD_IC ||
3655 kind() == KEYED_LOAD_IC || 3667 kind() == KEYED_LOAD_IC ||
3656 kind() == TO_BOOLEAN_IC); 3668 kind() == TO_BOOLEAN_IC);
3657 return StubMajorKeyField::decode( 3669 return StubMajorKeyField::decode(
3658 READ_UINT32_FIELD(this, kKindSpecificFlags2Offset)); 3670 READ_UINT32_FIELD(this, kKindSpecificFlags2Offset));
3659 } 3671 }
3660 3672
3661 3673
3662 void Code::set_major_key(int major) { 3674 void Code::set_major_key(int major) {
3663 ASSERT(kind() == STUB || 3675 ASSERT(kind() == STUB ||
3664 kind() == COMPILED_STUB ||
3665 kind() == UNARY_OP_IC || 3676 kind() == UNARY_OP_IC ||
3666 kind() == BINARY_OP_IC || 3677 kind() == BINARY_OP_IC ||
3667 kind() == COMPARE_IC || 3678 kind() == COMPARE_IC ||
3668 kind() == LOAD_IC || 3679 kind() == LOAD_IC ||
3669 kind() == KEYED_LOAD_IC || 3680 kind() == KEYED_LOAD_IC ||
3670 kind() == STORE_IC || 3681 kind() == STORE_IC ||
3671 kind() == KEYED_STORE_IC || 3682 kind() == KEYED_STORE_IC ||
3672 kind() == TO_BOOLEAN_IC); 3683 kind() == TO_BOOLEAN_IC);
3673 ASSERT(0 <= major && major < 256); 3684 ASSERT(0 <= major && major < 256);
3674 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); 3685 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset);
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
3767 3778
3768 3779
3769 void Code::set_profiler_ticks(int ticks) { 3780 void Code::set_profiler_ticks(int ticks) {
3770 ASSERT_EQ(FUNCTION, kind()); 3781 ASSERT_EQ(FUNCTION, kind());
3771 ASSERT(ticks < 256); 3782 ASSERT(ticks < 256);
3772 WRITE_BYTE_FIELD(this, kProfilerTicksOffset, ticks); 3783 WRITE_BYTE_FIELD(this, kProfilerTicksOffset, ticks);
3773 } 3784 }
3774 3785
3775 3786
3776 unsigned Code::stack_slots() { 3787 unsigned Code::stack_slots() {
3777 ASSERT(kind() == OPTIMIZED_FUNCTION || kind() == COMPILED_STUB); 3788 ASSERT(is_crankshafted());
3778 return StackSlotsField::decode( 3789 return StackSlotsField::decode(
3779 READ_UINT32_FIELD(this, kKindSpecificFlags1Offset)); 3790 READ_UINT32_FIELD(this, kKindSpecificFlags1Offset));
3780 } 3791 }
3781 3792
3782 3793
3783 void Code::set_stack_slots(unsigned slots) { 3794 void Code::set_stack_slots(unsigned slots) {
3784 CHECK(slots <= (1 << kStackSlotsBitCount)); 3795 CHECK(slots <= (1 << kStackSlotsBitCount));
3785 ASSERT(kind() == OPTIMIZED_FUNCTION || kind() == COMPILED_STUB); 3796 ASSERT(is_crankshafted());
3786 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset); 3797 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags1Offset);
3787 int updated = StackSlotsField::update(previous, slots); 3798 int updated = StackSlotsField::update(previous, slots);
3788 WRITE_UINT32_FIELD(this, kKindSpecificFlags1Offset, updated); 3799 WRITE_UINT32_FIELD(this, kKindSpecificFlags1Offset, updated);
3789 } 3800 }
3790 3801
3791 3802
3792 unsigned Code::safepoint_table_offset() { 3803 unsigned Code::safepoint_table_offset() {
3793 ASSERT(kind() == OPTIMIZED_FUNCTION || kind() == COMPILED_STUB); 3804 ASSERT(is_crankshafted());
3794 return SafepointTableOffsetField::decode( 3805 return SafepointTableOffsetField::decode(
3795 READ_UINT32_FIELD(this, kKindSpecificFlags2Offset)); 3806 READ_UINT32_FIELD(this, kKindSpecificFlags2Offset));
3796 } 3807 }
3797 3808
3798 3809
3799 void Code::set_safepoint_table_offset(unsigned offset) { 3810 void Code::set_safepoint_table_offset(unsigned offset) {
3800 CHECK(offset <= (1 << kSafepointTableOffsetBitCount)); 3811 CHECK(offset <= (1 << kSafepointTableOffsetBitCount));
3801 ASSERT(kind() == OPTIMIZED_FUNCTION || kind() == COMPILED_STUB); 3812 ASSERT(is_crankshafted());
3802 ASSERT(IsAligned(offset, static_cast<unsigned>(kIntSize))); 3813 ASSERT(IsAligned(offset, static_cast<unsigned>(kIntSize)));
3803 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); 3814 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset);
3804 int updated = SafepointTableOffsetField::update(previous, offset); 3815 int updated = SafepointTableOffsetField::update(previous, offset);
3805 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated); 3816 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated);
3806 } 3817 }
3807 3818
3808 3819
3809 unsigned Code::back_edge_table_offset() { 3820 unsigned Code::back_edge_table_offset() {
3810 ASSERT_EQ(FUNCTION, kind()); 3821 ASSERT_EQ(FUNCTION, kind());
3811 return BackEdgeTableOffsetField::decode( 3822 return BackEdgeTableOffsetField::decode(
(...skipping 2296 matching lines...) Expand 10 before | Expand all | Expand 10 after
6108 #undef WRITE_UINT32_FIELD 6119 #undef WRITE_UINT32_FIELD
6109 #undef READ_SHORT_FIELD 6120 #undef READ_SHORT_FIELD
6110 #undef WRITE_SHORT_FIELD 6121 #undef WRITE_SHORT_FIELD
6111 #undef READ_BYTE_FIELD 6122 #undef READ_BYTE_FIELD
6112 #undef WRITE_BYTE_FIELD 6123 #undef WRITE_BYTE_FIELD
6113 6124
6114 6125
6115 } } // namespace v8::internal 6126 } } // namespace v8::internal
6116 6127
6117 #endif // V8_OBJECTS_INL_H_ 6128 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698