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

Side by Side Diff: src/ic/x64/handler-compiler-x64.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/ppc/handler-compiler-ppc.cc ('k') | src/ic/x87/handler-compiler-x87.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_X64 5 #if V8_TARGET_ARCH_X64
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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 if (api_call_info->data()->IsUndefined()) { 181 if (api_call_info->data()->IsUndefined()) {
182 call_data_undefined = true; 182 call_data_undefined = true;
183 __ LoadRoot(data, Heap::kUndefinedValueRootIndex); 183 __ LoadRoot(data, Heap::kUndefinedValueRootIndex);
184 } else { 184 } else {
185 __ movp(data, FieldOperand(callee, JSFunction::kSharedFunctionInfoOffset)); 185 __ movp(data, FieldOperand(callee, JSFunction::kSharedFunctionInfoOffset));
186 __ movp(data, FieldOperand(data, SharedFunctionInfo::kFunctionDataOffset)); 186 __ movp(data, FieldOperand(data, SharedFunctionInfo::kFunctionDataOffset));
187 __ movp(data, FieldOperand(data, FunctionTemplateInfo::kCallCodeOffset)); 187 __ movp(data, FieldOperand(data, FunctionTemplateInfo::kCallCodeOffset));
188 __ movp(data, FieldOperand(data, CallHandlerInfo::kDataOffset)); 188 __ movp(data, FieldOperand(data, CallHandlerInfo::kDataOffset));
189 } 189 }
190 190
191 if (api_call_info->fast_handler()->IsCode()) {
192 // Just tail call into the fast handler if present.
193 __ Jump(handle(Code::cast(api_call_info->fast_handler())),
194 RelocInfo::CODE_TARGET);
195 return;
196 }
197
191 // Put api_function_address in place. 198 // Put api_function_address in place.
192 Address function_address = v8::ToCData<Address>(api_call_info->callback()); 199 Address function_address = v8::ToCData<Address>(api_call_info->callback());
193 __ Move(api_function_address, function_address, 200 __ Move(api_function_address, function_address,
194 RelocInfo::EXTERNAL_REFERENCE); 201 RelocInfo::EXTERNAL_REFERENCE);
195 202
196 // Jump to stub. 203 // Jump to stub.
197 CallApiAccessorStub stub(isolate, is_store, call_data_undefined); 204 CallApiAccessorStub stub(isolate, is_store, call_data_undefined);
198 __ TailCallStub(&stub); 205 __ TailCallStub(&stub);
199 } 206 }
200 207
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 // Return the generated code. 807 // Return the generated code.
801 return GetCode(kind(), Code::NORMAL, name); 808 return GetCode(kind(), Code::NORMAL, name);
802 } 809 }
803 810
804 811
805 #undef __ 812 #undef __
806 } // namespace internal 813 } // namespace internal
807 } // namespace v8 814 } // namespace v8
808 815
809 #endif // V8_TARGET_ARCH_X64 816 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ic/ppc/handler-compiler-ppc.cc ('k') | src/ic/x87/handler-compiler-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698