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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 } | 119 } |
120 return false; | 120 return false; |
121 } | 121 } |
122 | 122 |
123 | 123 |
124 bool TypeFeedbackOracle::StoreIsMonomorphicNormal(TypeFeedbackId ast_id) { | 124 bool TypeFeedbackOracle::StoreIsMonomorphicNormal(TypeFeedbackId ast_id) { |
125 Handle<Object> map_or_code = GetInfo(ast_id); | 125 Handle<Object> map_or_code = GetInfo(ast_id); |
126 if (map_or_code->IsMap()) return true; | 126 if (map_or_code->IsMap()) return true; |
127 if (map_or_code->IsCode()) { | 127 if (map_or_code->IsCode()) { |
128 Handle<Code> code = Handle<Code>::cast(map_or_code); | 128 Handle<Code> code = Handle<Code>::cast(map_or_code); |
129 bool standard_store = | |
130 Code::GetKeyedAccessStoreMode(code->extra_ic_state()) == | |
131 STANDARD_STORE; | |
132 bool preliminary_checks = | 129 bool preliminary_checks = |
133 code->is_keyed_store_stub() && | 130 code->is_keyed_store_stub() && |
134 standard_store && | |
135 code->ic_state() == MONOMORPHIC && | 131 code->ic_state() == MONOMORPHIC && |
136 Code::ExtractTypeFromFlags(code->flags()) == Code::NORMAL; | 132 Code::ExtractTypeFromFlags(code->flags()) == Code::NORMAL; |
137 if (!preliminary_checks) return false; | 133 if (!preliminary_checks) return false; |
138 Map* map = code->FindFirstMap(); | 134 Map* map = code->FindFirstMap(); |
139 return map != NULL && !CanRetainOtherContext(map, *native_context_); | 135 return map != NULL && !CanRetainOtherContext(map, *native_context_); |
140 } | 136 } |
141 return false; | 137 return false; |
142 } | 138 } |
143 | 139 |
144 | 140 |
145 bool TypeFeedbackOracle::StoreIsPolymorphic(TypeFeedbackId ast_id) { | 141 bool TypeFeedbackOracle::StoreIsPolymorphic(TypeFeedbackId ast_id) { |
146 Handle<Object> map_or_code = GetInfo(ast_id); | 142 Handle<Object> map_or_code = GetInfo(ast_id); |
147 if (map_or_code->IsCode()) { | 143 if (map_or_code->IsCode()) { |
148 Handle<Code> code = Handle<Code>::cast(map_or_code); | 144 Handle<Code> code = Handle<Code>::cast(map_or_code); |
149 bool standard_store = | 145 return code->is_keyed_store_stub() && |
150 Code::GetKeyedAccessStoreMode(code->extra_ic_state()) == | |
151 STANDARD_STORE; | |
152 return code->is_keyed_store_stub() && standard_store && | |
153 code->ic_state() == POLYMORPHIC; | 146 code->ic_state() == POLYMORPHIC; |
154 } | 147 } |
155 return false; | 148 return false; |
156 } | 149 } |
157 | 150 |
158 | 151 |
159 bool TypeFeedbackOracle::CallIsMonomorphic(Call* expr) { | 152 bool TypeFeedbackOracle::CallIsMonomorphic(Call* expr) { |
160 Handle<Object> value = GetInfo(expr->CallFeedbackId()); | 153 Handle<Object> value = GetInfo(expr->CallFeedbackId()); |
161 return value->IsMap() || value->IsSmi() || value->IsJSFunction(); | 154 return value->IsMap() || value->IsSmi() || value->IsJSFunction(); |
162 } | 155 } |
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 USE(maybe_result); | 752 USE(maybe_result); |
760 #ifdef DEBUG | 753 #ifdef DEBUG |
761 Object* result = NULL; | 754 Object* result = NULL; |
762 // Dictionary has been allocated with sufficient size for all elements. | 755 // Dictionary has been allocated with sufficient size for all elements. |
763 ASSERT(maybe_result->ToObject(&result)); | 756 ASSERT(maybe_result->ToObject(&result)); |
764 ASSERT(*dictionary_ == result); | 757 ASSERT(*dictionary_ == result); |
765 #endif | 758 #endif |
766 } | 759 } |
767 | 760 |
768 } } // namespace v8::internal | 761 } } // namespace v8::internal |
OLD | NEW |