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 // Returns the miss builtin for given stub's kind. |
| 114 static Code* MissBuiltin(Isolate* isolate, Code* stub); |
| 115 |
| 116 // This function is called when a weak map in the stub is dying, |
| 117 // invalidates the stub by setting maps in it to undefined and |
| 118 // setting code targets to the miss builtin. |
| 119 static void InvalidateMapsAndHandlers(Code* stub); |
| 120 |
109 // Clear the inline cache to initial state. | 121 // Clear the inline cache to initial state. |
110 static void Clear(Isolate* isolate, | 122 static void Clear(Isolate* isolate, |
111 Address address, | 123 Address address, |
112 ConstantPoolArray* constant_pool); | 124 ConstantPoolArray* constant_pool); |
113 | 125 |
114 #ifdef DEBUG | 126 #ifdef DEBUG |
115 bool IsLoadStub() const { | 127 bool IsLoadStub() const { |
116 return target()->is_load_stub() || target()->is_keyed_load_stub(); | 128 return target()->is_load_stub() || target()->is_keyed_load_stub(); |
117 } | 129 } |
118 | 130 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 // Get the shared function info of the caller. | 178 // Get the shared function info of the caller. |
167 SharedFunctionInfo* GetSharedFunctionInfo() const; | 179 SharedFunctionInfo* GetSharedFunctionInfo() const; |
168 // Get the code object of the caller. | 180 // Get the code object of the caller. |
169 Code* GetCode() const; | 181 Code* GetCode() const; |
170 // Get the original (non-breakpointed) code object of the caller. | 182 // Get the original (non-breakpointed) code object of the caller. |
171 Code* GetOriginalCode() const; | 183 Code* GetOriginalCode() const; |
172 #endif | 184 #endif |
173 | 185 |
174 // Set the call-site target. | 186 // Set the call-site target. |
175 void set_target(Code* code) { | 187 void set_target(Code* code) { |
| 188 #ifdef VERIFY_HEAP |
| 189 code->VerifyEmbeddedObjectsDependency(); |
| 190 #endif |
176 SetTargetAtAddress(address(), code, constant_pool()); | 191 SetTargetAtAddress(address(), code, constant_pool()); |
177 target_set_ = true; | 192 target_set_ = true; |
178 } | 193 } |
179 | 194 |
180 bool is_target_set() { return target_set_; } | 195 bool is_target_set() { return target_set_; } |
181 | 196 |
182 #ifdef DEBUG | 197 #ifdef DEBUG |
183 char TransitionMarkFromState(IC::State state); | 198 char TransitionMarkFromState(IC::State state); |
184 | 199 |
185 void TraceIC(const char* type, Handle<Object> name); | 200 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); | 980 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ElementsTransitionAndStoreIC_Miss); |
966 DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_Miss); | 981 DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_Miss); |
967 DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_MissWithAllocationSite); | 982 DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_MissWithAllocationSite); |
968 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CompareNilIC_Miss); | 983 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CompareNilIC_Miss); |
969 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss); | 984 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss); |
970 | 985 |
971 | 986 |
972 } } // namespace v8::internal | 987 } } // namespace v8::internal |
973 | 988 |
974 #endif // V8_IC_H_ | 989 #endif // V8_IC_H_ |
OLD | NEW |