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

Side by Side Diff: src/compiler/code-assembler.cc

Issue 2607993003: FFI Compiler based on code stub assembler (Closed)
Patch Set: Rebase Created 3 years, 11 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
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 #include "src/compiler/code-assembler.h" 5 #include "src/compiler/code-assembler.h"
6 6
7 #include <ostream> 7 #include <ostream>
8 8
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/compiler/graph.h" 10 #include "src/compiler/graph.h"
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 } 242 }
243 IntPtrMatcher m(node); 243 IntPtrMatcher m(node);
244 if (m.HasValue()) out_value = m.Value(); 244 if (m.HasValue()) out_value = m.Value();
245 return m.HasValue(); 245 return m.HasValue();
246 } 246 }
247 247
248 Node* CodeAssembler::Parameter(int value) { 248 Node* CodeAssembler::Parameter(int value) {
249 return raw_assembler()->Parameter(value); 249 return raw_assembler()->Parameter(value);
250 } 250 }
251 251
252 Node* CodeAssembler::GetJSContextParameter() {
253 CallDescriptor* desc = raw_assembler()->call_descriptor();
254 DCHECK(desc->kind() == CallDescriptor::kCallJSFunction);
Michael Starzinger 2017/01/18 10:47:23 nit: DCHECK(desc->IsJSFunctionCall())
mattloring 2017/01/18 17:48:18 Done.
255 return Parameter(Linkage::GetJSCallContextParamIndex(
256 static_cast<int>(desc->JSParameterCount())));
257 }
258
252 void CodeAssembler::Return(Node* value) { 259 void CodeAssembler::Return(Node* value) {
253 return raw_assembler()->Return(value); 260 return raw_assembler()->Return(value);
254 } 261 }
255 262
256 void CodeAssembler::PopAndReturn(Node* pop, Node* value) { 263 void CodeAssembler::PopAndReturn(Node* pop, Node* value) {
257 return raw_assembler()->PopAndReturn(pop, value); 264 return raw_assembler()->PopAndReturn(pop, value);
258 } 265 }
259 266
260 void CodeAssembler::DebugBreak() { raw_assembler()->DebugBreak(); } 267 void CodeAssembler::DebugBreak() { raw_assembler()->DebugBreak(); }
261 268
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 602
596 Node* nodes[] = {target, args...}; 603 Node* nodes[] = {target, args...};
597 return raw_assembler()->TailCallN(desc, arraysize(nodes), nodes); 604 return raw_assembler()->TailCallN(desc, arraysize(nodes), nodes);
598 } 605 }
599 606
600 // Instantiate TailCallBytecodeDispatch() with 4 arguments. 607 // Instantiate TailCallBytecodeDispatch() with 4 arguments.
601 template V8_EXPORT_PRIVATE Node* CodeAssembler::TailCallBytecodeDispatch( 608 template V8_EXPORT_PRIVATE Node* CodeAssembler::TailCallBytecodeDispatch(
602 const CallInterfaceDescriptor& descriptor, Node* target, Node*, Node*, 609 const CallInterfaceDescriptor& descriptor, Node* target, Node*, Node*,
603 Node*, Node*); 610 Node*, Node*);
604 611
612 Node* CodeAssembler::CallCFunctionN(Signature<MachineType>* signature,
613 int input_count, Node* const* inputs) {
614 CallDescriptor* desc = Linkage::GetSimplifiedCDescriptor(zone(), signature);
615 return raw_assembler()->CallN(desc, input_count, inputs);
616 }
617
605 Node* CodeAssembler::CallCFunction2(MachineType return_type, 618 Node* CodeAssembler::CallCFunction2(MachineType return_type,
606 MachineType arg0_type, 619 MachineType arg0_type,
607 MachineType arg1_type, Node* function, 620 MachineType arg1_type, Node* function,
608 Node* arg0, Node* arg1) { 621 Node* arg0, Node* arg1) {
609 return raw_assembler()->CallCFunction2(return_type, arg0_type, arg1_type, 622 return raw_assembler()->CallCFunction2(return_type, arg0_type, arg1_type,
610 function, arg0, arg1); 623 function, arg0, arg1);
611 } 624 }
612 625
613 Node* CodeAssembler::CallCFunction3(MachineType return_type, 626 Node* CodeAssembler::CallCFunction3(MachineType return_type,
614 MachineType arg0_type, 627 MachineType arg0_type,
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 } 831 }
819 } 832 }
820 } 833 }
821 834
822 bound_ = true; 835 bound_ = true;
823 } 836 }
824 837
825 } // namespace compiler 838 } // namespace compiler
826 } // namespace internal 839 } // namespace internal
827 } // namespace v8 840 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/code-assembler.h ('k') | src/contexts.h » ('j') | src/ffi/ffi-compiler.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698