| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 | 185 |
| 186 | 186 |
| 187 void MacroAssembler::Call(Handle<Code> code, | 187 void MacroAssembler::Call(Handle<Code> code, |
| 188 RelocInfo::Mode rmode, | 188 RelocInfo::Mode rmode, |
| 189 unsigned ast_id, | 189 unsigned ast_id, |
| 190 Condition cond) { | 190 Condition cond) { |
| 191 Label start; | 191 Label start; |
| 192 bind(&start); | 192 bind(&start); |
| 193 ASSERT(RelocInfo::IsCodeTarget(rmode)); | 193 ASSERT(RelocInfo::IsCodeTarget(rmode)); |
| 194 if (rmode == RelocInfo::CODE_TARGET && ast_id != kNoASTId) { | 194 if (rmode == RelocInfo::CODE_TARGET && ast_id != kNoASTId) { |
| 195 ASSERT(ast_id_for_reloc_info_ == kNoASTId); | 195 SetRecordedAstId(ast_id); |
| 196 ast_id_for_reloc_info_ = ast_id; | |
| 197 rmode = RelocInfo::CODE_TARGET_WITH_ID; | 196 rmode = RelocInfo::CODE_TARGET_WITH_ID; |
| 198 } | 197 } |
| 199 // 'code' is always generated ARM code, never THUMB code | 198 // 'code' is always generated ARM code, never THUMB code |
| 200 Call(reinterpret_cast<Address>(code.location()), rmode, cond); | 199 Call(reinterpret_cast<Address>(code.location()), rmode, cond); |
| 201 ASSERT_EQ(CallSize(code, rmode, cond), SizeOfCodeGeneratedSince(&start)); | 200 ASSERT_EQ(CallSize(code, rmode, ast_id, cond), |
| 201 SizeOfCodeGeneratedSince(&start)); |
| 202 } | 202 } |
| 203 | 203 |
| 204 | 204 |
| 205 void MacroAssembler::Ret(Condition cond) { | 205 void MacroAssembler::Ret(Condition cond) { |
| 206 #if USE_BX | 206 #if USE_BX |
| 207 bx(lr, cond); | 207 bx(lr, cond); |
| 208 #else | 208 #else |
| 209 mov(pc, Operand(lr), LeaveCC, cond); | 209 mov(pc, Operand(lr), LeaveCC, cond); |
| 210 #endif | 210 #endif |
| 211 } | 211 } |
| (...skipping 1689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1901 ldr(result, FieldMemOperand(result, Map::kConstructorOffset)); | 1901 ldr(result, FieldMemOperand(result, Map::kConstructorOffset)); |
| 1902 | 1902 |
| 1903 // All done. | 1903 // All done. |
| 1904 bind(&done); | 1904 bind(&done); |
| 1905 } | 1905 } |
| 1906 | 1906 |
| 1907 | 1907 |
| 1908 void MacroAssembler::CallStub(CodeStub* stub, Condition cond) { | 1908 void MacroAssembler::CallStub(CodeStub* stub, Condition cond) { |
| 1909 // TODO(gc): Fix this! | 1909 // TODO(gc): Fix this! |
| 1910 // ASSERT(allow_stub_calls()); // Stub calls are not allowed in some stubs. | 1910 // ASSERT(allow_stub_calls()); // Stub calls are not allowed in some stubs. |
| 1911 Call(stub->GetCode(), RelocInfo::CODE_TARGET, cond); | 1911 Call(stub->GetCode(), RelocInfo::CODE_TARGET, kNoASTId, cond); |
| 1912 } | 1912 } |
| 1913 | 1913 |
| 1914 | 1914 |
| 1915 MaybeObject* MacroAssembler::TryCallStub(CodeStub* stub, Condition cond) { | 1915 MaybeObject* MacroAssembler::TryCallStub(CodeStub* stub, Condition cond) { |
| 1916 ASSERT(allow_stub_calls()); // Stub calls are not allowed in some stubs. | 1916 ASSERT(allow_stub_calls()); // Stub calls are not allowed in some stubs. |
| 1917 Object* result; | 1917 Object* result; |
| 1918 { MaybeObject* maybe_result = stub->TryGetCode(); | 1918 { MaybeObject* maybe_result = stub->TryGetCode(); |
| 1919 if (!maybe_result->ToObject(&result)) return maybe_result; | 1919 if (!maybe_result->ToObject(&result)) return maybe_result; |
| 1920 } | 1920 } |
| 1921 Call(Handle<Code>(Code::cast(result)), RelocInfo::CODE_TARGET, cond); | 1921 Handle<Code> code(Code::cast(result)); |
| 1922 Call(code, RelocInfo::CODE_TARGET, kNoASTId, cond); |
| 1922 return result; | 1923 return result; |
| 1923 } | 1924 } |
| 1924 | 1925 |
| 1925 | 1926 |
| 1926 void MacroAssembler::TailCallStub(CodeStub* stub, Condition cond) { | 1927 void MacroAssembler::TailCallStub(CodeStub* stub, Condition cond) { |
| 1927 ASSERT(allow_stub_calls()); // Stub calls are not allowed in some stubs. | 1928 ASSERT(allow_stub_calls()); // Stub calls are not allowed in some stubs. |
| 1928 Jump(stub->GetCode(), RelocInfo::CODE_TARGET, cond); | 1929 Jump(stub->GetCode(), RelocInfo::CODE_TARGET, cond); |
| 1929 } | 1930 } |
| 1930 | 1931 |
| 1931 | 1932 |
| (...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2586 | 2587 |
| 2587 void MacroAssembler::AssertFastElements(Register elements) { | 2588 void MacroAssembler::AssertFastElements(Register elements) { |
| 2588 if (emit_debug_code()) { | 2589 if (emit_debug_code()) { |
| 2589 ASSERT(!elements.is(ip)); | 2590 ASSERT(!elements.is(ip)); |
| 2590 Label ok; | 2591 Label ok; |
| 2591 push(elements); | 2592 push(elements); |
| 2592 ldr(elements, FieldMemOperand(elements, HeapObject::kMapOffset)); | 2593 ldr(elements, FieldMemOperand(elements, HeapObject::kMapOffset)); |
| 2593 LoadRoot(ip, Heap::kFixedArrayMapRootIndex); | 2594 LoadRoot(ip, Heap::kFixedArrayMapRootIndex); |
| 2594 cmp(elements, ip); | 2595 cmp(elements, ip); |
| 2595 b(eq, &ok); | 2596 b(eq, &ok); |
| 2597 LoadRoot(ip, Heap::kFixedDoubleArrayMapRootIndex); |
| 2598 cmp(elements, ip); |
| 2599 b(eq, &ok); |
| 2596 LoadRoot(ip, Heap::kFixedCOWArrayMapRootIndex); | 2600 LoadRoot(ip, Heap::kFixedCOWArrayMapRootIndex); |
| 2597 cmp(elements, ip); | 2601 cmp(elements, ip); |
| 2598 b(eq, &ok); | 2602 b(eq, &ok); |
| 2599 Abort("JSObject with fast elements map has slow elements"); | 2603 Abort("JSObject with fast elements map has slow elements"); |
| 2600 bind(&ok); | 2604 bind(&ok); |
| 2601 pop(elements); | 2605 pop(elements); |
| 2602 } | 2606 } |
| 2603 } | 2607 } |
| 2604 | 2608 |
| 2605 | 2609 |
| (...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3373 void CodePatcher::EmitCondition(Condition cond) { | 3377 void CodePatcher::EmitCondition(Condition cond) { |
| 3374 Instr instr = Assembler::instr_at(masm_.pc_); | 3378 Instr instr = Assembler::instr_at(masm_.pc_); |
| 3375 instr = (instr & ~kCondMask) | cond; | 3379 instr = (instr & ~kCondMask) | cond; |
| 3376 masm_.emit(instr); | 3380 masm_.emit(instr); |
| 3377 } | 3381 } |
| 3378 | 3382 |
| 3379 | 3383 |
| 3380 } } // namespace v8::internal | 3384 } } // namespace v8::internal |
| 3381 | 3385 |
| 3382 #endif // V8_TARGET_ARCH_ARM | 3386 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |