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

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: rename 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 115bc43dbc99a8e2f88204c6f3d8a873f27f846a..a12414b3d9f42e82f7100962e87b940b3dc6ed34 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,26 @@ class Schedule;
V(Word64Ror) \
V(UintPtrGreaterThanOrEqual)
+#define CODE_STUB_ASSEMBLER_UNARY_OP_LIST(V) \
+ V(ChangeFloat64ToUint32) \
+ V(ChangeInt32ToInt64) \
+ V(ChangeUint32ToFloat64) \
+ V(ChangeUint32ToUint64)
+
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();
@@ -147,9 +160,10 @@ class CodeStubAssembler {
Node* WordShl(Node* value, int shift);
- // Conversions
- Node* ChangeInt32ToInt64(Node* value);
- Node* ChangeUint32ToUint64(Node* value);
+// Unary
+#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);
@@ -166,6 +180,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,
@@ -197,9 +212,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* SmiToInt32(Node* value);
// Smi operations.
Node* SmiAdd(Node* a, Node* b);
@@ -215,6 +233,8 @@ 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* LoadHeapNumberValue(Node* object);
// Load an array element from a FixedArray.
Node* LoadFixedArrayElementSmiIndex(Node* object, Node* smi_index,
@@ -224,6 +244,15 @@ class CodeStubAssembler {
// Store an array element to a FixedArray.
Node* StoreFixedArrayElementNoWriteBarrier(Node* object, Node* index,
Node* value);
+ Node* LoadInstanceType(Node* object);
+
+ // Returns a node that is true if the given bit is set in |word32|.
+ template <typename T>
+ Node* BitFieldDecode(Node* word32) {
+ return BitFieldDecode(word32, T::kShift, T::kMask);
+ }
+
+ Node* BitFieldDecode(Node* word32, uint32_t shift, uint32_t mask);
protected:
// Protected helpers which delegate to RawMachineAssembler.
« 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