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

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

Issue 2497243002: [stubs] Port builtin for Array.push fast-case from Crankshaft to TF (Closed)
Patch Set: Fix GC mole Created 4 years, 1 month 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 | « src/code-factory.cc ('k') | src/code-stub-assembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stub-assembler.h
diff --git a/src/code-stub-assembler.h b/src/code-stub-assembler.h
index 29afdfe4a0dd3a04ab6614d62238520950cfc4af..dd8769b3005f900cc7b1fdbf688801d03416e0e9 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;
@@ -74,6 +75,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;
+ }
+
Node* UntagParameter(Node* value, ParameterMode mode) {
if (mode != SMI_PARAMETERS) value = SmiUntag(value);
return value;
@@ -144,6 +151,8 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
// Smi | HeapNumber operations.
Node* NumberInc(Node* value);
+ void GotoIfNotNumber(Node* value, Label* is_not_number);
+ void GotoIfNumber(Node* value, Label* is_number);
// Allocate an object of the given size.
Node* Allocate(Node* size, AllocationFlags flags = kNone);
@@ -158,6 +167,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
// Check a value for smi-ness
Node* TaggedIsSmi(Node* a);
+ Node* TaggedIsNotSmi(Node* a);
// Check that the value is a non-negative smi.
Node* WordIsPositiveSmi(Node* a);
// Check that a word has a word-aligned address.
@@ -195,7 +205,10 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
void BranchIfJSReceiver(Node* object, Label* if_true, Label* if_false);
void BranchIfJSObject(Node* object, Label* if_true, Label* if_false);
- void BranchIfFastJSArray(Node* object, Node* context, Label* if_true,
+
+ enum class FastJSArrayAccessMode { INBOUNDS_READ, ANY_ACCESS };
+ void BranchIfFastJSArray(Node* object, Node* context,
+ FastJSArrayAccessMode mode, Label* if_true,
Label* if_false);
// Load value from current frame by given offset in bytes.
@@ -349,6 +362,10 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
Node* object, Node* index, Node* value,
ParameterMode parameter_mode = INTEGER_PARAMETERS);
+ Node* BuildAppendJSArray(ElementsKind kind, Node* context, Node* array,
+ CodeStubArguments& args, Variable& arg_index,
+ Label* bailout);
+
void StoreFieldsNoWriteBarrier(Node* start_address, Node* end_address,
Node* value);
@@ -518,6 +535,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
Node* ChangeFloat64ToTagged(Node* value);
Node* ChangeInt32ToTagged(Node* value);
Node* ChangeUint32ToTagged(Node* value);
+ Node* ChangeNumberToFloat64(Node* value);
// Type conversions.
// Throws a TypeError for {method_name} if {value} is not coercible to Object,
@@ -663,6 +681,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.
@@ -1018,13 +1039,15 @@ class CodeStubArguments {
CodeStubAssembler::ParameterMode mode =
CodeStubAssembler::INTPTR_PARAMETERS);
- Node* GetReceiver();
+ Node* GetReceiver() const;
// |index| is zero-based and does not include the receiver
Node* AtIndex(Node* index, CodeStubAssembler::ParameterMode mode =
- CodeStubAssembler::INTPTR_PARAMETERS);
+ CodeStubAssembler::INTPTR_PARAMETERS) const;
+
+ Node* AtIndex(int index) const;
- Node* AtIndex(int index);
+ Node* GetLength() const { return argc_; }
typedef std::function<void(CodeStubAssembler* assembler, Node* arg)>
ForEachBodyFunction;
« no previous file with comments | « src/code-factory.cc ('k') | src/code-stub-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698