Chromium Code Reviews| Index: src/code-stub-assembler.h |
| diff --git a/src/code-stub-assembler.h b/src/code-stub-assembler.h |
| index de07aa60033e287200be13ac8da77824b155940e..421fbcfcbcb73d6c842d02ddd87352b3a5b7198d 100644 |
| --- a/src/code-stub-assembler.h |
| +++ b/src/code-stub-assembler.h |
| @@ -15,6 +15,7 @@ namespace v8 { |
| namespace internal { |
| class CallInterfaceDescriptor; |
| +class CodeStubArguments; |
| class StatsCounter; |
| class StubCache; |
| @@ -69,6 +70,12 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler { |
| return Is64() ? INTPTR_PARAMETERS : SMI_PARAMETERS; |
| } |
| + MachineRepresentation OptimalParameterRepresentation() const { |
| + return OptimalParameterMode() == INTPTR_PARAMETERS |
| + ? MachineType::PointerRepresentation() |
| + : MachineRepresentation::kTaggedSigned; |
| + } |
| + |
| compiler::Node* UntagParameter(compiler::Node* value, ParameterMode mode) { |
| if (mode != SMI_PARAMETERS) value = SmiUntag(value); |
| return value; |
| @@ -142,6 +149,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler { |
| // Smi | HeapNumber operations. |
| compiler::Node* NumberInc(compiler::Node* value); |
| + void GotoIfNotNumber(compiler::Node* value, Label* is_not_number); |
|
Jakob Kummerow
2016/11/23 17:17:06
nit: when you rebase, please drop all the "compile
danno
2016/11/29 14:39:59
Done.
|
| + void GotoIfNumber(compiler::Node* value, Label* is_number); |
| // Allocate an object of the given size. |
| compiler::Node* Allocate(compiler::Node* size, AllocationFlags flags = kNone); |
| @@ -157,6 +166,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler { |
| // Check a value for smi-ness |
| compiler::Node* TaggedIsSmi(compiler::Node* a); |
| + compiler::Node* TaggedIsNotSmi(compiler::Node* a); |
| // Check that the value is a non-negative smi. |
| compiler::Node* WordIsPositiveSmi(compiler::Node* a); |
| // Check that a word has a word-aligned address. |
| @@ -201,8 +211,12 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler { |
| Label* if_false); |
| void BranchIfJSObject(compiler::Node* object, Label* if_true, |
| Label* if_false); |
| + |
| + enum class FastJSArrayAccessMode { INBOUNDS_READ, ANY_ACCESS }; |
| + |
| void BranchIfFastJSArray(compiler::Node* object, compiler::Node* context, |
| - Label* if_true, Label* if_false); |
| + FastJSArrayAccessMode mode, Label* if_true, |
| + Label* if_false); |
| // Load value from current frame by given offset in bytes. |
| compiler::Node* LoadFromFrame(int offset, |
| @@ -372,6 +386,11 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler { |
| compiler::Node* object, compiler::Node* index, compiler::Node* value, |
| ParameterMode parameter_mode = INTEGER_PARAMETERS); |
| + compiler::Node* BuildAppendJSArray(ElementsKind kind, compiler::Node* context, |
| + compiler::Node* array, |
| + CodeStubArguments& args, |
| + Variable& arg_index, Label* bailout); |
| + |
| void StoreFieldsNoWriteBarrier(compiler::Node* start_address, |
| compiler::Node* end_address, |
| compiler::Node* value); |
| @@ -582,6 +601,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler { |
| compiler::Node* ChangeFloat64ToTagged(compiler::Node* value); |
| compiler::Node* ChangeInt32ToTagged(compiler::Node* value); |
| compiler::Node* ChangeUint32ToTagged(compiler::Node* value); |
| + compiler::Node* ChangeNumberToFloat64(compiler::Node* value); |
| // Type conversions. |
| // Throws a TypeError for {method_name} if {value} is not coercible to Object, |
| @@ -742,6 +762,9 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler { |
| void IncrementCounter(StatsCounter* counter, int delta); |
| void DecrementCounter(StatsCounter* counter, int delta); |
| + void Increment(Variable& variable, int value = 1, |
| + ParameterMode mode = INTPTR_PARAMETERS); |
| + |
| // Generates "if (false) goto label" code. Useful for marking a label as |
| // "live" to avoid assertion failures during graph building. In the resulting |
| // code this check will be eliminated. |
| @@ -1249,14 +1272,16 @@ class CodeStubArguments { |
| CodeStubAssembler::ParameterMode mode = |
| CodeStubAssembler::INTPTR_PARAMETERS); |
| - compiler::Node* GetReceiver(); |
| + compiler::Node* GetReceiver() const; |
| // |index| is zero-based and does not include the receiver |
| compiler::Node* AtIndex(compiler::Node* index, |
| CodeStubAssembler::ParameterMode mode = |
| - CodeStubAssembler::INTPTR_PARAMETERS); |
| + CodeStubAssembler::INTPTR_PARAMETERS) const; |
| + |
| + compiler::Node* AtIndex(int index) const; |
| - compiler::Node* AtIndex(int index); |
| + compiler::Node* GetLength() const { return argc_; } |
| typedef std::function<void(CodeStubAssembler* assembler, compiler::Node* arg)> |
| ForEachBodyFunction; |