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

Unified Diff: src/code-stubs.cc

Issue 2381843002: Add Smi::Zero and replace all Smi::FromInt(0) calls (Closed)
Patch Set: Mark Smi::kZero as V8_EXPORT_PRIVATE Created 4 years, 2 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 | « src/code-stub-assembler.cc ('k') | src/compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.cc
diff --git a/src/code-stubs.cc b/src/code-stubs.cc
index 0abb6d06e69fe0b6cf9d51033d5e7b71db6471cc..d81802dccef5de01108c573cfc2bc35d7a1f0c4f 100644
--- a/src/code-stubs.cc
+++ b/src/code-stubs.cc
@@ -22,7 +22,7 @@ namespace internal {
RUNTIME_FUNCTION(UnexpectedStubMiss) {
FATAL("Unexpected deopt of a stub");
- return Smi::FromInt(0);
+ return Smi::kZero;
}
CodeStubDescriptor::CodeStubDescriptor(CodeStub* stub)
@@ -2527,7 +2527,7 @@ compiler::Node* FastCloneShallowArrayStub::Generate(
allocation_site =
allocation_site_mode == TRACK_ALLOCATION_SITE ? allocation_site : nullptr;
- Node* zero = assembler->SmiConstant(Smi::FromInt(0));
+ Node* zero = assembler->SmiConstant(Smi::kZero);
assembler->GotoIf(assembler->SmiEqual(capacity, zero), &zero_capacity);
Node* elements_map = assembler->LoadMap(boilerplate_elements);
@@ -2834,7 +2834,7 @@ void ArrayNoArgumentConstructorStub::GenerateAssembly(
Node* array = assembler->AllocateJSArray(
elements_kind(), array_map,
assembler->IntPtrConstant(JSArray::kPreallocatedArrayElements),
- assembler->SmiConstant(Smi::FromInt(0)), allocation_site);
+ assembler->SmiConstant(Smi::kZero), allocation_site);
assembler->Return(array);
}
@@ -2847,7 +2847,7 @@ void InternalArrayNoArgumentConstructorStub::GenerateAssembly(
Node* array = assembler->AllocateJSArray(
elements_kind(), array_map,
assembler->IntPtrConstant(JSArray::kPreallocatedArrayElements),
- assembler->SmiConstant(Smi::FromInt(0)), nullptr);
+ assembler->SmiConstant(Smi::kZero), nullptr);
assembler->Return(array);
}
@@ -2875,7 +2875,7 @@ void SingleArgumentConstructorCommon(CodeStubAssembler* assembler,
if (IsFastPackedElementsKind(elements_kind)) {
Label abort(assembler, Label::kDeferred);
assembler->Branch(
- assembler->SmiEqual(size, assembler->SmiConstant(Smi::FromInt(0))),
+ assembler->SmiEqual(size, assembler->SmiConstant(Smi::kZero)),
&small_smi_size, &abort);
assembler->Bind(&abort);
« no previous file with comments | « src/code-stub-assembler.cc ('k') | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698