| Index: src/arm/stub-cache-arm.cc
|
| diff --git a/src/arm/stub-cache-arm.cc b/src/arm/stub-cache-arm.cc
|
| index df370120bf5da60afff2d4d521acfb1284394146..78cc3382a8178b98effcaa1c45e6ceb01df1527b 100644
|
| --- a/src/arm/stub-cache-arm.cc
|
| +++ b/src/arm/stub-cache-arm.cc
|
| @@ -36,12 +36,12 @@ static void ProbeTable(Isolate* isolate,
|
| uint32_t map_off_addr = reinterpret_cast<uint32_t>(map_offset.address());
|
|
|
| // Check the relative positions of the address fields.
|
| - ASSERT(value_off_addr > key_off_addr);
|
| - ASSERT((value_off_addr - key_off_addr) % 4 == 0);
|
| - ASSERT((value_off_addr - key_off_addr) < (256 * 4));
|
| - ASSERT(map_off_addr > key_off_addr);
|
| - ASSERT((map_off_addr - key_off_addr) % 4 == 0);
|
| - ASSERT((map_off_addr - key_off_addr) < (256 * 4));
|
| + DCHECK(value_off_addr > key_off_addr);
|
| + DCHECK((value_off_addr - key_off_addr) % 4 == 0);
|
| + DCHECK((value_off_addr - key_off_addr) < (256 * 4));
|
| + DCHECK(map_off_addr > key_off_addr);
|
| + DCHECK((map_off_addr - key_off_addr) % 4 == 0);
|
| + DCHECK((map_off_addr - key_off_addr) < (256 * 4));
|
|
|
| Label miss;
|
| Register base_addr = scratch;
|
| @@ -77,7 +77,7 @@ static void ProbeTable(Isolate* isolate,
|
| // It's a nice optimization if this constant is encodable in the bic insn.
|
|
|
| uint32_t mask = Code::kFlagsNotUsedInLookup;
|
| - ASSERT(__ ImmediateFitsAddrMode1Instruction(mask));
|
| + DCHECK(__ ImmediateFitsAddrMode1Instruction(mask));
|
| __ bic(flags_reg, flags_reg, Operand(mask));
|
| __ cmp(flags_reg, Operand(flags));
|
| __ b(ne, &miss);
|
| @@ -101,8 +101,8 @@ static void ProbeTable(Isolate* isolate,
|
| void PropertyHandlerCompiler::GenerateDictionaryNegativeLookup(
|
| MacroAssembler* masm, Label* miss_label, Register receiver,
|
| Handle<Name> name, Register scratch0, Register scratch1) {
|
| - ASSERT(name->IsUniqueName());
|
| - ASSERT(!receiver.is(scratch0));
|
| + DCHECK(name->IsUniqueName());
|
| + DCHECK(!receiver.is(scratch0));
|
| Counters* counters = masm->isolate()->counters();
|
| __ IncrementCounter(counters->negative_lookups(), 1, scratch0, scratch1);
|
| __ IncrementCounter(counters->negative_lookups_miss(), 1, scratch0, scratch1);
|
| @@ -163,27 +163,27 @@ void StubCache::GenerateProbe(MacroAssembler* masm,
|
|
|
| // Make sure that code is valid. The multiplying code relies on the
|
| // entry size being 12.
|
| - ASSERT(sizeof(Entry) == 12);
|
| + DCHECK(sizeof(Entry) == 12);
|
|
|
| // Make sure the flags does not name a specific type.
|
| - ASSERT(Code::ExtractTypeFromFlags(flags) == 0);
|
| + DCHECK(Code::ExtractTypeFromFlags(flags) == 0);
|
|
|
| // Make sure that there are no register conflicts.
|
| - ASSERT(!scratch.is(receiver));
|
| - ASSERT(!scratch.is(name));
|
| - ASSERT(!extra.is(receiver));
|
| - ASSERT(!extra.is(name));
|
| - ASSERT(!extra.is(scratch));
|
| - ASSERT(!extra2.is(receiver));
|
| - ASSERT(!extra2.is(name));
|
| - ASSERT(!extra2.is(scratch));
|
| - ASSERT(!extra2.is(extra));
|
| + DCHECK(!scratch.is(receiver));
|
| + DCHECK(!scratch.is(name));
|
| + DCHECK(!extra.is(receiver));
|
| + DCHECK(!extra.is(name));
|
| + DCHECK(!extra.is(scratch));
|
| + DCHECK(!extra2.is(receiver));
|
| + DCHECK(!extra2.is(name));
|
| + DCHECK(!extra2.is(scratch));
|
| + DCHECK(!extra2.is(extra));
|
|
|
| // Check scratch, extra and extra2 registers are valid.
|
| - ASSERT(!scratch.is(no_reg));
|
| - ASSERT(!extra.is(no_reg));
|
| - ASSERT(!extra2.is(no_reg));
|
| - ASSERT(!extra3.is(no_reg));
|
| + DCHECK(!scratch.is(no_reg));
|
| + DCHECK(!extra.is(no_reg));
|
| + DCHECK(!extra2.is(no_reg));
|
| + DCHECK(!extra3.is(no_reg));
|
|
|
| Counters* counters = masm->isolate()->counters();
|
| __ IncrementCounter(counters->megamorphic_stub_cache_probes(), 1,
|
| @@ -284,7 +284,7 @@ void PropertyHandlerCompiler::GenerateCheckPropertyCell(
|
| MacroAssembler* masm, Handle<JSGlobalObject> global, Handle<Name> name,
|
| Register scratch, Label* miss) {
|
| Handle<Cell> cell = JSGlobalObject::EnsurePropertyCell(global, name);
|
| - ASSERT(cell->value()->IsTheHole());
|
| + DCHECK(cell->value()->IsTheHole());
|
| __ mov(scratch, Operand(cell));
|
| __ ldr(scratch, FieldMemOperand(scratch, Cell::kValueOffset));
|
| __ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
|
| @@ -303,7 +303,7 @@ static void PushInterceptorArguments(MacroAssembler* masm, Register receiver,
|
| STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 4);
|
| __ push(name);
|
| Handle<InterceptorInfo> interceptor(holder_obj->GetNamedInterceptor());
|
| - ASSERT(!masm->isolate()->heap()->InNewSpace(*interceptor));
|
| + DCHECK(!masm->isolate()->heap()->InNewSpace(*interceptor));
|
| Register scratch = name;
|
| __ mov(scratch, Operand(interceptor));
|
| __ push(scratch);
|
| @@ -326,16 +326,16 @@ void PropertyHandlerCompiler::GenerateFastApiCall(
|
| MacroAssembler* masm, const CallOptimization& optimization,
|
| Handle<Map> receiver_map, Register receiver, Register scratch_in,
|
| bool is_store, int argc, Register* values) {
|
| - ASSERT(!receiver.is(scratch_in));
|
| + DCHECK(!receiver.is(scratch_in));
|
| __ push(receiver);
|
| // Write the arguments to stack frame.
|
| for (int i = 0; i < argc; i++) {
|
| Register arg = values[argc - 1 - i];
|
| - ASSERT(!receiver.is(arg));
|
| - ASSERT(!scratch_in.is(arg));
|
| + DCHECK(!receiver.is(arg));
|
| + DCHECK(!scratch_in.is(arg));
|
| __ push(arg);
|
| }
|
| - ASSERT(optimization.is_simple_api_call());
|
| + DCHECK(optimization.is_simple_api_call());
|
|
|
| // Abi for CallApiFunctionStub.
|
| Register callee = r0;
|
| @@ -426,7 +426,7 @@ void NamedStoreHandlerCompiler::GenerateStoreTransition(
|
| DescriptorArray* descriptors = transition->instance_descriptors();
|
| PropertyDetails details = descriptors->GetDetails(descriptor);
|
| Representation representation = details.representation();
|
| - ASSERT(!representation.IsNone());
|
| + DCHECK(!representation.IsNone());
|
|
|
| if (details.type() == CONSTANT) {
|
| Handle<Object> constant(descriptors->GetValue(descriptor), isolate());
|
| @@ -475,7 +475,7 @@ void NamedStoreHandlerCompiler::GenerateStoreTransition(
|
| }
|
|
|
| // Stub never generated for objects that require access checks.
|
| - ASSERT(!transition->is_access_check_needed());
|
| + DCHECK(!transition->is_access_check_needed());
|
|
|
| // Perform map transition for the receiver if necessary.
|
| if (details.type() == FIELD &&
|
| @@ -507,7 +507,7 @@ void NamedStoreHandlerCompiler::GenerateStoreTransition(
|
| OMIT_SMI_CHECK);
|
|
|
| if (details.type() == CONSTANT) {
|
| - ASSERT(value_reg.is(r0));
|
| + DCHECK(value_reg.is(r0));
|
| __ Ret();
|
| return;
|
| }
|
| @@ -575,7 +575,7 @@ void NamedStoreHandlerCompiler::GenerateStoreTransition(
|
| }
|
|
|
| // Return the value (register r0).
|
| - ASSERT(value_reg.is(r0));
|
| + DCHECK(value_reg.is(r0));
|
| __ bind(&exit);
|
| __ Ret();
|
| }
|
| @@ -593,13 +593,13 @@ void NamedStoreHandlerCompiler::GenerateStoreField(
|
| Label exit;
|
|
|
| // Stub never generated for objects that require access checks.
|
| - ASSERT(!object->IsAccessCheckNeeded());
|
| - ASSERT(!object->IsJSGlobalProxy());
|
| + DCHECK(!object->IsAccessCheckNeeded());
|
| + DCHECK(!object->IsJSGlobalProxy());
|
|
|
| FieldIndex index = lookup->GetFieldIndex();
|
|
|
| Representation representation = lookup->representation();
|
| - ASSERT(!representation.IsNone());
|
| + DCHECK(!representation.IsNone());
|
| if (representation.IsSmi()) {
|
| __ JumpIfNotSmi(value_reg, miss_label);
|
| } else if (representation.IsHeapObject()) {
|
| @@ -646,7 +646,7 @@ void NamedStoreHandlerCompiler::GenerateStoreField(
|
| __ bind(&do_store);
|
| __ vstr(d0, FieldMemOperand(scratch1, HeapNumber::kValueOffset));
|
| // Return the value (register r0).
|
| - ASSERT(value_reg.is(r0));
|
| + DCHECK(value_reg.is(r0));
|
| __ Ret();
|
| return;
|
| }
|
| @@ -700,7 +700,7 @@ void NamedStoreHandlerCompiler::GenerateStoreField(
|
| }
|
|
|
| // Return the value (register r0).
|
| - ASSERT(value_reg.is(r0));
|
| + DCHECK(value_reg.is(r0));
|
| __ bind(&exit);
|
| __ Ret();
|
| }
|
| @@ -713,8 +713,8 @@ Register PropertyHandlerCompiler::CheckPrototypes(
|
| Handle<Map> receiver_map(IC::TypeToMap(*type(), isolate()));
|
|
|
| // Make sure there's no overlap between holder and object registers.
|
| - ASSERT(!scratch1.is(object_reg) && !scratch1.is(holder_reg));
|
| - ASSERT(!scratch2.is(object_reg) && !scratch2.is(holder_reg)
|
| + DCHECK(!scratch1.is(object_reg) && !scratch1.is(holder_reg));
|
| + DCHECK(!scratch2.is(object_reg) && !scratch2.is(holder_reg)
|
| && !scratch2.is(scratch1));
|
|
|
| // Keep track of the current object in register reg.
|
| @@ -735,7 +735,7 @@ Register PropertyHandlerCompiler::CheckPrototypes(
|
|
|
| // Only global objects and objects that do not require access
|
| // checks are allowed in stubs.
|
| - ASSERT(current_map->IsJSGlobalProxyMap() ||
|
| + DCHECK(current_map->IsJSGlobalProxyMap() ||
|
| !current_map->is_access_check_needed());
|
|
|
| prototype = handle(JSObject::cast(current_map->prototype()));
|
| @@ -743,10 +743,10 @@ Register PropertyHandlerCompiler::CheckPrototypes(
|
| !current_map->IsJSGlobalObjectMap() &&
|
| !current_map->IsJSGlobalProxyMap()) {
|
| if (!name->IsUniqueName()) {
|
| - ASSERT(name->IsString());
|
| + DCHECK(name->IsString());
|
| name = factory()->InternalizeString(Handle<String>::cast(name));
|
| }
|
| - ASSERT(current.is_null() ||
|
| + DCHECK(current.is_null() ||
|
| current->property_dictionary()->FindEntry(name) ==
|
| NameDictionary::kNotFound);
|
|
|
| @@ -805,7 +805,7 @@ Register PropertyHandlerCompiler::CheckPrototypes(
|
| }
|
|
|
| // Perform security check for access to the global object.
|
| - ASSERT(current_map->IsJSGlobalProxyMap() ||
|
| + DCHECK(current_map->IsJSGlobalProxyMap() ||
|
| !current_map->is_access_check_needed());
|
| if (current_map->IsJSGlobalProxyMap()) {
|
| __ CheckAccessGlobalProxy(reg, scratch1, miss);
|
| @@ -846,10 +846,10 @@ Register NamedLoadHandlerCompiler::CallbackFrontend(Register object_reg,
|
| Register reg = FrontendHeader(object_reg, name, &miss);
|
|
|
| if (!holder()->HasFastProperties()) {
|
| - ASSERT(!holder()->IsGlobalObject());
|
| - ASSERT(!reg.is(scratch2()));
|
| - ASSERT(!reg.is(scratch3()));
|
| - ASSERT(!reg.is(scratch4()));
|
| + DCHECK(!holder()->IsGlobalObject());
|
| + DCHECK(!reg.is(scratch2()));
|
| + DCHECK(!reg.is(scratch3()));
|
| + DCHECK(!reg.is(scratch4()));
|
|
|
| // Load the properties dictionary.
|
| Register dictionary = scratch4();
|
| @@ -908,9 +908,9 @@ void NamedLoadHandlerCompiler::GenerateLoadCallback(
|
| STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 4);
|
| STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 5);
|
| STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 6);
|
| - ASSERT(!scratch2().is(reg));
|
| - ASSERT(!scratch3().is(reg));
|
| - ASSERT(!scratch4().is(reg));
|
| + DCHECK(!scratch2().is(reg));
|
| + DCHECK(!scratch3().is(reg));
|
| + DCHECK(!scratch4().is(reg));
|
| __ push(receiver());
|
| if (heap()->InNewSpace(callback->data())) {
|
| __ Move(scratch3(), callback);
|
| @@ -946,8 +946,8 @@ void NamedLoadHandlerCompiler::GenerateLoadCallback(
|
| void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg,
|
| LookupResult* lookup,
|
| Handle<Name> name) {
|
| - ASSERT(holder()->HasNamedInterceptor());
|
| - ASSERT(!holder()->GetNamedInterceptor()->getter()->IsUndefined());
|
| + DCHECK(holder()->HasNamedInterceptor());
|
| + DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined());
|
|
|
| // So far the most popular follow ups for interceptor loads are FIELD
|
| // and CALLBACKS, so inline only them, other cases may be added
|
| @@ -971,7 +971,7 @@ void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg,
|
| // Compile the interceptor call, followed by inline code to load the
|
| // property from further up the prototype chain if the call fails.
|
| // Check that the maps haven't changed.
|
| - ASSERT(holder_reg.is(receiver()) || holder_reg.is(scratch1()));
|
| + DCHECK(holder_reg.is(receiver()) || holder_reg.is(scratch1()));
|
|
|
| // Preserve the receiver register explicitly whenever it is different from
|
| // the holder and it is needed should the interceptor return without any
|
| @@ -1128,7 +1128,7 @@ Register* PropertyAccessCompiler::store_calling_convention() {
|
| // receiver, name, scratch1, scratch2, scratch3.
|
| Register receiver = StoreIC::ReceiverRegister();
|
| Register name = StoreIC::NameRegister();
|
| - ASSERT(r3.is(KeyedStoreIC::MapRegister()));
|
| + DCHECK(r3.is(KeyedStoreIC::MapRegister()));
|
| static Register registers[] = { receiver, name, r3, r4, r5 };
|
| return registers;
|
| }
|
| @@ -1234,7 +1234,7 @@ Handle<Code> PropertyICCompiler::CompilePolymorphic(TypeHandleList* types,
|
|
|
| // Polymorphic keyed stores may use the map register
|
| Register map_reg = scratch1();
|
| - ASSERT(kind() != Code::KEYED_STORE_IC ||
|
| + DCHECK(kind() != Code::KEYED_STORE_IC ||
|
| map_reg.is(KeyedStoreIC::MapRegister()));
|
|
|
| int receiver_count = types->length();
|
| @@ -1248,13 +1248,13 @@ Handle<Code> PropertyICCompiler::CompilePolymorphic(TypeHandleList* types,
|
| __ mov(ip, Operand(map));
|
| __ cmp(map_reg, ip);
|
| if (type->Is(HeapType::Number())) {
|
| - ASSERT(!number_case.is_unused());
|
| + DCHECK(!number_case.is_unused());
|
| __ bind(&number_case);
|
| }
|
| __ Jump(handlers->at(current), RelocInfo::CODE_TARGET, eq);
|
| }
|
| }
|
| - ASSERT(number_of_handled_maps != 0);
|
| + DCHECK(number_of_handled_maps != 0);
|
|
|
| __ bind(&miss);
|
| TailCallBuiltin(masm(), MissBuiltin(kind()));
|
| @@ -1307,8 +1307,8 @@ void ElementHandlerCompiler::GenerateLoadDictionaryElement(
|
|
|
| Register key = LoadIC::NameRegister();
|
| Register receiver = LoadIC::ReceiverRegister();
|
| - ASSERT(receiver.is(r1));
|
| - ASSERT(key.is(r2));
|
| + DCHECK(receiver.is(r1));
|
| + DCHECK(key.is(r2));
|
|
|
| __ UntagAndJumpIfNotSmi(r6, key, &miss);
|
| __ ldr(r4, FieldMemOperand(receiver, JSObject::kElementsOffset));
|
|
|