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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 99 |
100 bool IsNameCompatibleWithMonomorphicPrototypeFailure(Handle<Object> name); | 100 bool IsNameCompatibleWithMonomorphicPrototypeFailure(Handle<Object> name); |
101 bool TryMarkMonomorphicPrototypeFailure(Handle<Object> name) { | 101 bool TryMarkMonomorphicPrototypeFailure(Handle<Object> name) { |
102 if (IsNameCompatibleWithMonomorphicPrototypeFailure(name)) { | 102 if (IsNameCompatibleWithMonomorphicPrototypeFailure(name)) { |
103 state_ = MONOMORPHIC_PROTOTYPE_FAILURE; | 103 state_ = MONOMORPHIC_PROTOTYPE_FAILURE; |
104 return true; | 104 return true; |
105 } | 105 } |
106 return false; | 106 return false; |
107 } | 107 } |
108 | 108 |
| 109 // If the stub contains weak maps then this function adds the stub to |
| 110 // the dependent code array of each weak map. |
| 111 static void RegisterWeakMapDependency(Handle<Code> stub); |
| 112 |
| 113 // This function is called when a weak map in the stub is dying, |
| 114 // invalidates the stub by setting maps in it to undefined. |
| 115 static void InvalidateMaps(Code* stub); |
| 116 |
109 // Clear the inline cache to initial state. | 117 // Clear the inline cache to initial state. |
110 static void Clear(Isolate* isolate, | 118 static void Clear(Isolate* isolate, |
111 Address address, | 119 Address address, |
112 ConstantPoolArray* constant_pool); | 120 ConstantPoolArray* constant_pool); |
113 | 121 |
114 #ifdef DEBUG | 122 #ifdef DEBUG |
115 bool IsLoadStub() const { | 123 bool IsLoadStub() const { |
116 return target()->is_load_stub() || target()->is_keyed_load_stub(); | 124 return target()->is_load_stub() || target()->is_keyed_load_stub(); |
117 } | 125 } |
118 | 126 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 // Get the shared function info of the caller. | 174 // Get the shared function info of the caller. |
167 SharedFunctionInfo* GetSharedFunctionInfo() const; | 175 SharedFunctionInfo* GetSharedFunctionInfo() const; |
168 // Get the code object of the caller. | 176 // Get the code object of the caller. |
169 Code* GetCode() const; | 177 Code* GetCode() const; |
170 // Get the original (non-breakpointed) code object of the caller. | 178 // Get the original (non-breakpointed) code object of the caller. |
171 Code* GetOriginalCode() const; | 179 Code* GetOriginalCode() const; |
172 #endif | 180 #endif |
173 | 181 |
174 // Set the call-site target. | 182 // Set the call-site target. |
175 void set_target(Code* code) { | 183 void set_target(Code* code) { |
| 184 #ifdef VERIFY_HEAP |
| 185 code->VerifyEmbeddedObjectsDependency(); |
| 186 #endif |
176 SetTargetAtAddress(address(), code, constant_pool()); | 187 SetTargetAtAddress(address(), code, constant_pool()); |
177 target_set_ = true; | 188 target_set_ = true; |
178 } | 189 } |
179 | 190 |
180 bool is_target_set() { return target_set_; } | 191 bool is_target_set() { return target_set_; } |
181 | 192 |
182 #ifdef DEBUG | 193 #ifdef DEBUG |
183 char TransitionMarkFromState(IC::State state); | 194 char TransitionMarkFromState(IC::State state); |
184 | 195 |
185 void TraceIC(const char* type, Handle<Object> name); | 196 void TraceIC(const char* type, Handle<Object> name); |
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
965 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ElementsTransitionAndStoreIC_Miss); | 976 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ElementsTransitionAndStoreIC_Miss); |
966 DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_Miss); | 977 DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_Miss); |
967 DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_MissWithAllocationSite); | 978 DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_MissWithAllocationSite); |
968 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CompareNilIC_Miss); | 979 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CompareNilIC_Miss); |
969 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss); | 980 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss); |
970 | 981 |
971 | 982 |
972 } } // namespace v8::internal | 983 } } // namespace v8::internal |
973 | 984 |
974 #endif // V8_IC_H_ | 985 #endif // V8_IC_H_ |
OLD | NEW |