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

Side by Side Diff: src/ic/ia32/handler-compiler-ia32.cc

Issue 873723005: Load API holder from prototype chain instead embedding it in handler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: More fixes 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.cc ('k') | src/ic/mips/handler-compiler-mips.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 #if V8_TARGET_ARCH_IA32 7 #if V8_TARGET_ARCH_IA32
8 8
9 #include "src/ic/call-optimization.h" 9 #include "src/ic/call-optimization.h"
10 #include "src/ic/handler-compiler.h" 10 #include "src/ic/handler-compiler.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 Register holder = ecx; 168 Register holder = ecx;
169 Register api_function_address = edx; 169 Register api_function_address = edx;
170 scratch = no_reg; 170 scratch = no_reg;
171 171
172 // Put callee in place. 172 // Put callee in place.
173 __ LoadAccessor(callee, accessor_holder, accessor_index, 173 __ LoadAccessor(callee, accessor_holder, accessor_index,
174 is_store ? ACCESSOR_SETTER : ACCESSOR_GETTER); 174 is_store ? ACCESSOR_SETTER : ACCESSOR_GETTER);
175 175
176 // Put holder in place. 176 // Put holder in place.
177 CallOptimization::HolderLookup holder_lookup; 177 CallOptimization::HolderLookup holder_lookup;
178 Handle<JSObject> api_holder = 178 int holder_depth = 0;
179 optimization.LookupHolderOfExpectedType(receiver_map, &holder_lookup); 179 optimization.LookupHolderOfExpectedType(receiver_map, &holder_lookup,
180 &holder_depth);
180 switch (holder_lookup) { 181 switch (holder_lookup) {
181 case CallOptimization::kHolderIsReceiver: 182 case CallOptimization::kHolderIsReceiver:
182 __ Move(holder, receiver); 183 __ Move(holder, receiver);
183 break; 184 break;
184 case CallOptimization::kHolderFound: 185 case CallOptimization::kHolderFound:
185 __ LoadHeapObject(holder, api_holder); 186 __ mov(holder, FieldOperand(receiver, HeapObject::kMapOffset));
187 __ mov(holder, FieldOperand(holder, Map::kPrototypeOffset));
188 for (int i = 1; i < holder_depth; i++) {
189 __ mov(holder, FieldOperand(holder, HeapObject::kMapOffset));
190 __ mov(holder, FieldOperand(holder, Map::kPrototypeOffset));
191 }
186 break; 192 break;
187 case CallOptimization::kHolderNotFound: 193 case CallOptimization::kHolderNotFound:
188 UNREACHABLE(); 194 UNREACHABLE();
189 break; 195 break;
190 } 196 }
191 197
192 Isolate* isolate = masm->isolate(); 198 Isolate* isolate = masm->isolate();
193 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); 199 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info();
194 bool call_data_undefined = false; 200 bool call_data_undefined = false;
195 // Put call data in place. 201 // Put call data in place.
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 // Return the generated code. 770 // Return the generated code.
765 return GetCode(kind(), Code::NORMAL, name); 771 return GetCode(kind(), Code::NORMAL, name);
766 } 772 }
767 773
768 774
769 #undef __ 775 #undef __
770 } 776 }
771 } // namespace v8::internal 777 } // namespace v8::internal
772 778
773 #endif // V8_TARGET_ARCH_IA32 779 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ic/call-optimization.cc ('k') | src/ic/mips/handler-compiler-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698