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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 movq(kScratchRegister, | 418 movq(kScratchRegister, |
419 reinterpret_cast<intptr_t>(Smi::FromInt(static_cast<int>(p1 - p0))), | 419 reinterpret_cast<intptr_t>(Smi::FromInt(static_cast<int>(p1 - p0))), |
420 RelocInfo::NONE); | 420 RelocInfo::NONE); |
421 push(kScratchRegister); | 421 push(kScratchRegister); |
422 CallRuntime(Runtime::kAbort, 2); | 422 CallRuntime(Runtime::kAbort, 2); |
423 // will not return here | 423 // will not return here |
424 int3(); | 424 int3(); |
425 } | 425 } |
426 | 426 |
427 | 427 |
428 void MacroAssembler::CallStub(CodeStub* stub) { | 428 void MacroAssembler::CallStub(CodeStub* stub, unsigned ast_id) { |
429 ASSERT(allow_stub_calls()); // calls are not allowed in some stubs | 429 ASSERT(allow_stub_calls()); // calls are not allowed in some stubs |
430 Call(stub->GetCode(), RelocInfo::CODE_TARGET); | 430 Call(stub->GetCode(), RelocInfo::CODE_TARGET, ast_id); |
431 } | 431 } |
432 | 432 |
433 | 433 |
434 MaybeObject* MacroAssembler::TryCallStub(CodeStub* stub) { | 434 MaybeObject* MacroAssembler::TryCallStub(CodeStub* stub) { |
435 ASSERT(allow_stub_calls()); // Calls are not allowed in some stubs. | 435 ASSERT(allow_stub_calls()); // Calls are not allowed in some stubs. |
436 MaybeObject* result = stub->TryGetCode(); | 436 MaybeObject* result = stub->TryGetCode(); |
437 if (!result->IsFailure()) { | 437 if (!result->IsFailure()) { |
438 call(Handle<Code>(Code::cast(result->ToObjectUnchecked())), | 438 call(Handle<Code>(Code::cast(result->ToObjectUnchecked())), |
439 RelocInfo::CODE_TARGET); | 439 RelocInfo::CODE_TARGET); |
440 } | 440 } |
(...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1603 int end_position = pc_offset() + CallSize(destination, rmode); | 1603 int end_position = pc_offset() + CallSize(destination, rmode); |
1604 #endif | 1604 #endif |
1605 movq(kScratchRegister, destination, rmode); | 1605 movq(kScratchRegister, destination, rmode); |
1606 call(kScratchRegister); | 1606 call(kScratchRegister); |
1607 #ifdef DEBUG | 1607 #ifdef DEBUG |
1608 CHECK_EQ(pc_offset(), end_position); | 1608 CHECK_EQ(pc_offset(), end_position); |
1609 #endif | 1609 #endif |
1610 } | 1610 } |
1611 | 1611 |
1612 | 1612 |
1613 void MacroAssembler::Call(Handle<Code> code_object, RelocInfo::Mode rmode) { | 1613 void MacroAssembler::Call(Handle<Code> code_object, |
| 1614 RelocInfo::Mode rmode, |
| 1615 unsigned ast_id) { |
1614 #ifdef DEBUG | 1616 #ifdef DEBUG |
1615 int end_position = pc_offset() + CallSize(code_object); | 1617 int end_position = pc_offset() + CallSize(code_object); |
1616 #endif | 1618 #endif |
1617 ASSERT(RelocInfo::IsCodeTarget(rmode)); | 1619 ASSERT(RelocInfo::IsCodeTarget(rmode)); |
1618 call(code_object, rmode); | 1620 call(code_object, rmode, ast_id); |
1619 #ifdef DEBUG | 1621 #ifdef DEBUG |
1620 CHECK_EQ(end_position, pc_offset()); | 1622 CHECK_EQ(end_position, pc_offset()); |
1621 #endif | 1623 #endif |
1622 } | 1624 } |
1623 | 1625 |
1624 | 1626 |
1625 void MacroAssembler::Pushad() { | 1627 void MacroAssembler::Pushad() { |
1626 push(rax); | 1628 push(rax); |
1627 push(rcx); | 1629 push(rcx); |
1628 push(rdx); | 1630 push(rdx); |
(...skipping 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2910 CPU::FlushICache(address_, size_); | 2912 CPU::FlushICache(address_, size_); |
2911 | 2913 |
2912 // Check that the code was patched as expected. | 2914 // Check that the code was patched as expected. |
2913 ASSERT(masm_.pc_ == address_ + size_); | 2915 ASSERT(masm_.pc_ == address_ + size_); |
2914 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 2916 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
2915 } | 2917 } |
2916 | 2918 |
2917 } } // namespace v8::internal | 2919 } } // namespace v8::internal |
2918 | 2920 |
2919 #endif // V8_TARGET_ARCH_X64 | 2921 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |