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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 bind(&done); | 415 bind(&done); |
416 } else { | 416 } else { |
417 usat(dst, satpos, src, cond); | 417 usat(dst, satpos, src, cond); |
418 } | 418 } |
419 } | 419 } |
420 | 420 |
421 | 421 |
422 void MacroAssembler::LoadRoot(Register destination, | 422 void MacroAssembler::LoadRoot(Register destination, |
423 Heap::RootListIndex index, | 423 Heap::RootListIndex index, |
424 Condition cond) { | 424 Condition cond) { |
| 425 if (CpuFeatures::IsSupported(MOVW_MOVT_IMMEDIATE_LOADS) && |
| 426 !Heap::RootCanBeWrittenAfterInitialization(index)) { |
| 427 Handle<Object> root(isolate()->heap()->roots_array_start()[index]); |
| 428 if (!isolate()->heap()->InNewSpace(*root)) { |
| 429 // The CPU supports fast immediate values, and this root will never |
| 430 // change. We will load it as a relocatable immediate value. |
| 431 mov(destination, Operand(root), LeaveCC, cond); |
| 432 return; |
| 433 } |
| 434 } |
425 ldr(destination, MemOperand(kRootRegister, index << kPointerSizeLog2), cond); | 435 ldr(destination, MemOperand(kRootRegister, index << kPointerSizeLog2), cond); |
426 } | 436 } |
427 | 437 |
428 | 438 |
429 void MacroAssembler::StoreRoot(Register source, | 439 void MacroAssembler::StoreRoot(Register source, |
430 Heap::RootListIndex index, | 440 Heap::RootListIndex index, |
431 Condition cond) { | 441 Condition cond) { |
432 str(source, MemOperand(kRootRegister, index << kPointerSizeLog2), cond); | 442 str(source, MemOperand(kRootRegister, index << kPointerSizeLog2), cond); |
433 } | 443 } |
434 | 444 |
(...skipping 3432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3867 void CodePatcher::EmitCondition(Condition cond) { | 3877 void CodePatcher::EmitCondition(Condition cond) { |
3868 Instr instr = Assembler::instr_at(masm_.pc_); | 3878 Instr instr = Assembler::instr_at(masm_.pc_); |
3869 instr = (instr & ~kCondMask) | cond; | 3879 instr = (instr & ~kCondMask) | cond; |
3870 masm_.emit(instr); | 3880 masm_.emit(instr); |
3871 } | 3881 } |
3872 | 3882 |
3873 | 3883 |
3874 } } // namespace v8::internal | 3884 } } // namespace v8::internal |
3875 | 3885 |
3876 #endif // V8_TARGET_ARCH_ARM | 3886 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |