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

Unified Diff: src/heap/heap-inl.h

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/heap/heap.cc ('k') | src/heap/incremental-marking.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap-inl.h
diff --git a/src/heap/heap-inl.h b/src/heap/heap-inl.h
index a8b98ac36c9ff6d1876b6b7f32e9d5d4fac26fb1..fc487d0cb70444f0de247121382644841a132828 100644
--- a/src/heap/heap-inl.h
+++ b/src/heap/heap-inl.h
@@ -742,9 +742,7 @@ void Heap::ExternalStringTable::ShrinkNewStrings(int position) {
#endif
}
-void Heap::ClearInstanceofCache() {
- set_instanceof_cache_function(Smi::FromInt(0));
-}
+void Heap::ClearInstanceofCache() { set_instanceof_cache_function(Smi::kZero); }
Oddball* Heap::ToBoolean(bool condition) {
return condition ? true_value() : false_value();
@@ -752,8 +750,8 @@ Oddball* Heap::ToBoolean(bool condition) {
void Heap::CompletelyClearInstanceofCache() {
- set_instanceof_cache_map(Smi::FromInt(0));
- set_instanceof_cache_function(Smi::FromInt(0));
+ set_instanceof_cache_map(Smi::kZero);
+ set_instanceof_cache_function(Smi::kZero);
}
@@ -776,27 +774,27 @@ int Heap::NextScriptId() {
}
void Heap::SetArgumentsAdaptorDeoptPCOffset(int pc_offset) {
- DCHECK(arguments_adaptor_deopt_pc_offset() == Smi::FromInt(0));
+ DCHECK(arguments_adaptor_deopt_pc_offset() == Smi::kZero);
set_arguments_adaptor_deopt_pc_offset(Smi::FromInt(pc_offset));
}
void Heap::SetConstructStubDeoptPCOffset(int pc_offset) {
- DCHECK(construct_stub_deopt_pc_offset() == Smi::FromInt(0));
+ DCHECK(construct_stub_deopt_pc_offset() == Smi::kZero);
set_construct_stub_deopt_pc_offset(Smi::FromInt(pc_offset));
}
void Heap::SetGetterStubDeoptPCOffset(int pc_offset) {
- DCHECK(getter_stub_deopt_pc_offset() == Smi::FromInt(0));
+ DCHECK(getter_stub_deopt_pc_offset() == Smi::kZero);
set_getter_stub_deopt_pc_offset(Smi::FromInt(pc_offset));
}
void Heap::SetSetterStubDeoptPCOffset(int pc_offset) {
- DCHECK(setter_stub_deopt_pc_offset() == Smi::FromInt(0));
+ DCHECK(setter_stub_deopt_pc_offset() == Smi::kZero);
set_setter_stub_deopt_pc_offset(Smi::FromInt(pc_offset));
}
void Heap::SetInterpreterEntryReturnPCOffset(int pc_offset) {
- DCHECK(interpreter_entry_return_pc_offset() == Smi::FromInt(0));
+ DCHECK(interpreter_entry_return_pc_offset() == Smi::kZero);
set_interpreter_entry_return_pc_offset(Smi::FromInt(pc_offset));
}
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/incremental-marking.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698