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 5296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5307 inline bool is_load_stub() { return kind() == LOAD_IC; } | 5307 inline bool is_load_stub() { return kind() == LOAD_IC; } |
5308 inline bool is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; } | 5308 inline bool is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; } |
5309 inline bool is_store_stub() { return kind() == STORE_IC; } | 5309 inline bool is_store_stub() { return kind() == STORE_IC; } |
5310 inline bool is_keyed_store_stub() { return kind() == KEYED_STORE_IC; } | 5310 inline bool is_keyed_store_stub() { return kind() == KEYED_STORE_IC; } |
5311 inline bool is_binary_op_stub() { return kind() == BINARY_OP_IC; } | 5311 inline bool is_binary_op_stub() { return kind() == BINARY_OP_IC; } |
5312 inline bool is_compare_ic_stub() { return kind() == COMPARE_IC; } | 5312 inline bool is_compare_ic_stub() { return kind() == COMPARE_IC; } |
5313 inline bool is_compare_nil_ic_stub() { return kind() == COMPARE_NIL_IC; } | 5313 inline bool is_compare_nil_ic_stub() { return kind() == COMPARE_NIL_IC; } |
5314 inline bool is_to_boolean_ic_stub() { return kind() == TO_BOOLEAN_IC; } | 5314 inline bool is_to_boolean_ic_stub() { return kind() == TO_BOOLEAN_IC; } |
5315 inline bool is_keyed_stub(); | 5315 inline bool is_keyed_stub(); |
5316 inline bool is_optimized_code() { return kind() == OPTIMIZED_FUNCTION; } | 5316 inline bool is_optimized_code() { return kind() == OPTIMIZED_FUNCTION; } |
| 5317 inline bool is_weak_stub() { |
| 5318 Kind k = kind(); |
| 5319 return (k == LOAD_IC || k == STORE_IC || k == KEYED_LOAD_IC || |
| 5320 k == KEYED_STORE_IC || k == COMPARE_NIL_IC) && |
| 5321 ic_state() == MONOMORPHIC; |
| 5322 } |
5317 | 5323 |
5318 inline void set_raw_kind_specific_flags1(int value); | 5324 inline void set_raw_kind_specific_flags1(int value); |
5319 inline void set_raw_kind_specific_flags2(int value); | 5325 inline void set_raw_kind_specific_flags2(int value); |
5320 | 5326 |
5321 // [major_key]: For kind STUB or BINARY_OP_IC, the major key. | 5327 // [major_key]: For kind STUB or BINARY_OP_IC, the major key. |
5322 inline int major_key(); | 5328 inline int major_key(); |
5323 inline void set_major_key(int value); | 5329 inline void set_major_key(int value); |
5324 inline bool has_major_key(); | 5330 inline bool has_major_key(); |
5325 | 5331 |
5326 // For kind STUB or ICs, tells whether or not a code object was generated by | 5332 // For kind STUB or ICs, tells whether or not a code object was generated by |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5564 return GetCodeAgeStub(isolate, kNotExecutedCodeAge, NO_MARKING_PARITY); | 5570 return GetCodeAgeStub(isolate, kNotExecutedCodeAge, NO_MARKING_PARITY); |
5565 } | 5571 } |
5566 | 5572 |
5567 void PrintDeoptLocation(FILE* out, int bailout_id); | 5573 void PrintDeoptLocation(FILE* out, int bailout_id); |
5568 bool CanDeoptAt(Address pc); | 5574 bool CanDeoptAt(Address pc); |
5569 | 5575 |
5570 #ifdef VERIFY_HEAP | 5576 #ifdef VERIFY_HEAP |
5571 void VerifyEmbeddedObjectsDependency(); | 5577 void VerifyEmbeddedObjectsDependency(); |
5572 #endif | 5578 #endif |
5573 | 5579 |
| 5580 inline bool CanContainWeakObjects() { |
| 5581 return is_optimized_code() || is_weak_stub(); |
| 5582 } |
| 5583 |
5574 inline bool IsWeakObject(Object* object) { | 5584 inline bool IsWeakObject(Object* object) { |
5575 return is_optimized_code() && IsWeakObjectInOptimizedCode(object); | 5585 return (is_optimized_code() && IsWeakObjectInOptimizedCode(object)) || |
| 5586 (is_weak_stub() && IsWeakObjectInIC(object)); |
5576 } | 5587 } |
5577 | 5588 |
5578 inline bool IsWeakObjectInOptimizedCode(Object* object); | 5589 inline bool IsWeakObjectInOptimizedCode(Object* object); |
| 5590 inline bool IsWeakObjectInIC(Object* object); |
5579 | 5591 |
5580 // Max loop nesting marker used to postpose OSR. We don't take loop | 5592 // Max loop nesting marker used to postpose OSR. We don't take loop |
5581 // nesting that is deeper than 5 levels into account. | 5593 // nesting that is deeper than 5 levels into account. |
5582 static const int kMaxLoopNestingMarker = 6; | 5594 static const int kMaxLoopNestingMarker = 6; |
5583 | 5595 |
5584 // Layout description. | 5596 // Layout description. |
5585 static const int kInstructionSizeOffset = HeapObject::kHeaderSize; | 5597 static const int kInstructionSizeOffset = HeapObject::kHeaderSize; |
5586 static const int kRelocationInfoOffset = kInstructionSizeOffset + kIntSize; | 5598 static const int kRelocationInfoOffset = kInstructionSizeOffset + kIntSize; |
5587 static const int kHandlerTableOffset = kRelocationInfoOffset + kPointerSize; | 5599 static const int kHandlerTableOffset = kRelocationInfoOffset + kPointerSize; |
5588 static const int kDeoptimizationDataOffset = | 5600 static const int kDeoptimizationDataOffset = |
(...skipping 5238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10827 } else { | 10839 } else { |
10828 value &= ~(1 << bit_position); | 10840 value &= ~(1 << bit_position); |
10829 } | 10841 } |
10830 return value; | 10842 return value; |
10831 } | 10843 } |
10832 }; | 10844 }; |
10833 | 10845 |
10834 } } // namespace v8::internal | 10846 } } // namespace v8::internal |
10835 | 10847 |
10836 #endif // V8_OBJECTS_H_ | 10848 #endif // V8_OBJECTS_H_ |
OLD | NEW |