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

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

Issue 1407313004: Adds the possibility of setting a Code object as the callback of a FunctionTemplate. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update. Created 5 years 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/mips/handler-compiler-mips.cc ('k') | src/ic/ppc/handler-compiler-ppc.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_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
6 6
7 #include "src/ic/call-optimization.h" 7 #include "src/ic/call-optimization.h"
8 #include "src/ic/handler-compiler.h" 8 #include "src/ic/handler-compiler.h"
9 #include "src/ic/ic.h" 9 #include "src/ic/ic.h"
10 #include "src/isolate-inl.h" 10 #include "src/isolate-inl.h"
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 // Put call data in place. 277 // Put call data in place.
278 if (api_call_info->data()->IsUndefined()) { 278 if (api_call_info->data()->IsUndefined()) {
279 call_data_undefined = true; 279 call_data_undefined = true;
280 __ LoadRoot(data, Heap::kUndefinedValueRootIndex); 280 __ LoadRoot(data, Heap::kUndefinedValueRootIndex);
281 } else { 281 } else {
282 __ ld(data, FieldMemOperand(callee, JSFunction::kSharedFunctionInfoOffset)); 282 __ ld(data, FieldMemOperand(callee, JSFunction::kSharedFunctionInfoOffset));
283 __ ld(data, FieldMemOperand(data, SharedFunctionInfo::kFunctionDataOffset)); 283 __ ld(data, FieldMemOperand(data, SharedFunctionInfo::kFunctionDataOffset));
284 __ ld(data, FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset)); 284 __ ld(data, FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset));
285 __ ld(data, FieldMemOperand(data, CallHandlerInfo::kDataOffset)); 285 __ ld(data, FieldMemOperand(data, CallHandlerInfo::kDataOffset));
286 } 286 }
287
288 if (api_call_info->fast_handler()->IsCode()) {
289 // Just tail call into the fast handler if present.
290 __ Jump(handle(Code::cast(api_call_info->fast_handler())),
291 RelocInfo::CODE_TARGET);
292 return;
293 }
287 // Put api_function_address in place. 294 // Put api_function_address in place.
288 Address function_address = v8::ToCData<Address>(api_call_info->callback()); 295 Address function_address = v8::ToCData<Address>(api_call_info->callback());
289 ApiFunction fun(function_address); 296 ApiFunction fun(function_address);
290 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL; 297 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL;
291 ExternalReference ref = ExternalReference(&fun, type, masm->isolate()); 298 ExternalReference ref = ExternalReference(&fun, type, masm->isolate());
292 __ li(api_function_address, Operand(ref)); 299 __ li(api_function_address, Operand(ref));
293 300
294 // Jump to stub. 301 // Jump to stub.
295 CallApiAccessorStub stub(isolate, is_store, call_data_undefined); 302 CallApiAccessorStub stub(isolate, is_store, call_data_undefined);
296 __ TailCallStub(&stub); 303 __ TailCallStub(&stub);
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 // Return the generated code. 782 // Return the generated code.
776 return GetCode(kind(), Code::NORMAL, name); 783 return GetCode(kind(), Code::NORMAL, name);
777 } 784 }
778 785
779 786
780 #undef __ 787 #undef __
781 } // namespace internal 788 } // namespace internal
782 } // namespace v8 789 } // namespace v8
783 790
784 #endif // V8_TARGET_ARCH_MIPS64 791 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/ic/mips/handler-compiler-mips.cc ('k') | src/ic/ppc/handler-compiler-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698