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

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

Issue 2838143003: [stubs] Drop CallApiCallbackStub::call_data_undefined optimization. (Closed)
Patch Set: Fix handler-compiler for remaining archs. Created 3 years, 7 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/arm64/handler-compiler-arm64.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 #if V8_TARGET_ARCH_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/ic/handler-compiler.h" 7 #include "src/ic/handler-compiler.h"
8 8
9 #include "src/api-arguments.h" 9 #include "src/api-arguments.h"
10 #include "src/field-type.h" 10 #include "src/field-type.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 __ mov(holder, FieldOperand(holder, Map::kPrototypeOffset)); 154 __ mov(holder, FieldOperand(holder, Map::kPrototypeOffset));
155 } 155 }
156 break; 156 break;
157 case CallOptimization::kHolderNotFound: 157 case CallOptimization::kHolderNotFound:
158 UNREACHABLE(); 158 UNREACHABLE();
159 break; 159 break;
160 } 160 }
161 161
162 Isolate* isolate = masm->isolate(); 162 Isolate* isolate = masm->isolate();
163 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); 163 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info();
164 bool call_data_undefined = false;
165 // Put call data in place. 164 // Put call data in place.
166 if (api_call_info->data()->IsUndefined(isolate)) { 165 if (api_call_info->data()->IsUndefined(isolate)) {
167 call_data_undefined = true;
168 __ mov(data, Immediate(isolate->factory()->undefined_value())); 166 __ mov(data, Immediate(isolate->factory()->undefined_value()));
169 } else { 167 } else {
170 if (optimization.is_constant_call()) { 168 if (optimization.is_constant_call()) {
171 __ mov(data, FieldOperand(callee, JSFunction::kSharedFunctionInfoOffset)); 169 __ mov(data, FieldOperand(callee, JSFunction::kSharedFunctionInfoOffset));
172 __ mov(data, FieldOperand(data, SharedFunctionInfo::kFunctionDataOffset)); 170 __ mov(data, FieldOperand(data, SharedFunctionInfo::kFunctionDataOffset));
173 __ mov(data, FieldOperand(data, FunctionTemplateInfo::kCallCodeOffset)); 171 __ mov(data, FieldOperand(data, FunctionTemplateInfo::kCallCodeOffset));
174 } else { 172 } else {
175 __ mov(data, FieldOperand(callee, FunctionTemplateInfo::kCallCodeOffset)); 173 __ mov(data, FieldOperand(callee, FunctionTemplateInfo::kCallCodeOffset));
176 } 174 }
177 __ mov(data, FieldOperand(data, CallHandlerInfo::kDataOffset)); 175 __ mov(data, FieldOperand(data, CallHandlerInfo::kDataOffset));
178 } 176 }
179 177
180 // Put api_function_address in place. 178 // Put api_function_address in place.
181 Address function_address = v8::ToCData<Address>(api_call_info->callback()); 179 Address function_address = v8::ToCData<Address>(api_call_info->callback());
182 __ mov(api_function_address, Immediate(function_address)); 180 __ mov(api_function_address, Immediate(function_address));
183 181
184 // Jump to stub. 182 // Jump to stub.
185 CallApiCallbackStub stub(isolate, is_store, call_data_undefined, 183 CallApiCallbackStub stub(isolate, is_store, !optimization.is_constant_call());
186 !optimization.is_constant_call());
187 __ TailCallStub(&stub); 184 __ TailCallStub(&stub);
188 } 185 }
189 186
190 187
191 // Generate code to check that a global property cell is empty. Create 188 // Generate code to check that a global property cell is empty. Create
192 // the property cell at compilation time if no cell exists for the 189 // the property cell at compilation time if no cell exists for the
193 // property. 190 // property.
194 void PropertyHandlerCompiler::GenerateCheckPropertyCell( 191 void PropertyHandlerCompiler::GenerateCheckPropertyCell(
195 MacroAssembler* masm, Handle<JSGlobalObject> global, Handle<Name> name, 192 MacroAssembler* masm, Handle<JSGlobalObject> global, Handle<Name> name,
196 Register scratch, Label* miss) { 193 Register scratch, Label* miss) {
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 Register NamedStoreHandlerCompiler::value() { 445 Register NamedStoreHandlerCompiler::value() {
449 return StoreDescriptor::ValueRegister(); 446 return StoreDescriptor::ValueRegister();
450 } 447 }
451 448
452 449
453 #undef __ 450 #undef __
454 } // namespace internal 451 } // namespace internal
455 } // namespace v8 452 } // namespace v8
456 453
457 #endif // V8_TARGET_ARCH_IA32 454 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ic/arm64/handler-compiler-arm64.cc ('k') | src/ic/mips/handler-compiler-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698