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

Side by Side Diff: src/ic/call-optimization.cc

Issue 935603002: Stop using HeapType in IC and Crankshaft (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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/call-optimization.h ('k') | src/ic/handler-compiler.h » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/ic/call-optimization.h" 7 #include "src/ic/call-optimization.h"
8 8
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 *holder_lookup = kHolderNotFound; 44 *holder_lookup = kHolderNotFound;
45 return Handle<JSObject>::null(); 45 return Handle<JSObject>::null();
46 } 46 }
47 47
48 48
49 bool CallOptimization::IsCompatibleReceiver(Handle<Object> receiver, 49 bool CallOptimization::IsCompatibleReceiver(Handle<Object> receiver,
50 Handle<JSObject> holder) const { 50 Handle<JSObject> holder) const {
51 DCHECK(is_simple_api_call()); 51 DCHECK(is_simple_api_call());
52 if (!receiver->IsHeapObject()) return false; 52 if (!receiver->IsHeapObject()) return false;
53 Handle<Map> map(HeapObject::cast(*receiver)->map()); 53 Handle<Map> map(HeapObject::cast(*receiver)->map());
54 return IsCompatibleReceiverType(map, holder); 54 return IsCompatibleReceiverMap(map, holder);
55 } 55 }
56 56
57 57
58 bool CallOptimization::IsCompatibleReceiverType(Handle<Map> map, 58 bool CallOptimization::IsCompatibleReceiverMap(Handle<Map> map,
59 Handle<JSObject> holder) const { 59 Handle<JSObject> holder) const {
60 HolderLookup holder_lookup; 60 HolderLookup holder_lookup;
61 Handle<JSObject> api_holder = LookupHolderOfExpectedType(map, &holder_lookup); 61 Handle<JSObject> api_holder = LookupHolderOfExpectedType(map, &holder_lookup);
62 switch (holder_lookup) { 62 switch (holder_lookup) {
63 case kHolderNotFound: 63 case kHolderNotFound:
64 return false; 64 return false;
65 case kHolderIsReceiver: 65 case kHolderIsReceiver:
66 return true; 66 return true;
67 case kHolderFound: 67 case kHolderFound:
68 if (api_holder.is_identical_to(holder)) return true; 68 if (api_holder.is_identical_to(holder)) return true;
69 // Check if holder is in prototype chain of api_holder. 69 // Check if holder is in prototype chain of api_holder.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 106
107 if (!info->signature()->IsUndefined()) { 107 if (!info->signature()->IsUndefined()) {
108 expected_receiver_type_ = 108 expected_receiver_type_ =
109 handle(FunctionTemplateInfo::cast(info->signature())); 109 handle(FunctionTemplateInfo::cast(info->signature()));
110 } 110 }
111 111
112 is_simple_api_call_ = true; 112 is_simple_api_call_ = true;
113 } 113 }
114 } 114 }
115 } // namespace v8::internal 115 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ic/call-optimization.h ('k') | src/ic/handler-compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698