| 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/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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 TypeFeedbackVector::UninitializedSentinel(isolate())); | 135 TypeFeedbackVector::UninitializedSentinel(isolate())); |
| 136 } | 136 } |
| 137 | 137 |
| 138 | 138 |
| 139 bool TypeFeedbackOracle::CallIsMonomorphic(FeedbackVectorICSlot slot) { | 139 bool TypeFeedbackOracle::CallIsMonomorphic(FeedbackVectorICSlot slot) { |
| 140 Handle<Object> value = GetInfo(slot); | 140 Handle<Object> value = GetInfo(slot); |
| 141 return value->IsAllocationSite() || value->IsJSFunction(); | 141 return value->IsAllocationSite() || value->IsJSFunction(); |
| 142 } | 142 } |
| 143 | 143 |
| 144 | 144 |
| 145 bool TypeFeedbackOracle::CallIsBuiltinWithMinusZeroResult( | |
| 146 FeedbackVectorICSlot slot) { | |
| 147 Handle<Object> value = GetInfo(slot); | |
| 148 if (!value->IsJSFunction()) return false; | |
| 149 Handle<JSFunction> maybe_round(Handle<JSFunction>::cast(value)); | |
| 150 if (!maybe_round->shared()->HasBuiltinFunctionId()) return false; | |
| 151 if (maybe_round->shared()->builtin_function_id() != kMathRound && | |
| 152 maybe_round->shared()->builtin_function_id() != kMathFloor && | |
| 153 maybe_round->shared()->builtin_function_id() != kMathCeil) { | |
| 154 return false; | |
| 155 } | |
| 156 return feedback_vector_->get(feedback_vector_->GetIndex(slot) + 1) == | |
| 157 Smi::FromInt(CallICStub::kHasReturnedMinusZeroSentinel); | |
| 158 } | |
| 159 | |
| 160 | |
| 161 bool TypeFeedbackOracle::CallNewIsMonomorphic(FeedbackVectorSlot slot) { | 145 bool TypeFeedbackOracle::CallNewIsMonomorphic(FeedbackVectorSlot slot) { |
| 162 Handle<Object> info = GetInfo(slot); | 146 Handle<Object> info = GetInfo(slot); |
| 163 return FLAG_pretenuring_call_new | 147 return FLAG_pretenuring_call_new |
| 164 ? info->IsJSFunction() | 148 ? info->IsJSFunction() |
| 165 : info->IsAllocationSite() || info->IsJSFunction(); | 149 : info->IsAllocationSite() || info->IsJSFunction(); |
| 166 } | 150 } |
| 167 | 151 |
| 168 | 152 |
| 169 byte TypeFeedbackOracle::ForInType(FeedbackVectorSlot feedback_vector_slot) { | 153 byte TypeFeedbackOracle::ForInType(FeedbackVectorSlot feedback_vector_slot) { |
| 170 Handle<Object> value = GetInfo(feedback_vector_slot); | 154 Handle<Object> value = GetInfo(feedback_vector_slot); |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 UnseededNumberDictionary::kNotFound); | 534 UnseededNumberDictionary::kNotFound); |
| 551 // Dictionary has been allocated with sufficient size for all elements. | 535 // Dictionary has been allocated with sufficient size for all elements. |
| 552 DisallowHeapAllocation no_need_to_resize_dictionary; | 536 DisallowHeapAllocation no_need_to_resize_dictionary; |
| 553 HandleScope scope(isolate()); | 537 HandleScope scope(isolate()); |
| 554 USE(UnseededNumberDictionary::AtNumberPut( | 538 USE(UnseededNumberDictionary::AtNumberPut( |
| 555 dictionary_, IdToKey(ast_id), handle(target, isolate()))); | 539 dictionary_, IdToKey(ast_id), handle(target, isolate()))); |
| 556 } | 540 } |
| 557 | 541 |
| 558 | 542 |
| 559 } } // namespace v8::internal | 543 } } // namespace v8::internal |
| OLD | NEW |