| OLD | NEW |
| 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 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 LinkRegisterStatus lr_status, | 509 LinkRegisterStatus lr_status, |
| 510 SaveFPRegsMode fp_mode, | 510 SaveFPRegsMode fp_mode, |
| 511 RememberedSetAction remembered_set_action, | 511 RememberedSetAction remembered_set_action, |
| 512 SmiCheck smi_check) { | 512 SmiCheck smi_check) { |
| 513 if (emit_debug_code()) { | 513 if (emit_debug_code()) { |
| 514 ldr(ip, MemOperand(address)); | 514 ldr(ip, MemOperand(address)); |
| 515 cmp(ip, value); | 515 cmp(ip, value); |
| 516 Check(eq, kWrongAddressOrValuePassedToRecordWrite); | 516 Check(eq, kWrongAddressOrValuePassedToRecordWrite); |
| 517 } | 517 } |
| 518 | 518 |
| 519 // Count number of write barriers in generated code. |
| 520 isolate()->counters()->write_barriers_static()->Increment(); |
| 521 // TODO(mstarzinger): Dynamic counter missing. |
| 522 |
| 523 // First, check if a write barrier is even needed. The tests below |
| 524 // catch stores of smis and stores into the young generation. |
| 519 Label done; | 525 Label done; |
| 520 | 526 |
| 521 if (smi_check == INLINE_SMI_CHECK) { | 527 if (smi_check == INLINE_SMI_CHECK) { |
| 522 JumpIfSmi(value, &done); | 528 JumpIfSmi(value, &done); |
| 523 } | 529 } |
| 524 | 530 |
| 525 CheckPageFlag(value, | 531 CheckPageFlag(value, |
| 526 value, // Used as scratch. | 532 value, // Used as scratch. |
| 527 MemoryChunk::kPointersToHereAreInterestingMask, | 533 MemoryChunk::kPointersToHereAreInterestingMask, |
| 528 eq, | 534 eq, |
| (...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2009 Heap::kSlicedAsciiStringMapRootIndex, | 2015 Heap::kSlicedAsciiStringMapRootIndex, |
| 2010 scratch1, | 2016 scratch1, |
| 2011 scratch2); | 2017 scratch2); |
| 2012 } | 2018 } |
| 2013 | 2019 |
| 2014 | 2020 |
| 2015 void MacroAssembler::CompareObjectType(Register object, | 2021 void MacroAssembler::CompareObjectType(Register object, |
| 2016 Register map, | 2022 Register map, |
| 2017 Register type_reg, | 2023 Register type_reg, |
| 2018 InstanceType type) { | 2024 InstanceType type) { |
| 2025 const Register temp = type_reg.is(no_reg) ? ip : type_reg; |
| 2026 |
| 2019 ldr(map, FieldMemOperand(object, HeapObject::kMapOffset)); | 2027 ldr(map, FieldMemOperand(object, HeapObject::kMapOffset)); |
| 2020 CompareInstanceType(map, type_reg, type); | 2028 CompareInstanceType(map, temp, type); |
| 2029 } |
| 2030 |
| 2031 |
| 2032 void MacroAssembler::CheckObjectTypeRange(Register object, |
| 2033 Register map, |
| 2034 InstanceType min_type, |
| 2035 InstanceType max_type, |
| 2036 Label* false_label) { |
| 2037 STATIC_ASSERT(Map::kInstanceTypeOffset < 4096); |
| 2038 STATIC_ASSERT(LAST_TYPE < 256); |
| 2039 ldr(map, FieldMemOperand(object, HeapObject::kMapOffset)); |
| 2040 ldrb(ip, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
| 2041 sub(ip, ip, Operand(min_type)); |
| 2042 cmp(ip, Operand(max_type - min_type)); |
| 2043 b(hi, false_label); |
| 2021 } | 2044 } |
| 2022 | 2045 |
| 2023 | 2046 |
| 2024 void MacroAssembler::CompareInstanceType(Register map, | 2047 void MacroAssembler::CompareInstanceType(Register map, |
| 2025 Register type_reg, | 2048 Register type_reg, |
| 2026 InstanceType type) { | 2049 InstanceType type) { |
| 2050 // Registers map and type_reg can be ip. These two lines assert |
| 2051 // that ip can be used with the two instructions (the constants |
| 2052 // will never need ip). |
| 2053 STATIC_ASSERT(Map::kInstanceTypeOffset < 4096); |
| 2054 STATIC_ASSERT(LAST_TYPE < 256); |
| 2027 ldrb(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset)); | 2055 ldrb(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
| 2028 cmp(type_reg, Operand(type)); | 2056 cmp(type_reg, Operand(type)); |
| 2029 } | 2057 } |
| 2030 | 2058 |
| 2031 | 2059 |
| 2032 void MacroAssembler::CompareRoot(Register obj, | 2060 void MacroAssembler::CompareRoot(Register obj, |
| 2033 Heap::RootListIndex index) { | 2061 Heap::RootListIndex index) { |
| 2034 ASSERT(!obj.is(ip)); | 2062 ASSERT(!obj.is(ip)); |
| 2035 LoadRoot(ip, index); | 2063 LoadRoot(ip, index); |
| 2036 cmp(obj, ip); | 2064 cmp(obj, ip); |
| (...skipping 2013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4050 void CodePatcher::EmitCondition(Condition cond) { | 4078 void CodePatcher::EmitCondition(Condition cond) { |
| 4051 Instr instr = Assembler::instr_at(masm_.pc_); | 4079 Instr instr = Assembler::instr_at(masm_.pc_); |
| 4052 instr = (instr & ~kCondMask) | cond; | 4080 instr = (instr & ~kCondMask) | cond; |
| 4053 masm_.emit(instr); | 4081 masm_.emit(instr); |
| 4054 } | 4082 } |
| 4055 | 4083 |
| 4056 | 4084 |
| 4057 } } // namespace v8::internal | 4085 } } // namespace v8::internal |
| 4058 | 4086 |
| 4059 #endif // V8_TARGET_ARCH_ARM | 4087 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |