OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // Review notes: | 5 // Review notes: |
6 // | 6 // |
7 // - The use of macros in these inline functions may seem superfluous | 7 // - The use of macros in these inline functions may seem superfluous |
8 // but it is absolutely needed to make sure gcc generates optimal | 8 // but it is absolutely needed to make sure gcc generates optimal |
9 // code. gcc is not happy when attempting to inline too deep. | 9 // code. gcc is not happy when attempting to inline too deep. |
10 // | 10 // |
(...skipping 4671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4682 | 4682 |
4683 Code::Kind Code::kind() { | 4683 Code::Kind Code::kind() { |
4684 return ExtractKindFromFlags(flags()); | 4684 return ExtractKindFromFlags(flags()); |
4685 } | 4685 } |
4686 | 4686 |
4687 | 4687 |
4688 bool Code::IsCodeStubOrIC() { | 4688 bool Code::IsCodeStubOrIC() { |
4689 return kind() == STUB || kind() == HANDLER || kind() == LOAD_IC || | 4689 return kind() == STUB || kind() == HANDLER || kind() == LOAD_IC || |
4690 kind() == KEYED_LOAD_IC || kind() == CALL_IC || kind() == STORE_IC || | 4690 kind() == KEYED_LOAD_IC || kind() == CALL_IC || kind() == STORE_IC || |
4691 kind() == KEYED_STORE_IC || kind() == BINARY_OP_IC || | 4691 kind() == KEYED_STORE_IC || kind() == BINARY_OP_IC || |
4692 kind() == COMPARE_IC || kind() == COMPARE_NIL_IC || | 4692 kind() == COMPARE_IC || kind() == TO_BOOLEAN_IC; |
4693 kind() == TO_BOOLEAN_IC; | |
4694 } | 4693 } |
4695 | 4694 |
4696 | 4695 |
4697 bool Code::IsJavaScriptCode() { | 4696 bool Code::IsJavaScriptCode() { |
4698 return kind() == FUNCTION || kind() == OPTIMIZED_FUNCTION || | 4697 return kind() == FUNCTION || kind() == OPTIMIZED_FUNCTION || |
4699 is_interpreter_entry_trampoline(); | 4698 is_interpreter_entry_trampoline(); |
4700 } | 4699 } |
4701 | 4700 |
4702 | 4701 |
4703 InlineCacheState Code::ic_state() { | 4702 InlineCacheState Code::ic_state() { |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4973 | 4972 |
4974 bool Code::is_debug_stub() { return ic_state() == DEBUG_STUB; } | 4973 bool Code::is_debug_stub() { return ic_state() == DEBUG_STUB; } |
4975 bool Code::is_handler() { return kind() == HANDLER; } | 4974 bool Code::is_handler() { return kind() == HANDLER; } |
4976 bool Code::is_load_stub() { return kind() == LOAD_IC; } | 4975 bool Code::is_load_stub() { return kind() == LOAD_IC; } |
4977 bool Code::is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; } | 4976 bool Code::is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; } |
4978 bool Code::is_store_stub() { return kind() == STORE_IC; } | 4977 bool Code::is_store_stub() { return kind() == STORE_IC; } |
4979 bool Code::is_keyed_store_stub() { return kind() == KEYED_STORE_IC; } | 4978 bool Code::is_keyed_store_stub() { return kind() == KEYED_STORE_IC; } |
4980 bool Code::is_call_stub() { return kind() == CALL_IC; } | 4979 bool Code::is_call_stub() { return kind() == CALL_IC; } |
4981 bool Code::is_binary_op_stub() { return kind() == BINARY_OP_IC; } | 4980 bool Code::is_binary_op_stub() { return kind() == BINARY_OP_IC; } |
4982 bool Code::is_compare_ic_stub() { return kind() == COMPARE_IC; } | 4981 bool Code::is_compare_ic_stub() { return kind() == COMPARE_IC; } |
4983 bool Code::is_compare_nil_ic_stub() { return kind() == COMPARE_NIL_IC; } | |
4984 bool Code::is_to_boolean_ic_stub() { return kind() == TO_BOOLEAN_IC; } | 4982 bool Code::is_to_boolean_ic_stub() { return kind() == TO_BOOLEAN_IC; } |
4985 bool Code::is_optimized_code() { return kind() == OPTIMIZED_FUNCTION; } | 4983 bool Code::is_optimized_code() { return kind() == OPTIMIZED_FUNCTION; } |
4986 bool Code::is_wasm_code() { return kind() == WASM_FUNCTION; } | 4984 bool Code::is_wasm_code() { return kind() == WASM_FUNCTION; } |
4987 | 4985 |
4988 bool Code::embeds_maps_weakly() { | 4986 bool Code::embeds_maps_weakly() { |
4989 Kind k = kind(); | 4987 Kind k = kind(); |
4990 return (k == LOAD_IC || k == STORE_IC || k == KEYED_LOAD_IC || | 4988 return (k == LOAD_IC || k == STORE_IC || k == KEYED_LOAD_IC || |
4991 k == KEYED_STORE_IC || k == COMPARE_NIL_IC) && | 4989 k == KEYED_STORE_IC) && |
4992 ic_state() == MONOMORPHIC; | 4990 ic_state() == MONOMORPHIC; |
4993 } | 4991 } |
4994 | 4992 |
4995 | 4993 |
4996 Address Code::constant_pool() { | 4994 Address Code::constant_pool() { |
4997 Address constant_pool = NULL; | 4995 Address constant_pool = NULL; |
4998 if (FLAG_enable_embedded_constant_pool) { | 4996 if (FLAG_enable_embedded_constant_pool) { |
4999 int offset = constant_pool_offset(); | 4997 int offset = constant_pool_offset(); |
5000 if (offset < instruction_size()) { | 4998 if (offset < instruction_size()) { |
5001 constant_pool = FIELD_ADDR(this, kHeaderSize + offset); | 4999 constant_pool = FIELD_ADDR(this, kHeaderSize + offset); |
(...skipping 2757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7759 #undef WRITE_INT64_FIELD | 7757 #undef WRITE_INT64_FIELD |
7760 #undef READ_BYTE_FIELD | 7758 #undef READ_BYTE_FIELD |
7761 #undef WRITE_BYTE_FIELD | 7759 #undef WRITE_BYTE_FIELD |
7762 #undef NOBARRIER_READ_BYTE_FIELD | 7760 #undef NOBARRIER_READ_BYTE_FIELD |
7763 #undef NOBARRIER_WRITE_BYTE_FIELD | 7761 #undef NOBARRIER_WRITE_BYTE_FIELD |
7764 | 7762 |
7765 } // namespace internal | 7763 } // namespace internal |
7766 } // namespace v8 | 7764 } // namespace v8 |
7767 | 7765 |
7768 #endif // V8_OBJECTS_INL_H_ | 7766 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |