| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 Condition cond) { | 67 Condition cond) { |
| 68 ASSERT(!RelocInfo::IsCodeTarget(rmode)); | 68 ASSERT(!RelocInfo::IsCodeTarget(rmode)); |
| 69 Jump(reinterpret_cast<intptr_t>(target), rmode, cond); | 69 Jump(reinterpret_cast<intptr_t>(target), rmode, cond); |
| 70 } | 70 } |
| 71 | 71 |
| 72 | 72 |
| 73 void MacroAssembler::Jump(Handle<Code> code, RelocInfo::Mode rmode, | 73 void MacroAssembler::Jump(Handle<Code> code, RelocInfo::Mode rmode, |
| 74 Condition cond) { | 74 Condition cond) { |
| 75 ASSERT(RelocInfo::IsCodeTarget(rmode)); | 75 ASSERT(RelocInfo::IsCodeTarget(rmode)); |
| 76 // 'code' is always generated ARM code, never THUMB code | 76 // 'code' is always generated ARM code, never THUMB code |
| 77 ALLOW_HANDLE_DEREF(isolate(), "embedding raw address"); | 77 AllowDeferredHandleDereference embedding_raw_address; |
| 78 Jump(reinterpret_cast<intptr_t>(code.location()), rmode, cond); | 78 Jump(reinterpret_cast<intptr_t>(code.location()), rmode, cond); |
| 79 } | 79 } |
| 80 | 80 |
| 81 | 81 |
| 82 int MacroAssembler::CallSize(Register target, Condition cond) { | 82 int MacroAssembler::CallSize(Register target, Condition cond) { |
| 83 return kInstrSize; | 83 return kInstrSize; |
| 84 } | 84 } |
| 85 | 85 |
| 86 | 86 |
| 87 void MacroAssembler::Call(Register target, Condition cond) { | 87 void MacroAssembler::Call(Register target, Condition cond) { |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 if (mode == NEVER_INLINE_TARGET_ADDRESS) { | 156 if (mode == NEVER_INLINE_TARGET_ADDRESS) { |
| 157 set_predictable_code_size(old_predictable_code_size); | 157 set_predictable_code_size(old_predictable_code_size); |
| 158 } | 158 } |
| 159 } | 159 } |
| 160 | 160 |
| 161 | 161 |
| 162 int MacroAssembler::CallSize(Handle<Code> code, | 162 int MacroAssembler::CallSize(Handle<Code> code, |
| 163 RelocInfo::Mode rmode, | 163 RelocInfo::Mode rmode, |
| 164 TypeFeedbackId ast_id, | 164 TypeFeedbackId ast_id, |
| 165 Condition cond) { | 165 Condition cond) { |
| 166 ALLOW_HANDLE_DEREF(isolate(), "using raw address"); | 166 AllowDeferredHandleDereference using_raw_address; |
| 167 return CallSize(reinterpret_cast<Address>(code.location()), rmode, cond); | 167 return CallSize(reinterpret_cast<Address>(code.location()), rmode, cond); |
| 168 } | 168 } |
| 169 | 169 |
| 170 | 170 |
| 171 void MacroAssembler::Call(Handle<Code> code, | 171 void MacroAssembler::Call(Handle<Code> code, |
| 172 RelocInfo::Mode rmode, | 172 RelocInfo::Mode rmode, |
| 173 TypeFeedbackId ast_id, | 173 TypeFeedbackId ast_id, |
| 174 Condition cond, | 174 Condition cond, |
| 175 TargetAddressStorageMode mode) { | 175 TargetAddressStorageMode mode) { |
| 176 Label start; | 176 Label start; |
| 177 bind(&start); | 177 bind(&start); |
| 178 ASSERT(RelocInfo::IsCodeTarget(rmode)); | 178 ASSERT(RelocInfo::IsCodeTarget(rmode)); |
| 179 if (rmode == RelocInfo::CODE_TARGET && !ast_id.IsNone()) { | 179 if (rmode == RelocInfo::CODE_TARGET && !ast_id.IsNone()) { |
| 180 SetRecordedAstId(ast_id); | 180 SetRecordedAstId(ast_id); |
| 181 rmode = RelocInfo::CODE_TARGET_WITH_ID; | 181 rmode = RelocInfo::CODE_TARGET_WITH_ID; |
| 182 } | 182 } |
| 183 // 'code' is always generated ARM code, never THUMB code | 183 // 'code' is always generated ARM code, never THUMB code |
| 184 ALLOW_HANDLE_DEREF(isolate(), "embedding raw address"); | 184 AllowDeferredHandleDereference embedding_raw_address; |
| 185 Call(reinterpret_cast<Address>(code.location()), rmode, cond, mode); | 185 Call(reinterpret_cast<Address>(code.location()), rmode, cond, mode); |
| 186 } | 186 } |
| 187 | 187 |
| 188 | 188 |
| 189 void MacroAssembler::Ret(Condition cond) { | 189 void MacroAssembler::Ret(Condition cond) { |
| 190 bx(lr, cond); | 190 bx(lr, cond); |
| 191 } | 191 } |
| 192 | 192 |
| 193 | 193 |
| 194 void MacroAssembler::Drop(int count, Condition cond) { | 194 void MacroAssembler::Drop(int count, Condition cond) { |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 | 391 |
| 392 void MacroAssembler::StoreRoot(Register source, | 392 void MacroAssembler::StoreRoot(Register source, |
| 393 Heap::RootListIndex index, | 393 Heap::RootListIndex index, |
| 394 Condition cond) { | 394 Condition cond) { |
| 395 str(source, MemOperand(kRootRegister, index << kPointerSizeLog2), cond); | 395 str(source, MemOperand(kRootRegister, index << kPointerSizeLog2), cond); |
| 396 } | 396 } |
| 397 | 397 |
| 398 | 398 |
| 399 void MacroAssembler::LoadHeapObject(Register result, | 399 void MacroAssembler::LoadHeapObject(Register result, |
| 400 Handle<HeapObject> object) { | 400 Handle<HeapObject> object) { |
| 401 ALLOW_HANDLE_DEREF(isolate(), "using raw address"); | 401 AllowDeferredHandleDereference using_raw_address; |
| 402 if (isolate()->heap()->InNewSpace(*object)) { | 402 if (isolate()->heap()->InNewSpace(*object)) { |
| 403 Handle<JSGlobalPropertyCell> cell = | 403 Handle<JSGlobalPropertyCell> cell = |
| 404 isolate()->factory()->NewJSGlobalPropertyCell(object); | 404 isolate()->factory()->NewJSGlobalPropertyCell(object); |
| 405 mov(result, Operand(cell)); | 405 mov(result, Operand(cell)); |
| 406 ldr(result, FieldMemOperand(result, JSGlobalPropertyCell::kValueOffset)); | 406 ldr(result, FieldMemOperand(result, JSGlobalPropertyCell::kValueOffset)); |
| 407 } else { | 407 } else { |
| 408 mov(result, Operand(object)); | 408 mov(result, Operand(object)); |
| 409 } | 409 } |
| 410 } | 410 } |
| 411 | 411 |
| (...skipping 3382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3794 void CodePatcher::EmitCondition(Condition cond) { | 3794 void CodePatcher::EmitCondition(Condition cond) { |
| 3795 Instr instr = Assembler::instr_at(masm_.pc_); | 3795 Instr instr = Assembler::instr_at(masm_.pc_); |
| 3796 instr = (instr & ~kCondMask) | cond; | 3796 instr = (instr & ~kCondMask) | cond; |
| 3797 masm_.emit(instr); | 3797 masm_.emit(instr); |
| 3798 } | 3798 } |
| 3799 | 3799 |
| 3800 | 3800 |
| 3801 } } // namespace v8::internal | 3801 } } // namespace v8::internal |
| 3802 | 3802 |
| 3803 #endif // V8_TARGET_ARCH_ARM | 3803 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |