| Index: src/compiler/code-stub-assembler.h
|
| diff --git a/src/compiler/code-stub-assembler.h b/src/compiler/code-stub-assembler.h
|
| index b6b2bd4738419e6100366c8c1a18ceea18809bb6..7f298db9ff30dba7c00903e1787c94d8502cf2e0 100644
|
| --- a/src/compiler/code-stub-assembler.h
|
| +++ b/src/compiler/code-stub-assembler.h
|
| @@ -34,9 +34,12 @@ class RawMachineLabel;
|
| class Schedule;
|
|
|
| #define CODE_STUB_ASSEMBLER_BINARY_OP_LIST(V) \
|
| + V(Float64Equal) \
|
| V(IntPtrAdd) \
|
| V(IntPtrSub) \
|
| V(Int32Add) \
|
| + V(Int32LessThan) \
|
| + V(Int32GreaterThanOrEqual) \
|
| V(Int32Sub) \
|
| V(Int32Mul) \
|
| V(WordEqual) \
|
| @@ -67,14 +70,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();
|
| @@ -142,12 +156,15 @@ 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);
|
|
|
| // Calls
|
| + Node* Context();
|
| Node* CallRuntime(Runtime::FunctionId function_id, Node* context);
|
| Node* CallRuntime(Runtime::FunctionId function_id, Node* context, Node* arg1);
|
| Node* CallRuntime(Runtime::FunctionId function_id, Node* context, Node* arg1,
|
| @@ -159,6 +176,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,
|
| @@ -204,12 +222,25 @@ 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);
|
|
|
| // 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);
|
| +
|
| + // Returns a node that is true if the given bit is set in |word32|.
|
| + template <typename T>
|
| + Node* BitFieldValue(Node* word32) {
|
| + return BitFieldValue(word32, T::kShift, T::kMask);
|
| + }
|
| +
|
| + Node* BitFieldValue(Node* word32, uint32_t shift, uint32_t mask);
|
| +
|
| +
|
| protected:
|
| // Protected helpers which delegate to RawMachineAssembler.
|
| Graph* graph();
|
| @@ -228,11 +259,15 @@ class CodeStubAssembler {
|
|
|
| Node* SmiShiftBitsConstant();
|
|
|
| + enum class LinkageDescriptorType { kStubCall, kJSCall };
|
| +
|
| base::SmartPointer<RawMachineAssembler> raw_assembler_;
|
| Code::Flags flags_;
|
| const char* name_;
|
| bool code_generated_;
|
| ZoneVector<Variable::Impl*> variables_;
|
| + LinkageDescriptorType linkage_type_;
|
| + int parameter_count_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(CodeStubAssembler);
|
| };
|
|
|