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

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

Issue 885763004: follow up named interceptor miss with api callback getter (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.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 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 } 42 }
43 } 43 }
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->IsJSObject()) return false; 52 if (!receiver->IsHeapObject()) return false;
53 Handle<Map> map(JSObject::cast(*receiver)->map()); 53 Handle<Map> map(HeapObject::cast(*receiver)->map());
54 return IsCompatibleReceiverType(map, holder);
55 }
56
57
58 bool CallOptimization::IsCompatibleReceiverType(Handle<Map> map,
59 Handle<JSObject> holder) const {
54 HolderLookup holder_lookup; 60 HolderLookup holder_lookup;
55 Handle<JSObject> api_holder = LookupHolderOfExpectedType(map, &holder_lookup); 61 Handle<JSObject> api_holder = LookupHolderOfExpectedType(map, &holder_lookup);
56 switch (holder_lookup) { 62 switch (holder_lookup) {
57 case kHolderNotFound: 63 case kHolderNotFound:
58 return false; 64 return false;
59 case kHolderIsReceiver: 65 case kHolderIsReceiver:
60 return true; 66 return true;
61 case kHolderFound: 67 case kHolderFound:
62 if (api_holder.is_identical_to(holder)) return true; 68 if (api_holder.is_identical_to(holder)) return true;
63 // 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
100 106
101 if (!info->signature()->IsUndefined()) { 107 if (!info->signature()->IsUndefined()) {
102 expected_receiver_type_ = 108 expected_receiver_type_ =
103 handle(FunctionTemplateInfo::cast(info->signature())); 109 handle(FunctionTemplateInfo::cast(info->signature()));
104 } 110 }
105 111
106 is_simple_api_call_ = true; 112 is_simple_api_call_ = true;
107 } 113 }
108 } 114 }
109 } // namespace v8::internal 115 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ic/call-optimization.h ('k') | src/ic/handler-compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698