OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 PrintF("[%s patching generic stub in ", type); \ | 82 PrintF("[%s patching generic stub in ", type); \ |
83 PrintF("(see below) (%s)]\n", reason); \ | 83 PrintF("(see below) (%s)]\n", reason); \ |
84 } \ | 84 } \ |
85 } while (false) | 85 } while (false) |
86 | 86 |
87 #endif // DEBUG | 87 #endif // DEBUG |
88 | 88 |
89 | 89 |
90 void IC::TraceIC(const char* type, Handle<Object> name) { | 90 void IC::TraceIC(const char* type, Handle<Object> name) { |
91 if (FLAG_trace_ic) { | 91 if (FLAG_trace_ic) { |
| 92 if (AddressIsDeoptimizedCode()) return; |
92 State new_state = | 93 State new_state = |
93 UseVector() ? nexus()->StateFromFeedback() : raw_target()->ic_state(); | 94 UseVector() ? nexus()->StateFromFeedback() : raw_target()->ic_state(); |
94 TraceIC(type, name, state(), new_state); | 95 TraceIC(type, name, state(), new_state); |
95 } | 96 } |
96 } | 97 } |
97 | 98 |
98 | 99 |
99 void IC::TraceIC(const char* type, Handle<Object> name, State old_state, | 100 void IC::TraceIC(const char* type, Handle<Object> name, State old_state, |
100 State new_state) { | 101 State new_state) { |
101 if (FLAG_trace_ic) { | 102 if (FLAG_trace_ic) { |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 } | 224 } |
224 | 225 |
225 | 226 |
226 bool IC::AddressIsOptimizedCode() const { | 227 bool IC::AddressIsOptimizedCode() const { |
227 Code* host = | 228 Code* host = |
228 isolate()->inner_pointer_to_code_cache()->GetCacheEntry(address())->code; | 229 isolate()->inner_pointer_to_code_cache()->GetCacheEntry(address())->code; |
229 return host->kind() == Code::OPTIMIZED_FUNCTION; | 230 return host->kind() == Code::OPTIMIZED_FUNCTION; |
230 } | 231 } |
231 | 232 |
232 | 233 |
233 bool IC::AddressIsDeoptimizedCode() const { | |
234 Code* host = | |
235 isolate()->inner_pointer_to_code_cache()->GetCacheEntry(address())->code; | |
236 return host->kind() == Code::OPTIMIZED_FUNCTION && | |
237 host->marked_for_deoptimization(); | |
238 } | |
239 | |
240 | |
241 static void LookupForRead(LookupIterator* it) { | 234 static void LookupForRead(LookupIterator* it) { |
242 for (; it->IsFound(); it->Next()) { | 235 for (; it->IsFound(); it->Next()) { |
243 switch (it->state()) { | 236 switch (it->state()) { |
244 case LookupIterator::NOT_FOUND: | 237 case LookupIterator::NOT_FOUND: |
245 case LookupIterator::TRANSITION: | 238 case LookupIterator::TRANSITION: |
246 UNREACHABLE(); | 239 UNREACHABLE(); |
247 case LookupIterator::JSPROXY: | 240 case LookupIterator::JSPROXY: |
248 return; | 241 return; |
249 case LookupIterator::INTERCEPTOR: { | 242 case LookupIterator::INTERCEPTOR: { |
250 // If there is a getter, return; otherwise loop to perform the lookup. | 243 // If there is a getter, return; otherwise loop to perform the lookup. |
(...skipping 2661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2912 static const Address IC_utilities[] = { | 2905 static const Address IC_utilities[] = { |
2913 #define ADDR(name) FUNCTION_ADDR(name), | 2906 #define ADDR(name) FUNCTION_ADDR(name), |
2914 IC_UTIL_LIST(ADDR) NULL | 2907 IC_UTIL_LIST(ADDR) NULL |
2915 #undef ADDR | 2908 #undef ADDR |
2916 }; | 2909 }; |
2917 | 2910 |
2918 | 2911 |
2919 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } | 2912 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } |
2920 } | 2913 } |
2921 } // namespace v8::internal | 2914 } // namespace v8::internal |
OLD | NEW |