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

Unified Diff: src/factory.cc

Issue 2396353002: Revert "Add Smi::Zero and replace all Smi::FromInt(0) calls" (Closed)
Patch Set: 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/elements.cc ('k') | src/field-type.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index da1a1b8ac40d8bf672d42034c0710a49154ca1e7..72a8e37c999c8ba54ab403713324a8b63a1cfafc 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -97,7 +97,7 @@ Handle<PrototypeInfo> Factory::NewPrototypeInfo() {
Handle<PrototypeInfo>::cast(NewStruct(PROTOTYPE_INFO_TYPE));
result->set_prototype_users(WeakFixedArray::Empty());
result->set_registry_slot(PrototypeInfo::UNREGISTERED);
- result->set_validity_cell(Smi::kZero);
+ result->set_validity_cell(Smi::FromInt(0));
result->set_bit_field(0);
return result;
}
@@ -179,7 +179,7 @@ Handle<FrameArray> Factory::NewFrameArray(int number_of_frames,
DCHECK_LE(0, number_of_frames);
Handle<FixedArray> result =
NewFixedArrayWithHoles(FrameArray::LengthFor(number_of_frames));
- result->set(FrameArray::kFrameCountIndex, Smi::kZero);
+ result->set(FrameArray::kFrameCountIndex, Smi::FromInt(0));
return Handle<FrameArray>::cast(result);
}
@@ -779,7 +779,7 @@ Handle<Context> Factory::NewNativeContext() {
array->set_map_no_write_barrier(*native_context_map());
Handle<Context> context = Handle<Context>::cast(array);
context->set_native_context(*context);
- context->set_errors_thrown(Smi::kZero);
+ context->set_errors_thrown(Smi::FromInt(0));
Handle<WeakCell> weak_cell = NewWeakCell(context);
context->set_self_weak_cell(*weak_cell);
DCHECK(context->IsNativeContext());
@@ -970,7 +970,7 @@ Handle<Script> Factory::NewScript(Handle<String> source) {
script->set_line_ends(heap->undefined_value());
script->set_eval_from_shared(heap->undefined_value());
script->set_eval_from_position(0);
- script->set_shared_function_infos(Smi::kZero);
+ script->set_shared_function_infos(Smi::FromInt(0));
script->set_flags(0);
heap->set_script_list(*WeakFixedArray::Add(script_list(), script));
@@ -1504,7 +1504,7 @@ Handle<Code> Factory::NewCode(const CodeDesc& desc,
// The code object has not been fully initialized yet. We rely on the
// fact that no allocation will happen from this point on.
DisallowHeapAllocation no_gc;
- code->set_gc_metadata(Smi::kZero);
+ code->set_gc_metadata(Smi::FromInt(0));
code->set_ic_age(isolate()->heap()->global_ic_age());
code->set_instruction_size(desc.instr_size);
code->set_relocation_info(*reloc_info);
@@ -1514,7 +1514,7 @@ Handle<Code> Factory::NewCode(const CodeDesc& desc,
code->set_raw_kind_specific_flags2(0);
code->set_is_crankshafted(crankshafted);
code->set_deoptimization_data(*empty_fixed_array(), SKIP_WRITE_BARRIER);
- code->set_raw_type_feedback_info(Smi::kZero);
+ code->set_raw_type_feedback_info(Smi::FromInt(0));
code->set_next_code_link(*undefined_value(), SKIP_WRITE_BARRIER);
code->set_handler_table(*empty_fixed_array(), SKIP_WRITE_BARRIER);
code->set_source_position_table(*empty_byte_array(), SKIP_WRITE_BARRIER);
@@ -1706,7 +1706,7 @@ void Factory::NewJSArrayStorage(Handle<JSArray> array,
DCHECK(capacity >= length);
if (capacity == 0) {
- array->set_length(Smi::kZero);
+ array->set_length(Smi::FromInt(0));
array->set_elements(*empty_fixed_array());
return;
}
@@ -2012,7 +2012,7 @@ Handle<JSTypedArray> Factory::NewJSTypedArray(ElementsKind elements_kind,
CHECK(number_of_elements <= static_cast<size_t>(Smi::kMaxValue));
size_t byte_length = number_of_elements * element_size;
- obj->set_byte_offset(Smi::kZero);
+ obj->set_byte_offset(Smi::FromInt(0));
i::Handle<i::Object> byte_length_object =
NewNumberFromSize(byte_length, pretenure);
obj->set_byte_length(*byte_length_object);
@@ -2459,7 +2459,7 @@ void Factory::SetRegExpIrregexpData(Handle<JSRegExp> regexp,
store->set(JSRegExp::kIrregexpUC16CodeIndex, uninitialized);
store->set(JSRegExp::kIrregexpLatin1CodeSavedIndex, uninitialized);
store->set(JSRegExp::kIrregexpUC16CodeSavedIndex, uninitialized);
- store->set(JSRegExp::kIrregexpMaxRegisterCountIndex, Smi::kZero);
+ store->set(JSRegExp::kIrregexpMaxRegisterCountIndex, Smi::FromInt(0));
store->set(JSRegExp::kIrregexpCaptureCountIndex,
Smi::FromInt(capture_count));
store->set(JSRegExp::kIrregexpCaptureNameMapIndex, uninitialized);
« no previous file with comments | « src/elements.cc ('k') | src/field-type.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698