| 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/type-info.h" | 5 #include "src/type-info.h" |
| 6 | 6 |
| 7 #include "src/ast.h" | 7 #include "src/ast.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
| 10 #include "src/ic/ic.h" | 10 #include "src/ic/ic.h" |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 155 |
| 156 | 156 |
| 157 bool TypeFeedbackOracle::CallIsMonomorphic(FeedbackVectorICSlot slot) { | 157 bool TypeFeedbackOracle::CallIsMonomorphic(FeedbackVectorICSlot slot) { |
| 158 Handle<Object> value = GetInfo(slot); | 158 Handle<Object> value = GetInfo(slot); |
| 159 return value->IsAllocationSite() || value->IsJSFunction(); | 159 return value->IsAllocationSite() || value->IsJSFunction(); |
| 160 } | 160 } |
| 161 | 161 |
| 162 | 162 |
| 163 bool TypeFeedbackOracle::CallNewIsMonomorphic(FeedbackVectorSlot slot) { | 163 bool TypeFeedbackOracle::CallNewIsMonomorphic(FeedbackVectorSlot slot) { |
| 164 Handle<Object> info = GetInfo(slot); | 164 Handle<Object> info = GetInfo(slot); |
| 165 return FLAG_pretenuring_call_new | 165 return info->IsAllocationSite() || info->IsJSFunction(); |
| 166 ? info->IsJSFunction() | |
| 167 : info->IsAllocationSite() || info->IsJSFunction(); | |
| 168 } | 166 } |
| 169 | 167 |
| 170 | 168 |
| 171 byte TypeFeedbackOracle::ForInType(FeedbackVectorSlot feedback_vector_slot) { | 169 byte TypeFeedbackOracle::ForInType(FeedbackVectorSlot feedback_vector_slot) { |
| 172 Handle<Object> value = GetInfo(feedback_vector_slot); | 170 Handle<Object> value = GetInfo(feedback_vector_slot); |
| 173 return value.is_identical_to( | 171 return value.is_identical_to( |
| 174 TypeFeedbackVector::UninitializedSentinel(isolate())) | 172 TypeFeedbackVector::UninitializedSentinel(isolate())) |
| 175 ? ForInStatement::FAST_FOR_IN | 173 ? ForInStatement::FAST_FOR_IN |
| 176 : ForInStatement::SLOW_FOR_IN; | 174 : ForInStatement::SLOW_FOR_IN; |
| 177 } | 175 } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 return Handle<JSFunction>(isolate()->native_context()->array_function()); | 215 return Handle<JSFunction>(isolate()->native_context()->array_function()); |
| 218 } | 216 } |
| 219 | 217 |
| 220 return Handle<JSFunction>::cast(info); | 218 return Handle<JSFunction>::cast(info); |
| 221 } | 219 } |
| 222 | 220 |
| 223 | 221 |
| 224 Handle<JSFunction> TypeFeedbackOracle::GetCallNewTarget( | 222 Handle<JSFunction> TypeFeedbackOracle::GetCallNewTarget( |
| 225 FeedbackVectorSlot slot) { | 223 FeedbackVectorSlot slot) { |
| 226 Handle<Object> info = GetInfo(slot); | 224 Handle<Object> info = GetInfo(slot); |
| 227 if (FLAG_pretenuring_call_new || info->IsJSFunction()) { | 225 if (info->IsJSFunction()) { |
| 228 return Handle<JSFunction>::cast(info); | 226 return Handle<JSFunction>::cast(info); |
| 229 } | 227 } |
| 230 | 228 |
| 231 DCHECK(info->IsAllocationSite()); | 229 DCHECK(info->IsAllocationSite()); |
| 232 return Handle<JSFunction>(isolate()->native_context()->array_function()); | 230 return Handle<JSFunction>(isolate()->native_context()->array_function()); |
| 233 } | 231 } |
| 234 | 232 |
| 235 | 233 |
| 236 Handle<AllocationSite> TypeFeedbackOracle::GetCallAllocationSite( | 234 Handle<AllocationSite> TypeFeedbackOracle::GetCallAllocationSite( |
| 237 FeedbackVectorICSlot slot) { | 235 FeedbackVectorICSlot slot) { |
| 238 Handle<Object> info = GetInfo(slot); | 236 Handle<Object> info = GetInfo(slot); |
| 239 if (info->IsAllocationSite()) { | 237 if (info->IsAllocationSite()) { |
| 240 return Handle<AllocationSite>::cast(info); | 238 return Handle<AllocationSite>::cast(info); |
| 241 } | 239 } |
| 242 return Handle<AllocationSite>::null(); | 240 return Handle<AllocationSite>::null(); |
| 243 } | 241 } |
| 244 | 242 |
| 245 | 243 |
| 246 Handle<AllocationSite> TypeFeedbackOracle::GetCallNewAllocationSite( | 244 Handle<AllocationSite> TypeFeedbackOracle::GetCallNewAllocationSite( |
| 247 FeedbackVectorSlot slot) { | 245 FeedbackVectorSlot slot) { |
| 248 Handle<Object> info = GetInfo(slot); | 246 Handle<Object> info = GetInfo(slot); |
| 249 if (FLAG_pretenuring_call_new || info->IsAllocationSite()) { | 247 if (info->IsAllocationSite()) { |
| 250 return Handle<AllocationSite>::cast(info); | 248 return Handle<AllocationSite>::cast(info); |
| 251 } | 249 } |
| 252 return Handle<AllocationSite>::null(); | 250 return Handle<AllocationSite>::null(); |
| 253 } | 251 } |
| 254 | 252 |
| 255 | 253 |
| 256 bool TypeFeedbackOracle::LoadIsBuiltin( | 254 bool TypeFeedbackOracle::LoadIsBuiltin( |
| 257 TypeFeedbackId id, Builtins::Name builtin) { | 255 TypeFeedbackId id, Builtins::Name builtin) { |
| 258 return *GetInfo(id) == isolate()->builtins()->builtin(builtin); | 256 return *GetInfo(id) == isolate()->builtins()->builtin(builtin); |
| 259 } | 257 } |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 // Dictionary has been allocated with sufficient size for all elements. | 585 // Dictionary has been allocated with sufficient size for all elements. |
| 588 DisallowHeapAllocation no_need_to_resize_dictionary; | 586 DisallowHeapAllocation no_need_to_resize_dictionary; |
| 589 HandleScope scope(isolate()); | 587 HandleScope scope(isolate()); |
| 590 USE(UnseededNumberDictionary::AtNumberPut( | 588 USE(UnseededNumberDictionary::AtNumberPut( |
| 591 dictionary_, IdToKey(ast_id), handle(target, isolate()))); | 589 dictionary_, IdToKey(ast_id), handle(target, isolate()))); |
| 592 } | 590 } |
| 593 | 591 |
| 594 | 592 |
| 595 } // namespace internal | 593 } // namespace internal |
| 596 } // namespace v8 | 594 } // namespace v8 |
| OLD | NEW |