OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 2555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2566 | 2566 |
2567 | 2567 |
2568 int Code::arguments_count() { | 2568 int Code::arguments_count() { |
2569 ASSERT(is_call_stub() || is_keyed_call_stub() || kind() == STUB); | 2569 ASSERT(is_call_stub() || is_keyed_call_stub() || kind() == STUB); |
2570 return ExtractArgumentsCountFromFlags(flags()); | 2570 return ExtractArgumentsCountFromFlags(flags()); |
2571 } | 2571 } |
2572 | 2572 |
2573 | 2573 |
2574 int Code::major_key() { | 2574 int Code::major_key() { |
2575 ASSERT(kind() == STUB || | 2575 ASSERT(kind() == STUB || |
2576 kind() == BINARY_OP_IC || | |
2577 kind() == TYPE_RECORDING_BINARY_OP_IC || | 2576 kind() == TYPE_RECORDING_BINARY_OP_IC || |
2578 kind() == COMPARE_IC); | 2577 kind() == COMPARE_IC); |
2579 return READ_BYTE_FIELD(this, kStubMajorKeyOffset); | 2578 return READ_BYTE_FIELD(this, kStubMajorKeyOffset); |
2580 } | 2579 } |
2581 | 2580 |
2582 | 2581 |
2583 void Code::set_major_key(int major) { | 2582 void Code::set_major_key(int major) { |
2584 ASSERT(kind() == STUB || | 2583 ASSERT(kind() == STUB || |
2585 kind() == BINARY_OP_IC || | |
2586 kind() == TYPE_RECORDING_BINARY_OP_IC || | 2584 kind() == TYPE_RECORDING_BINARY_OP_IC || |
2587 kind() == COMPARE_IC); | 2585 kind() == COMPARE_IC); |
2588 ASSERT(0 <= major && major < 256); | 2586 ASSERT(0 <= major && major < 256); |
2589 WRITE_BYTE_FIELD(this, kStubMajorKeyOffset, major); | 2587 WRITE_BYTE_FIELD(this, kStubMajorKeyOffset, major); |
2590 } | 2588 } |
2591 | 2589 |
2592 | 2590 |
2593 bool Code::optimizable() { | 2591 bool Code::optimizable() { |
2594 ASSERT(kind() == FUNCTION); | 2592 ASSERT(kind() == FUNCTION); |
2595 return READ_BYTE_FIELD(this, kOptimizableOffset) == 1; | 2593 return READ_BYTE_FIELD(this, kOptimizableOffset) == 1; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2684 return static_cast<ExternalArrayType>(type); | 2682 return static_cast<ExternalArrayType>(type); |
2685 } | 2683 } |
2686 | 2684 |
2687 | 2685 |
2688 void Code::set_external_array_type(ExternalArrayType value) { | 2686 void Code::set_external_array_type(ExternalArrayType value) { |
2689 ASSERT(is_external_array_load_stub() || is_external_array_store_stub()); | 2687 ASSERT(is_external_array_load_stub() || is_external_array_store_stub()); |
2690 WRITE_BYTE_FIELD(this, kExternalArrayTypeOffset, value); | 2688 WRITE_BYTE_FIELD(this, kExternalArrayTypeOffset, value); |
2691 } | 2689 } |
2692 | 2690 |
2693 | 2691 |
2694 byte Code::binary_op_type() { | |
2695 ASSERT(is_binary_op_stub()); | |
2696 return READ_BYTE_FIELD(this, kBinaryOpTypeOffset); | |
2697 } | |
2698 | |
2699 | |
2700 void Code::set_binary_op_type(byte value) { | |
2701 ASSERT(is_binary_op_stub()); | |
2702 WRITE_BYTE_FIELD(this, kBinaryOpTypeOffset, value); | |
2703 } | |
2704 | |
2705 | |
2706 byte Code::type_recording_binary_op_type() { | 2692 byte Code::type_recording_binary_op_type() { |
2707 ASSERT(is_type_recording_binary_op_stub()); | 2693 ASSERT(is_type_recording_binary_op_stub()); |
2708 return READ_BYTE_FIELD(this, kBinaryOpTypeOffset); | 2694 return READ_BYTE_FIELD(this, kBinaryOpTypeOffset); |
2709 } | 2695 } |
2710 | 2696 |
2711 | 2697 |
2712 void Code::set_type_recording_binary_op_type(byte value) { | 2698 void Code::set_type_recording_binary_op_type(byte value) { |
2713 ASSERT(is_type_recording_binary_op_stub()); | 2699 ASSERT(is_type_recording_binary_op_stub()); |
2714 WRITE_BYTE_FIELD(this, kBinaryOpTypeOffset, value); | 2700 WRITE_BYTE_FIELD(this, kBinaryOpTypeOffset, value); |
2715 } | 2701 } |
(...skipping 1441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4157 #undef WRITE_INT_FIELD | 4143 #undef WRITE_INT_FIELD |
4158 #undef READ_SHORT_FIELD | 4144 #undef READ_SHORT_FIELD |
4159 #undef WRITE_SHORT_FIELD | 4145 #undef WRITE_SHORT_FIELD |
4160 #undef READ_BYTE_FIELD | 4146 #undef READ_BYTE_FIELD |
4161 #undef WRITE_BYTE_FIELD | 4147 #undef WRITE_BYTE_FIELD |
4162 | 4148 |
4163 | 4149 |
4164 } } // namespace v8::internal | 4150 } } // namespace v8::internal |
4165 | 4151 |
4166 #endif // V8_OBJECTS_INL_H_ | 4152 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |