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

Unified Diff: src/code-stubs-hydrogen.cc

Issue 2686263002: [crankshaft] Fix Smi overflow in {HMaybeGrowElements}. (Closed)
Patch Set: Created 3 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/crankshaft/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs-hydrogen.cc
diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc
index d2a451bf13d65cbd73b41ed157b98e42f2d052b3..4fd9309b0eacd66186d54c12d9d943e60afcd376 100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -83,9 +83,6 @@ class CodeStubGraphBuilderBase : public HGraphBuilder {
Representation representation,
bool transition_to_field);
- HValue* BuildPushElement(HValue* object, HValue* argc,
- HValue* argument_elements, ElementsKind kind);
-
HValue* BuildToString(HValue* input, bool convert);
HValue* BuildToPrimitive(HValue* input, HValue* input_map);
@@ -330,52 +327,6 @@ static Handle<Code> DoGenerateCode(Stub* stub) {
}
-HValue* CodeStubGraphBuilderBase::BuildPushElement(HValue* object, HValue* argc,
- HValue* argument_elements,
- ElementsKind kind) {
- // Precheck whether all elements fit into the array.
- if (!IsFastObjectElementsKind(kind)) {
- LoopBuilder builder(this, context(), LoopBuilder::kPostIncrement);
- HValue* start = graph()->GetConstant0();
- HValue* key = builder.BeginBody(start, argc, Token::LT);
- {
- HInstruction* argument =
- Add<HAccessArgumentsAt>(argument_elements, argc, key);
- IfBuilder can_store(this);
- can_store.IfNot<HIsSmiAndBranch>(argument);
- if (IsFastDoubleElementsKind(kind)) {
- can_store.And();
- can_store.IfNot<HCompareMap>(argument,
- isolate()->factory()->heap_number_map());
- }
- can_store.ThenDeopt(DeoptimizeReason::kFastPathFailed);
- can_store.End();
- }
- builder.EndBody();
- }
-
- HValue* length = Add<HLoadNamedField>(object, nullptr,
- HObjectAccess::ForArrayLength(kind));
- HValue* new_length = AddUncasted<HAdd>(length, argc);
- HValue* max_key = AddUncasted<HSub>(new_length, graph()->GetConstant1());
-
- HValue* elements = Add<HLoadNamedField>(object, nullptr,
- HObjectAccess::ForElementsPointer());
- elements = BuildCheckForCapacityGrow(object, elements, kind, length, max_key,
- true, STORE);
-
- LoopBuilder builder(this, context(), LoopBuilder::kPostIncrement);
- HValue* start = graph()->GetConstant0();
- HValue* key = builder.BeginBody(start, argc, Token::LT);
- {
- HValue* argument = Add<HAccessArgumentsAt>(argument_elements, argc, key);
- HValue* index = AddUncasted<HAdd>(key, length);
- AddElementAccess(elements, index, argument, object, nullptr, kind, STORE);
- }
- builder.EndBody();
- return new_length;
-}
-
HLoadNamedField* CodeStubGraphBuilderBase::BuildLoadNamedField(
HValue* object, FieldIndex index) {
Representation representation = index.is_double()
« no previous file with comments | « no previous file | src/crankshaft/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698