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

Unified Diff: src/full-codegen/ia32/full-codegen-ia32.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/full-codegen/full-codegen.cc ('k') | src/full-codegen/mips/full-codegen-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/ia32/full-codegen-ia32.cc
diff --git a/src/full-codegen/ia32/full-codegen-ia32.cc b/src/full-codegen/ia32/full-codegen-ia32.cc
index de67d4a30f82ade8d1dceae01ef8ce2b0825e7ea..dd257c3fd4242d2511bc0cb2809370bc81e2d297 100644
--- a/src/full-codegen/ia32/full-codegen-ia32.cc
+++ b/src/full-codegen/ia32/full-codegen-ia32.cc
@@ -343,7 +343,7 @@ void FullCodeGenerator::Generate() {
void FullCodeGenerator::ClearAccumulator() {
- __ Move(eax, Immediate(Smi::FromInt(0)));
+ __ Move(eax, Immediate(Smi::kZero));
}
@@ -986,7 +986,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
__ bind(&use_cache);
__ EnumLength(edx, eax);
- __ cmp(edx, Immediate(Smi::FromInt(0)));
+ __ cmp(edx, Immediate(Smi::kZero));
__ j(equal, &no_descriptors);
__ LoadInstanceDescriptors(eax, ecx);
@@ -997,7 +997,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
__ push(eax); // Map.
__ push(ecx); // Enumeration cache.
__ push(edx); // Number of valid entries for the map in the enum cache.
- __ push(Immediate(Smi::FromInt(0))); // Initial index.
+ __ push(Immediate(Smi::kZero)); // Initial index.
__ jmp(&loop);
__ bind(&no_descriptors);
@@ -1012,7 +1012,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
__ mov(eax, FieldOperand(eax, FixedArray::kLengthOffset));
__ push(eax); // Fixed array length (as smi).
PrepareForBailoutForId(stmt->PrepareId(), BailoutState::NO_REGISTERS);
- __ push(Immediate(Smi::FromInt(0))); // Initial index.
+ __ push(Immediate(Smi::kZero)); // Initial index.
// Generate code for doing the condition check.
__ bind(&loop);
@@ -2971,7 +2971,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
} else {
// Reserve space for result of postfix operation.
if (expr->is_postfix() && !context()->IsEffect()) {
- PushOperand(Smi::FromInt(0));
+ PushOperand(Smi::kZero);
}
switch (assign_type) {
case NAMED_PROPERTY: {
« no previous file with comments | « src/full-codegen/full-codegen.cc ('k') | src/full-codegen/mips/full-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698