| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 83 |
| 84 // Compute the current IC state based on the target stub and the receiver. | 84 // Compute the current IC state based on the target stub and the receiver. |
| 85 static State StateFrom(Code* target, Object* receiver); | 85 static State StateFrom(Code* target, Object* receiver); |
| 86 | 86 |
| 87 // Clear the inline cache to initial state. | 87 // Clear the inline cache to initial state. |
| 88 static void Clear(Address address); | 88 static void Clear(Address address); |
| 89 | 89 |
| 90 // Computes the reloc info for this IC. This is a fairly expensive | 90 // Computes the reloc info for this IC. This is a fairly expensive |
| 91 // operation as it has to search through the heap to find the code | 91 // operation as it has to search through the heap to find the code |
| 92 // object that contains this IC site. | 92 // object that contains this IC site. |
| 93 RelocMode ComputeMode(); | 93 RelocInfo::Mode ComputeMode(); |
| 94 | 94 |
| 95 // Returns if this IC is for contextual (no explicit receiver) | 95 // Returns if this IC is for contextual (no explicit receiver) |
| 96 // access to properties. | 96 // access to properties. |
| 97 bool is_contextual() { return ComputeMode() == code_target_context; } | 97 bool is_contextual() { |
| 98 return ComputeMode() == RelocInfo::CODE_TARGET_CONTEXT; |
| 99 } |
| 98 | 100 |
| 99 // Returns the map to use for caching stubs for a given object. | 101 // Returns the map to use for caching stubs for a given object. |
| 100 // This method should not be called with undefined or null. | 102 // This method should not be called with undefined or null. |
| 101 static inline Map* GetCodeCacheMapForObject(Object* object); | 103 static inline Map* GetCodeCacheMapForObject(Object* object); |
| 102 | 104 |
| 103 protected: | 105 protected: |
| 104 Address fp() const { return fp_; } | 106 Address fp() const { return fp_; } |
| 105 Address pc() const { return *pc_address_; } | 107 Address pc() const { return *pc_address_; } |
| 106 | 108 |
| 107 // Computes the address in the original code when the code running is | 109 // Computes the address in the original code when the code running is |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 } | 354 } |
| 353 | 355 |
| 354 static void Clear(Address address, Code* target); | 356 static void Clear(Address address, Code* target); |
| 355 friend class IC; | 357 friend class IC; |
| 356 }; | 358 }; |
| 357 | 359 |
| 358 | 360 |
| 359 } } // namespace v8::internal | 361 } } // namespace v8::internal |
| 360 | 362 |
| 361 #endif // V8_IC_H_ | 363 #endif // V8_IC_H_ |
| OLD | NEW |