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

Side by Side Diff: src/ic/ic.cc

Issue 2647493002: [ic] Clean up handler boilerplate (Closed)
Patch Set: rebased Created 3 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 unified diff | Download patch
« no previous file with comments | « src/ic/handler-compiler.cc ('k') | src/ic/keyed-store-generic.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/ic/ic.h" 5 #include "src/ic/ic.h"
6 6
7 #include <iostream> 7 #include <iostream>
8 8
9 #include "src/accessors.h" 9 #include "src/accessors.h"
10 #include "src/api-arguments-inl.h" 10 #include "src/api-arguments-inl.h"
(...skipping 2642 matching lines...) Expand 10 before | Expand all | Expand 10 after
2653 Handle<Object> key = args.at(1); 2653 Handle<Object> key = args.at(1);
2654 Handle<Smi> slot = args.at<Smi>(2); 2654 Handle<Smi> slot = args.at<Smi>(2);
2655 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); 2655 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3);
2656 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); 2656 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value());
2657 KeyedLoadICNexus nexus(vector, vector_slot); 2657 KeyedLoadICNexus nexus(vector, vector_slot);
2658 KeyedLoadIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); 2658 KeyedLoadIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus);
2659 ic.UpdateState(receiver, key); 2659 ic.UpdateState(receiver, key);
2660 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); 2660 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key));
2661 } 2661 }
2662 2662
2663
2664 RUNTIME_FUNCTION(Runtime_KeyedLoadIC_MissFromStubFailure) {
2665 HandleScope scope(isolate);
2666 typedef LoadWithVectorDescriptor Descriptor;
2667 DCHECK_EQ(Descriptor::kParameterCount, args.length());
2668 Handle<Object> receiver = args.at(Descriptor::kReceiver);
2669 Handle<Object> key = args.at(Descriptor::kName);
2670 Handle<Smi> slot = args.at<Smi>(Descriptor::kSlot);
2671 Handle<TypeFeedbackVector> vector =
2672 args.at<TypeFeedbackVector>(Descriptor::kVector);
2673 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value());
2674 KeyedLoadICNexus nexus(vector, vector_slot);
2675 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus);
2676 ic.UpdateState(receiver, key);
2677 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key));
2678 }
2679
2680
2681 // Used from ic-<arch>.cc. 2663 // Used from ic-<arch>.cc.
2682 RUNTIME_FUNCTION(Runtime_StoreIC_Miss) { 2664 RUNTIME_FUNCTION(Runtime_StoreIC_Miss) {
2683 HandleScope scope(isolate); 2665 HandleScope scope(isolate);
2684 DCHECK_EQ(5, args.length()); 2666 DCHECK_EQ(5, args.length());
2685 // Runtime functions don't follow the IC's calling convention. 2667 // Runtime functions don't follow the IC's calling convention.
2686 Handle<Object> value = args.at(0); 2668 Handle<Object> value = args.at(0);
2687 Handle<Smi> slot = args.at<Smi>(1); 2669 Handle<Smi> slot = args.at<Smi>(1);
2688 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(2); 2670 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(2);
2689 Handle<Object> receiver = args.at(3); 2671 Handle<Object> receiver = args.at(3);
2690 Handle<Name> key = args.at<Name>(4); 2672 Handle<Name> key = args.at<Name>(4);
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
3217 DCHECK_EQ(LookupIterator::INTERCEPTOR, it.state()); 3199 DCHECK_EQ(LookupIterator::INTERCEPTOR, it.state());
3218 it.Next(); 3200 it.Next();
3219 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, 3201 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result,
3220 Object::GetProperty(&it)); 3202 Object::GetProperty(&it));
3221 } 3203 }
3222 3204
3223 return *result; 3205 return *result;
3224 } 3206 }
3225 } // namespace internal 3207 } // namespace internal
3226 } // namespace v8 3208 } // namespace v8
OLDNEW
« no previous file with comments | « src/ic/handler-compiler.cc ('k') | src/ic/keyed-store-generic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698