| 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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 } else { | 368 } else { |
| 369 usat(dst, satpos, src, cond); | 369 usat(dst, satpos, src, cond); |
| 370 } | 370 } |
| 371 } | 371 } |
| 372 | 372 |
| 373 | 373 |
| 374 void MacroAssembler::LoadRoot(Register destination, | 374 void MacroAssembler::LoadRoot(Register destination, |
| 375 Heap::RootListIndex index, | 375 Heap::RootListIndex index, |
| 376 Condition cond) { | 376 Condition cond) { |
| 377 if (CpuFeatures::IsSupported(MOVW_MOVT_IMMEDIATE_LOADS) && | 377 if (CpuFeatures::IsSupported(MOVW_MOVT_IMMEDIATE_LOADS) && |
| 378 !Heap::RootCanBeWrittenAfterInitialization(index) && | 378 isolate()->heap()->RootCanBeTreatedAsConstant(index) && |
| 379 !predictable_code_size()) { | 379 !predictable_code_size()) { |
| 380 Handle<Object> root(isolate()->heap()->roots_array_start()[index], | 380 // The CPU supports fast immediate values, and this root will never |
| 381 isolate()); | 381 // change. We will load it as a relocatable immediate value. |
| 382 if (!isolate()->heap()->InNewSpace(*root)) { | 382 Handle<Object> root(&isolate()->heap()->roots_array_start()[index]); |
| 383 // The CPU supports fast immediate values, and this root will never | 383 mov(destination, Operand(root), LeaveCC, cond); |
| 384 // change. We will load it as a relocatable immediate value. | 384 return; |
| 385 mov(destination, Operand(root), LeaveCC, cond); | |
| 386 return; | |
| 387 } | |
| 388 } | 385 } |
| 389 ldr(destination, MemOperand(kRootRegister, index << kPointerSizeLog2), cond); | 386 ldr(destination, MemOperand(kRootRegister, index << kPointerSizeLog2), cond); |
| 390 } | 387 } |
| 391 | 388 |
| 392 | 389 |
| 393 void MacroAssembler::StoreRoot(Register source, | 390 void MacroAssembler::StoreRoot(Register source, |
| 394 Heap::RootListIndex index, | 391 Heap::RootListIndex index, |
| 395 Condition cond) { | 392 Condition cond) { |
| 396 str(source, MemOperand(kRootRegister, index << kPointerSizeLog2), cond); | 393 str(source, MemOperand(kRootRegister, index << kPointerSizeLog2), cond); |
| 397 } | 394 } |
| (...skipping 3479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3877 void CodePatcher::EmitCondition(Condition cond) { | 3874 void CodePatcher::EmitCondition(Condition cond) { |
| 3878 Instr instr = Assembler::instr_at(masm_.pc_); | 3875 Instr instr = Assembler::instr_at(masm_.pc_); |
| 3879 instr = (instr & ~kCondMask) | cond; | 3876 instr = (instr & ~kCondMask) | cond; |
| 3880 masm_.emit(instr); | 3877 masm_.emit(instr); |
| 3881 } | 3878 } |
| 3882 | 3879 |
| 3883 | 3880 |
| 3884 } } // namespace v8::internal | 3881 } } // namespace v8::internal |
| 3885 | 3882 |
| 3886 #endif // V8_TARGET_ARCH_ARM | 3883 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |