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

Side by Side Diff: src/arm/macro-assembler-arm.cc

Issue 35413006: Correct handling of arrays with callbacks in the prototype chain. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: ports. Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 3910 matching lines...) Expand 10 before | Expand all | Expand 10 after
3921 for (int i = 0; i < Register::NumAllocatableRegisters(); i++) { 3921 for (int i = 0; i < Register::NumAllocatableRegisters(); i++) {
3922 Register candidate = Register::FromAllocationIndex(i); 3922 Register candidate = Register::FromAllocationIndex(i);
3923 if (regs & candidate.bit()) continue; 3923 if (regs & candidate.bit()) continue;
3924 return candidate; 3924 return candidate;
3925 } 3925 }
3926 UNREACHABLE(); 3926 UNREACHABLE();
3927 return no_reg; 3927 return no_reg;
3928 } 3928 }
3929 3929
3930 3930
3931 void MacroAssembler::HasDictionaryInPrototypeChain(
3932 Register object,
3933 Register elements,
3934 Register scratch,
3935 Label* found) {
3936 Factory* factory = isolate()->factory();
3937 Register temp = elements;
3938 Label loop_again;
3939
3940 // scratch contained elements pointer.
3941 mov(temp, object);
3942
3943 // Loop based on the map going up the prototype chain.
3944 bind(&loop_again);
3945 ldr(temp, FieldMemOperand(temp, HeapObject::kMapOffset));
3946 ldr(scratch, FieldMemOperand(temp, Map::kBitField2Offset));
3947 Ubfx(scratch, scratch, Map::kElementsKindShift, Map::kElementsKindBitCount);
3948 cmp(scratch, Operand(DICTIONARY_ELEMENTS));
3949 b(eq, found);
3950 ldr(temp, FieldMemOperand(temp, Map::kPrototypeOffset));
3951 cmp(temp, Operand(factory->null_value()));
3952 b(ne, &loop_again);
3953
3954 // Restore elements
3955 ldr(elements, FieldMemOperand(object, JSObject::kElementsOffset));
3956 }
3957
3958
3931 #ifdef DEBUG 3959 #ifdef DEBUG
3932 bool AreAliased(Register reg1, 3960 bool AreAliased(Register reg1,
3933 Register reg2, 3961 Register reg2,
3934 Register reg3, 3962 Register reg3,
3935 Register reg4, 3963 Register reg4,
3936 Register reg5, 3964 Register reg5,
3937 Register reg6) { 3965 Register reg6) {
3938 int n_of_valid_regs = reg1.is_valid() + reg2.is_valid() + 3966 int n_of_valid_regs = reg1.is_valid() + reg2.is_valid() +
3939 reg3.is_valid() + reg4.is_valid() + reg5.is_valid() + reg6.is_valid(); 3967 reg3.is_valid() + reg4.is_valid() + reg5.is_valid() + reg6.is_valid();
3940 3968
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
3991 void CodePatcher::EmitCondition(Condition cond) { 4019 void CodePatcher::EmitCondition(Condition cond) {
3992 Instr instr = Assembler::instr_at(masm_.pc_); 4020 Instr instr = Assembler::instr_at(masm_.pc_);
3993 instr = (instr & ~kCondMask) | cond; 4021 instr = (instr & ~kCondMask) | cond;
3994 masm_.emit(instr); 4022 masm_.emit(instr);
3995 } 4023 }
3996 4024
3997 4025
3998 } } // namespace v8::internal 4026 } } // namespace v8::internal
3999 4027
4000 #endif // V8_TARGET_ARCH_ARM 4028 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/macro-assembler-arm.h ('k') | src/heap.h » ('j') | src/heap.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698