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

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

Issue 2556123002: [turbofan] Further adapting machine graph verifier to code stubs. (Closed)
Patch Set: Created 4 years 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-stub-assembler.h ('k') | src/compiler/pipeline.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stub-assembler.cc
diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc
index 8ee092a61e8a447bcec3a7dbe1dd66991e5afc7d..388af31c040fd6bf3f0720f769bfc5b0c7ab400b 100644
--- a/src/code-stub-assembler.cc
+++ b/src/code-stub-assembler.cc
@@ -473,6 +473,10 @@ Node* CodeStubAssembler::SmiLessThanOrEqual(Node* a, Node* b) {
return IntPtrLessThanOrEqual(BitcastTaggedToWord(a), BitcastTaggedToWord(b));
}
+Node* CodeStubAssembler::SmiGreaterThan(Node* a, Node* b) {
+ return IntPtrGreaterThan(BitcastTaggedToWord(a), BitcastTaggedToWord(b));
+}
+
Node* CodeStubAssembler::SmiMax(Node* a, Node* b) {
return SelectTaggedConstant(SmiLessThan(a, b), b, a);
}
@@ -2057,10 +2061,9 @@ Node* CodeStubAssembler::AllocateJSArray(ElementsKind kind, Node* array_map,
TagParameter(capacity, capacity_mode));
// Fill in the elements with holes.
- FillFixedArrayWithValue(
- kind, elements, capacity_mode == SMI_PARAMETERS ? SmiConstant(Smi::kZero)
- : IntPtrConstant(0),
- capacity, Heap::kTheHoleValueRootIndex, capacity_mode);
+ FillFixedArrayWithValue(kind, elements, IntPtrOrSmiConstant(0, capacity_mode),
+ capacity, Heap::kTheHoleValueRootIndex,
+ capacity_mode);
return array;
}
@@ -2069,8 +2072,8 @@ Node* CodeStubAssembler::AllocateFixedArray(ElementsKind kind,
Node* capacity_node,
ParameterMode mode,
AllocationFlags flags) {
- CSA_ASSERT(this,
- IntPtrGreaterThan(capacity_node, IntPtrOrSmiConstant(0, mode)));
+ CSA_ASSERT(this, IntPtrOrSmiGreaterThan(capacity_node,
+ IntPtrOrSmiConstant(0, mode), mode));
Node* total_size = GetFixedArrayAllocationSize(capacity_node, kind, mode);
// Allocate both array and elements object, and initialize the JSArray.
@@ -5504,7 +5507,7 @@ void CodeStubAssembler::ExtendPropertiesBackingStore(Node* object) {
length = UntagParameter(length, mode);
Node* delta = IntPtrOrSmiConstant(JSObject::kFieldsAdded, mode);
- Node* new_capacity = IntPtrAdd(length, delta);
+ Node* new_capacity = IntPtrOrSmiAdd(length, delta, mode);
// Grow properties array.
ElementsKind kind = FAST_ELEMENTS;
@@ -5512,9 +5515,12 @@ void CodeStubAssembler::ExtendPropertiesBackingStore(Node* object) {
FixedArrayBase::GetMaxLengthForNewSpaceAllocation(kind));
// The size of a new properties backing store is guaranteed to be small
// enough that the new backing store will be allocated in new space.
- CSA_ASSERT(this, UintPtrLessThan(new_capacity,
- IntPtrConstant(kMaxNumberOfDescriptors +
- JSObject::kFieldsAdded)));
+ CSA_ASSERT(this,
+ UintPtrOrSmiLessThan(
+ new_capacity,
+ IntPtrOrSmiConstant(
+ kMaxNumberOfDescriptors + JSObject::kFieldsAdded, mode),
+ mode));
Node* new_properties = AllocateFixedArray(kind, new_capacity, mode);
« no previous file with comments | « src/code-stub-assembler.h ('k') | src/compiler/pipeline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698