OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 }; | 87 }; |
88 | 88 |
89 // Construct the IC structure with the given number of extra | 89 // Construct the IC structure with the given number of extra |
90 // JavaScript frames on the stack. | 90 // JavaScript frames on the stack. |
91 explicit IC(FrameDepth depth); | 91 explicit IC(FrameDepth depth); |
92 | 92 |
93 // Get the call-site target; used for determining the state. | 93 // Get the call-site target; used for determining the state. |
94 Code* target() { return GetTargetAtAddress(address()); } | 94 Code* target() { return GetTargetAtAddress(address()); } |
95 inline Address address(); | 95 inline Address address(); |
96 | 96 |
97 // Compute the current IC state based on the target stub and the receiver. | 97 // Compute the current IC state based on the target stub, receiver and name. |
98 static State StateFrom(Code* target, Object* receiver); | 98 static State StateFrom(Code* target, Object* receiver, Object* name); |
99 | 99 |
100 // Clear the inline cache to initial state. | 100 // Clear the inline cache to initial state. |
101 static void Clear(Address address); | 101 static void Clear(Address address); |
102 | 102 |
103 // Computes the reloc info for this IC. This is a fairly expensive | 103 // Computes the reloc info for this IC. This is a fairly expensive |
104 // operation as it has to search through the heap to find the code | 104 // operation as it has to search through the heap to find the code |
105 // object that contains this IC site. | 105 // object that contains this IC site. |
106 RelocInfo::Mode ComputeMode(); | 106 RelocInfo::Mode ComputeMode(); |
107 | 107 |
108 // Returns if this IC is for contextual (no explicit receiver) | 108 // Returns if this IC is for contextual (no explicit receiver) |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 static const char* GetName(TypeInfo type_info); | 465 static const char* GetName(TypeInfo type_info); |
466 | 466 |
467 static State ToState(TypeInfo type_info); | 467 static State ToState(TypeInfo type_info); |
468 | 468 |
469 static TypeInfo GetTypeInfo(Object* left, Object* right); | 469 static TypeInfo GetTypeInfo(Object* left, Object* right); |
470 }; | 470 }; |
471 | 471 |
472 } } // namespace v8::internal | 472 } } // namespace v8::internal |
473 | 473 |
474 #endif // V8_IC_H_ | 474 #endif // V8_IC_H_ |
OLD | NEW |