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

Unified Diff: src/ic/ic.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: MIPS port 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/math.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/ic.cc
diff --git a/src/ic/ic.cc b/src/ic/ic.cc
index 7e0fd2b62a26ead000a5d91bed53f0fbf2095412..a73e4ea976e82d7a42d5e007bce60007c467fa2f 100644
--- a/src/ic/ic.cc
+++ b/src/ic/ic.cc
@@ -2223,9 +2223,9 @@ bool CallIC::DoCustomHandler(Handle<Object> function,
// Are we the array function?
Handle<JSFunction> array_function =
Handle<JSFunction>(isolate()->native_context()->array_function());
+ CallICNexus* nexus = casted_nexus<CallICNexus>();
if (array_function.is_identical_to(Handle<JSFunction>::cast(function))) {
// Alter the slot.
- CallICNexus* nexus = casted_nexus<CallICNexus>();
nexus->ConfigureMonomorphicArray();
// Vector-based ICs have a different calling convention in optimized code
@@ -2247,6 +2247,48 @@ bool CallIC::DoCustomHandler(Handle<Object> function,
OnTypeFeedbackChanged(isolate(), get_host(), nexus->vector(), state(),
MONOMORPHIC);
return true;
+ } else {
+ Handle<JSFunction> maybe_builtin(Handle<JSFunction>::cast(function));
+ if (maybe_builtin->shared()->HasBuiltinFunctionId()) {
+ BuiltinFunctionId id = maybe_builtin->shared()->builtin_function_id();
+ switch (id) {
+ case kMathRound: {
+ nexus->ConfigureMonomorphicMathFunction(maybe_builtin);
+ if (AddressIsOptimizedCode()) {
+ CallIC_RoundStub stub(isolate(), callic_state);
+ set_target(*stub.GetCode());
+ } else {
+ CallIC_RoundTrampolineStub stub(isolate(), callic_state);
+ set_target(*stub.GetCode());
+ }
+ return true;
+ }
+ case kMathFloor:
+ nexus->ConfigureMonomorphicMathFunction(maybe_builtin);
+ if (AddressIsOptimizedCode()) {
+ CallIC_FloorStub stub(isolate(), callic_state);
+ set_target(*stub.GetCode());
+ } else {
+ CallIC_FloorTrampolineStub stub(isolate(), callic_state);
+ set_target(*stub.GetCode());
+ }
+ return true;
+ break;
+ case kMathCeil:
+ nexus->ConfigureMonomorphicMathFunction(maybe_builtin);
+ if (AddressIsOptimizedCode()) {
+ CallIC_CeilStub stub(isolate(), callic_state);
+ set_target(*stub.GetCode());
+ } else {
+ CallIC_CeilTrampolineStub stub(isolate(), callic_state);
+ set_target(*stub.GetCode());
+ }
+ return true;
+ break;
+ default:
+ break;
+ }
+ }
}
return false;
}
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/math.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698