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

Unified Diff: src/ic/ic.cc

Issue 885593002: Continue learning for calls in crankshaft. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Don't remove inlining text size limit yet, just alter it. Created 5 years, 11 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/ic/ic.h ('k') | src/x64/lithium-codegen-x64.cc » ('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 487a615f7155625f12d56feffce4bd32bf29fe3f..e6b691b9265664a4c28956cdf65481390e465779 100644
--- a/src/ic/ic.cc
+++ b/src/ic/ic.cc
@@ -223,6 +223,17 @@ Code* IC::GetOriginalCode() const {
}
+bool IC::AddressIsOptimizedCode() const {
+ Object* maybe_function =
+ Memory::Object_at(fp() + JavaScriptFrameConstants::kFunctionOffset);
+ if (maybe_function->IsJSFunction()) {
+ JSFunction* function = JSFunction::cast(maybe_function);
+ return function->IsOptimized();
+ }
+ return false;
+}
+
+
static void LookupForRead(LookupIterator* it) {
for (; it->IsFound(); it->Next()) {
switch (it->state()) {
@@ -2144,8 +2155,16 @@ bool CallIC::DoCustomHandler(Handle<Object> receiver, Handle<Object> function,
CallICNexus* nexus = casted_nexus<CallICNexus>();
nexus->ConfigureMonomorphicArray();
- CallIC_ArrayTrampolineStub stub(isolate(), callic_state);
- set_target(*stub.GetCode());
+ // Vector-based ICs have a different calling convention in optimized code
+ // than full code so the correct stub has to be chosen.
+ if (AddressIsOptimizedCode()) {
+ CallIC_ArrayStub stub(isolate(), callic_state);
+ set_target(*stub.GetCode());
+ } else {
+ CallIC_ArrayTrampolineStub stub(isolate(), callic_state);
+ set_target(*stub.GetCode());
+ }
+
Handle<String> name;
if (array_function->shared()->name()->IsString()) {
name = Handle<String>(String::cast(array_function->shared()->name()),
@@ -2167,9 +2186,15 @@ void CallIC::PatchMegamorphic(Handle<Object> function) {
CallICNexus* nexus = casted_nexus<CallICNexus>();
nexus->ConfigureGeneric();
- CallICTrampolineStub stub(isolate(), callic_state);
- Handle<Code> code = stub.GetCode();
- set_target(*code);
+ // Vector-based ICs have a different calling convention in optimized code
+ // than full code so the correct stub has to be chosen.
+ if (AddressIsOptimizedCode()) {
+ CallICStub stub(isolate(), callic_state);
+ set_target(*stub.GetCode());
+ } else {
+ CallICTrampolineStub stub(isolate(), callic_state);
+ set_target(*stub.GetCode());
+ }
Handle<Object> name = isolate()->factory()->empty_string();
if (function->IsJSFunction()) {
« no previous file with comments | « src/ic/ic.h ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698