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

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, 1 month 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
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->callback()->IsCode()) {
192 // Just tail call into the code.
193 __ Jump(handle(Code::cast(api_call_info->callback())),
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 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 // Return the generated code. 818 // Return the generated code.
812 return GetCode(kind(), Code::NORMAL, name); 819 return GetCode(kind(), Code::NORMAL, name);
813 } 820 }
814 821
815 822
816 #undef __ 823 #undef __
817 } // namespace internal 824 } // namespace internal
818 } // namespace v8 825 } // namespace v8
819 826
820 #endif // V8_TARGET_ARCH_X64 827 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/execution.cc ('K') | « src/execution.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698