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

Unified Diff: src/compiler/code-stub-assembler.h

Issue 1705073005: CodeStubAssembler can generate code for builtins (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add SmiUntag32 Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/compiler/code-stub-assembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/code-stub-assembler.h
diff --git a/src/compiler/code-stub-assembler.h b/src/compiler/code-stub-assembler.h
index 4d52065fcf706fc661564d851e14ca04bc6c8af2..9ce8aedaa3f5e426cb2171d022000feaf63b7f0e 100644
--- a/src/compiler/code-stub-assembler.h
+++ b/src/compiler/code-stub-assembler.h
@@ -43,6 +43,7 @@ class Schedule;
V(Int32Sub) \
V(Int32Mul) \
V(Int32GreaterThanOrEqual) \
+ V(Int32LessThan) \
V(WordEqual) \
V(WordNotEqual) \
V(WordOr) \
@@ -71,14 +72,25 @@ class Schedule;
V(Word64Ror) \
V(UintPtrGreaterThanOrEqual)
+#define CODE_STUB_ASSEMBLER_UNARY_OP_LIST(V) \
+ V(ChangeFloat64ToUint32) \
+ V(ChangeInt32ToInt64) \
+ V(ChangeUint32ToFloat64)
+
class CodeStubAssembler {
public:
+ // Create with CallStub linkage.
// |result_size| specifies the number of results returned by the stub.
// TODO(rmcilroy): move result_size to the CallInterfaceDescriptor.
CodeStubAssembler(Isolate* isolate, Zone* zone,
const CallInterfaceDescriptor& descriptor,
Code::Flags flags, const char* name,
size_t result_size = 1);
+
+ // Create with JSCall linkage.
+ CodeStubAssembler(Isolate* isolate, Zone* zone, int parameter_count,
+ Code::Flags flags, const char* name);
+
virtual ~CodeStubAssembler();
Handle<Code> GenerateCode();
@@ -148,7 +160,9 @@ class CodeStubAssembler {
Node* WordShl(Node* value, int shift);
// Conversions
- Node* ChangeInt32ToInt64(Node* value);
+#define DECLARE_CODE_STUB_ASSEMBER_UNARY_OP(name) Node* name(Node* a);
+ CODE_STUB_ASSEMBLER_UNARY_OP_LIST(DECLARE_CODE_STUB_ASSEMBER_UNARY_OP)
+#undef DECLARE_CODE_STUB_ASSEMBER_UNARY_OP
// Projections
Node* Projection(int index, Node* value);
@@ -165,6 +179,7 @@ class CodeStubAssembler {
Node* CallRuntime(Runtime::FunctionId function_id, Node* context, Node* arg1,
Node* arg2, Node* arg3, Node* arg4, Node* arg5);
+ Node* TailCallRuntime(Runtime::FunctionId function_id, Node* context);
Node* TailCallRuntime(Runtime::FunctionId function_id, Node* context,
Node* arg1);
Node* TailCallRuntime(Runtime::FunctionId function_id, Node* context,
@@ -196,9 +211,12 @@ class CodeStubAssembler {
// Macros
// ===========================================================================
- // Tag and untag Smi values.
+ // Tag a Word as a Smi value.
Node* SmiTag(Node* value);
+ // Untag a Smi value as a Word.
Node* SmiUntag(Node* value);
+ // Untag an Smi value as a 32-bit value.
+ Node* SmiUntag32(Node* value);
Benedikt Meurer 2016/03/01 04:54:44 Nit: Rename to SmiToInt32
binji 2016/03/01 21:56:38 Done.
// Smi operations.
Node* SmiAdd(Node* a, Node* b);
@@ -214,12 +232,24 @@ class CodeStubAssembler {
Node* LoadBufferObject(Node* buffer, int offset);
// Load a field from an object on the heap.
Node* LoadObjectField(Node* object, int offset);
+ // Load the HeapNumber value from a HeapNumber object.
+ Node* LoadHeapNumber(Node* object);
Benedikt Meurer 2016/03/01 04:54:44 Nit: Rename to LoadHeapNumberValue
binji 2016/03/01 21:56:38 Done.
// Load an array element from a FixedArray.
Node* LoadFixedArrayElementSmiIndex(Node* object, Node* smi_index,
int additional_offset = 0);
Node* LoadFixedArrayElementConstantIndex(Node* object, int index);
+ Node* InstanceType(Node* object);
Jarin 2016/02/29 20:04:43 InstanceType -> LoadInstanceType?
binji 2016/03/01 21:56:38 Done.
+
+ // Returns a node that is true if the given bit is set in |word32|.
+ template <typename T>
+ Node* BitFieldValue(Node* word32) {
Benedikt Meurer 2016/03/01 04:54:44 Nit: Rename to BitFieldDecode
binji 2016/03/01 21:56:38 Done.
+ return BitFieldValue(word32, T::kShift, T::kMask);
+ }
+
+ Node* BitFieldValue(Node* word32, uint32_t shift, uint32_t mask);
Benedikt Meurer 2016/03/01 04:54:44 Nit: Rename to BitFieldDecode
binji 2016/03/01 21:56:38 Done.
+
protected:
// Protected helpers which delegate to RawMachineAssembler.
Graph* graph();
« no previous file with comments | « no previous file | src/compiler/code-stub-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698