| Index: src/factory.cc
|
| diff --git a/src/factory.cc b/src/factory.cc
|
| index 163e86484dfb7f4d9f1ebd9c9ea02a8bf0ad51c2..4ad07ce46b36507a15bd4236048a9aaca06bdd57 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::FromInt(0));
|
| + result->set_validity_cell(Smi::kZero);
|
| 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::FromInt(0));
|
| + result->set(FrameArray::kFrameCountIndex, Smi::kZero);
|
| 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::FromInt(0));
|
| + context->set_errors_thrown(Smi::kZero);
|
| 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::FromInt(0));
|
| + script->set_shared_function_infos(Smi::kZero);
|
| 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::FromInt(0));
|
| + code->set_gc_metadata(Smi::kZero);
|
| 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::FromInt(0));
|
| + code->set_raw_type_feedback_info(Smi::kZero);
|
| 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::FromInt(0));
|
| + array->set_length(Smi::kZero);
|
| 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::FromInt(0));
|
| + obj->set_byte_offset(Smi::kZero);
|
| 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::FromInt(0));
|
| + store->set(JSRegExp::kIrregexpMaxRegisterCountIndex, Smi::kZero);
|
| store->set(JSRegExp::kIrregexpCaptureCountIndex,
|
| Smi::FromInt(capture_count));
|
| store->set(JSRegExp::kIrregexpCaptureNameMapIndex, uninitialized);
|
|
|