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 |
145 bool TypeFeedbackOracle::CallNewIsMonomorphic(FeedbackVectorSlot slot) { | 161 bool TypeFeedbackOracle::CallNewIsMonomorphic(FeedbackVectorSlot slot) { |
146 Handle<Object> info = GetInfo(slot); | 162 Handle<Object> info = GetInfo(slot); |
147 return FLAG_pretenuring_call_new | 163 return FLAG_pretenuring_call_new |
148 ? info->IsJSFunction() | 164 ? info->IsJSFunction() |
149 : info->IsAllocationSite() || info->IsJSFunction(); | 165 : info->IsAllocationSite() || info->IsJSFunction(); |
150 } | 166 } |
151 | 167 |
152 | 168 |
153 byte TypeFeedbackOracle::ForInType(FeedbackVectorSlot feedback_vector_slot) { | 169 byte TypeFeedbackOracle::ForInType(FeedbackVectorSlot feedback_vector_slot) { |
154 Handle<Object> value = GetInfo(feedback_vector_slot); | 170 Handle<Object> value = GetInfo(feedback_vector_slot); |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 UnseededNumberDictionary::kNotFound); | 550 UnseededNumberDictionary::kNotFound); |
535 // Dictionary has been allocated with sufficient size for all elements. | 551 // Dictionary has been allocated with sufficient size for all elements. |
536 DisallowHeapAllocation no_need_to_resize_dictionary; | 552 DisallowHeapAllocation no_need_to_resize_dictionary; |
537 HandleScope scope(isolate()); | 553 HandleScope scope(isolate()); |
538 USE(UnseededNumberDictionary::AtNumberPut( | 554 USE(UnseededNumberDictionary::AtNumberPut( |
539 dictionary_, IdToKey(ast_id), handle(target, isolate()))); | 555 dictionary_, IdToKey(ast_id), handle(target, isolate()))); |
540 } | 556 } |
541 | 557 |
542 | 558 |
543 } } // namespace v8::internal | 559 } } // namespace v8::internal |
OLD | NEW |