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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 Handle<Code> code = Handle<Code>::cast(maybe_code); | 145 Handle<Code> code = Handle<Code>::cast(maybe_code); |
146 if (code->kind() == Code::KEYED_STORE_IC) { | 146 if (code->kind() == Code::KEYED_STORE_IC) { |
147 return KeyedStoreIC::GetKeyedAccessStoreMode(code->extra_ic_state()); | 147 return KeyedStoreIC::GetKeyedAccessStoreMode(code->extra_ic_state()); |
148 } | 148 } |
149 } | 149 } |
150 return STANDARD_STORE; | 150 return STANDARD_STORE; |
151 } | 151 } |
152 | 152 |
153 | 153 |
154 Handle<JSFunction> TypeFeedbackOracle::GetCallTarget(int slot) { | 154 Handle<JSFunction> TypeFeedbackOracle::GetCallTarget(int slot) { |
155 Handle<Object> info = GetInfo(slot); | 155 return Handle<JSFunction>::cast(GetInfo(slot)); |
156 if (info->IsAllocationSite()) { | |
157 return Handle<JSFunction>(isolate()->global_context()->array_function()); | |
158 } else { | |
159 return Handle<JSFunction>::cast(info); | |
160 } | |
161 } | 156 } |
162 | 157 |
163 | 158 |
164 Handle<JSFunction> TypeFeedbackOracle::GetCallNewTarget(int slot) { | 159 Handle<JSFunction> TypeFeedbackOracle::GetCallNewTarget(int slot) { |
165 Handle<Object> info = GetInfo(slot); | 160 return Handle<JSFunction>::cast(GetInfo(slot)); |
166 if (info->IsAllocationSite()) { | |
167 return Handle<JSFunction>(isolate()->global_context()->array_function()); | |
168 } else { | |
169 return Handle<JSFunction>::cast(info); | |
170 } | |
171 } | 161 } |
172 | 162 |
173 | 163 |
174 Handle<AllocationSite> TypeFeedbackOracle::GetCallNewAllocationSite(int slot) { | 164 Handle<AllocationSite> TypeFeedbackOracle::GetCallNewAllocationSite(int slot) { |
175 Handle<Object> info = GetInfo(slot); | 165 return Handle<AllocationSite>::cast(GetInfo(slot)); |
176 if (info->IsAllocationSite()) { | |
177 return Handle<AllocationSite>::cast(info); | |
178 } | |
179 return Handle<AllocationSite>::null(); | |
180 } | 166 } |
181 | 167 |
182 | 168 |
183 bool TypeFeedbackOracle::LoadIsBuiltin( | 169 bool TypeFeedbackOracle::LoadIsBuiltin( |
184 TypeFeedbackId id, Builtins::Name builtin) { | 170 TypeFeedbackId id, Builtins::Name builtin) { |
185 return *GetInfo(id) == isolate()->builtins()->builtin(builtin); | 171 return *GetInfo(id) == isolate()->builtins()->builtin(builtin); |
186 } | 172 } |
187 | 173 |
188 | 174 |
189 bool TypeFeedbackOracle::LoadIsStub(TypeFeedbackId id, ICStub* stub) { | 175 bool TypeFeedbackOracle::LoadIsStub(TypeFeedbackId id, ICStub* stub) { |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 #ifdef DEBUG | 480 #ifdef DEBUG |
495 Object* result = NULL; | 481 Object* result = NULL; |
496 // Dictionary has been allocated with sufficient size for all elements. | 482 // Dictionary has been allocated with sufficient size for all elements. |
497 ASSERT(maybe_result->ToObject(&result)); | 483 ASSERT(maybe_result->ToObject(&result)); |
498 ASSERT(*dictionary_ == result); | 484 ASSERT(*dictionary_ == result); |
499 #endif | 485 #endif |
500 } | 486 } |
501 | 487 |
502 | 488 |
503 } } // namespace v8::internal | 489 } } // namespace v8::internal |
OLD | NEW |