Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: src/type-info.cc

Issue 1053143005: Collect type feedback on result of Math.[round|ceil|floor] (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Allow instrinsics to be optimized in more cases Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 SmartArrayPointer<char> n = maybe_round->shared()->DebugName()->ToCString();
mvstanton 2015/05/04 09:41:22 You don't need n here.
danno 2015/05/04 14:31:56 Done.
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
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
OLDNEW
« src/type-feedback-vector.cc ('K') | « src/type-info.h ('k') | src/typing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698