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

Side by Side Diff: src/ic/mips/handler-compiler-mips.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/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/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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 // Put call data in place. 276 // Put call data in place.
277 if (api_call_info->data()->IsUndefined()) { 277 if (api_call_info->data()->IsUndefined()) {
278 call_data_undefined = true; 278 call_data_undefined = true;
279 __ LoadRoot(data, Heap::kUndefinedValueRootIndex); 279 __ LoadRoot(data, Heap::kUndefinedValueRootIndex);
280 } else { 280 } else {
281 __ lw(data, FieldMemOperand(callee, JSFunction::kSharedFunctionInfoOffset)); 281 __ lw(data, FieldMemOperand(callee, JSFunction::kSharedFunctionInfoOffset));
282 __ lw(data, FieldMemOperand(data, SharedFunctionInfo::kFunctionDataOffset)); 282 __ lw(data, FieldMemOperand(data, SharedFunctionInfo::kFunctionDataOffset));
283 __ lw(data, FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset)); 283 __ lw(data, FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset));
284 __ lw(data, FieldMemOperand(data, CallHandlerInfo::kDataOffset)); 284 __ lw(data, FieldMemOperand(data, CallHandlerInfo::kDataOffset));
285 } 285 }
286
287 if (api_call_info->fast_handler()->IsCode()) {
288 // Just tail call into the fast handler if present.
289 __ Jump(handle(Code::cast(api_call_info->fast_handler())),
290 RelocInfo::CODE_TARGET);
291 return;
292 }
286 // Put api_function_address in place. 293 // Put api_function_address in place.
287 Address function_address = v8::ToCData<Address>(api_call_info->callback()); 294 Address function_address = v8::ToCData<Address>(api_call_info->callback());
288 ApiFunction fun(function_address); 295 ApiFunction fun(function_address);
289 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL; 296 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL;
290 ExternalReference ref = ExternalReference(&fun, type, masm->isolate()); 297 ExternalReference ref = ExternalReference(&fun, type, masm->isolate());
291 __ li(api_function_address, Operand(ref)); 298 __ li(api_function_address, Operand(ref));
292 299
293 // Jump to stub. 300 // Jump to stub.
294 CallApiAccessorStub stub(isolate, is_store, call_data_undefined); 301 CallApiAccessorStub stub(isolate, is_store, call_data_undefined);
295 __ TailCallStub(&stub); 302 __ TailCallStub(&stub);
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 // Return the generated code. 781 // Return the generated code.
775 return GetCode(kind(), Code::NORMAL, name); 782 return GetCode(kind(), Code::NORMAL, name);
776 } 783 }
777 784
778 785
779 #undef __ 786 #undef __
780 } // namespace internal 787 } // namespace internal
781 } // namespace v8 788 } // namespace v8
782 789
783 #endif // V8_TARGET_ARCH_MIPS 790 #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