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