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

Side by Side Diff: src/ic/mips/handler-compiler-mips.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/ia32/handler-compiler-ia32.cc ('k') | src/ic/mips64/handler-compiler-mips64.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_MIPS 5 #if V8_TARGET_ARCH_MIPS
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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 __ lw(holder, FieldMemOperand(holder, Map::kPrototypeOffset)); 204 __ lw(holder, FieldMemOperand(holder, Map::kPrototypeOffset));
205 } 205 }
206 break; 206 break;
207 case CallOptimization::kHolderNotFound: 207 case CallOptimization::kHolderNotFound:
208 UNREACHABLE(); 208 UNREACHABLE();
209 break; 209 break;
210 } 210 }
211 211
212 Isolate* isolate = masm->isolate(); 212 Isolate* isolate = masm->isolate();
213 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); 213 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info();
214 bool call_data_undefined = false;
215 // Put call data in place. 214 // Put call data in place.
216 if (api_call_info->data()->IsUndefined(isolate)) { 215 if (api_call_info->data()->IsUndefined(isolate)) {
217 call_data_undefined = true;
218 __ LoadRoot(data, Heap::kUndefinedValueRootIndex); 216 __ LoadRoot(data, Heap::kUndefinedValueRootIndex);
219 } else { 217 } else {
220 if (optimization.is_constant_call()) { 218 if (optimization.is_constant_call()) {
221 __ lw(data, 219 __ lw(data,
222 FieldMemOperand(callee, JSFunction::kSharedFunctionInfoOffset)); 220 FieldMemOperand(callee, JSFunction::kSharedFunctionInfoOffset));
223 __ lw(data, 221 __ lw(data,
224 FieldMemOperand(data, SharedFunctionInfo::kFunctionDataOffset)); 222 FieldMemOperand(data, SharedFunctionInfo::kFunctionDataOffset));
225 __ lw(data, FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset)); 223 __ lw(data, FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset));
226 } else { 224 } else {
227 __ lw(data, 225 __ lw(data,
228 FieldMemOperand(callee, FunctionTemplateInfo::kCallCodeOffset)); 226 FieldMemOperand(callee, FunctionTemplateInfo::kCallCodeOffset));
229 } 227 }
230 __ lw(data, FieldMemOperand(data, CallHandlerInfo::kDataOffset)); 228 __ lw(data, FieldMemOperand(data, CallHandlerInfo::kDataOffset));
231 } 229 }
232 230
233 // Put api_function_address in place. 231 // Put api_function_address in place.
234 Address function_address = v8::ToCData<Address>(api_call_info->callback()); 232 Address function_address = v8::ToCData<Address>(api_call_info->callback());
235 ApiFunction fun(function_address); 233 ApiFunction fun(function_address);
236 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL; 234 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL;
237 ExternalReference ref = ExternalReference(&fun, type, masm->isolate()); 235 ExternalReference ref = ExternalReference(&fun, type, masm->isolate());
238 __ li(api_function_address, Operand(ref)); 236 __ li(api_function_address, Operand(ref));
239 237
240 // Jump to stub. 238 // Jump to stub.
241 CallApiCallbackStub stub(isolate, is_store, call_data_undefined, 239 CallApiCallbackStub stub(isolate, is_store, !optimization.is_constant_call());
242 !optimization.is_constant_call());
243 __ TailCallStub(&stub); 240 __ TailCallStub(&stub);
244 } 241 }
245 242
246 #undef __ 243 #undef __
247 #define __ ACCESS_MASM(masm()) 244 #define __ ACCESS_MASM(masm())
248 245
249 246
250 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, 247 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label,
251 Handle<Name> name) { 248 Handle<Name> name) {
252 if (!label->is_unused()) { 249 if (!label->is_unused()) {
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 Register NamedStoreHandlerCompiler::value() { 409 Register NamedStoreHandlerCompiler::value() {
413 return StoreDescriptor::ValueRegister(); 410 return StoreDescriptor::ValueRegister();
414 } 411 }
415 412
416 413
417 #undef __ 414 #undef __
418 } // namespace internal 415 } // namespace internal
419 } // namespace v8 416 } // namespace v8
420 417
421 #endif // V8_TARGET_ARCH_MIPS 418 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ic/ia32/handler-compiler-ia32.cc ('k') | src/ic/mips64/handler-compiler-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698