| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1008 // in initial map. | 1008 // in initial map. |
| 1009 bind(&non_instance); | 1009 bind(&non_instance); |
| 1010 mov(result, FieldOperand(result, Map::kConstructorOffset)); | 1010 mov(result, FieldOperand(result, Map::kConstructorOffset)); |
| 1011 | 1011 |
| 1012 // All done. | 1012 // All done. |
| 1013 bind(&done); | 1013 bind(&done); |
| 1014 } | 1014 } |
| 1015 | 1015 |
| 1016 | 1016 |
| 1017 void MacroAssembler::CallStub(CodeStub* stub) { | 1017 void MacroAssembler::CallStub(CodeStub* stub) { |
| 1018 ASSERT(allow_stub_calls()); // calls are not allowed in some stubs | 1018 ASSERT(allow_stub_calls()); // Calls are not allowed in some stubs. |
| 1019 call(stub->GetCode(), RelocInfo::CODE_TARGET); | 1019 call(stub->GetCode(), RelocInfo::CODE_TARGET); |
| 1020 } | 1020 } |
| 1021 | 1021 |
| 1022 | 1022 |
| 1023 Object* MacroAssembler::TryCallStub(CodeStub* stub) { |
| 1024 ASSERT(allow_stub_calls()); // Calls are not allowed in some stubs. |
| 1025 Object* result = stub->TryGetCode(); |
| 1026 if (!result->IsFailure()) { |
| 1027 call(Handle<Code>(Code::cast(result)), RelocInfo::CODE_TARGET); |
| 1028 } |
| 1029 return result; |
| 1030 } |
| 1031 |
| 1032 |
| 1023 void MacroAssembler::TailCallStub(CodeStub* stub) { | 1033 void MacroAssembler::TailCallStub(CodeStub* stub) { |
| 1024 ASSERT(allow_stub_calls()); // calls are not allowed in some stubs | 1034 ASSERT(allow_stub_calls()); // Calls are not allowed in some stubs. |
| 1025 jmp(stub->GetCode(), RelocInfo::CODE_TARGET); | 1035 jmp(stub->GetCode(), RelocInfo::CODE_TARGET); |
| 1026 } | 1036 } |
| 1027 | 1037 |
| 1028 | 1038 |
| 1039 Object* MacroAssembler::TryTailCallStub(CodeStub* stub) { |
| 1040 ASSERT(allow_stub_calls()); // Calls are not allowed in some stubs. |
| 1041 Object* result = stub->TryGetCode(); |
| 1042 if (!result->IsFailure()) { |
| 1043 jmp(Handle<Code>(Code::cast(result)), RelocInfo::CODE_TARGET); |
| 1044 } |
| 1045 return result; |
| 1046 } |
| 1047 |
| 1048 |
| 1029 void MacroAssembler::StubReturn(int argc) { | 1049 void MacroAssembler::StubReturn(int argc) { |
| 1030 ASSERT(argc >= 1 && generating_stub()); | 1050 ASSERT(argc >= 1 && generating_stub()); |
| 1031 ret((argc - 1) * kPointerSize); | 1051 ret((argc - 1) * kPointerSize); |
| 1032 } | 1052 } |
| 1033 | 1053 |
| 1034 | 1054 |
| 1035 void MacroAssembler::IllegalOperation(int num_arguments) { | 1055 void MacroAssembler::IllegalOperation(int num_arguments) { |
| 1036 if (num_arguments > 0) { | 1056 if (num_arguments > 0) { |
| 1037 add(Operand(esp), Immediate(num_arguments * kPointerSize)); | 1057 add(Operand(esp), Immediate(num_arguments * kPointerSize)); |
| 1038 } | 1058 } |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1417 // Indicate that code has changed. | 1437 // Indicate that code has changed. |
| 1418 CPU::FlushICache(address_, size_); | 1438 CPU::FlushICache(address_, size_); |
| 1419 | 1439 |
| 1420 // Check that the code was patched as expected. | 1440 // Check that the code was patched as expected. |
| 1421 ASSERT(masm_.pc_ == address_ + size_); | 1441 ASSERT(masm_.pc_ == address_ + size_); |
| 1422 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 1442 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
| 1423 } | 1443 } |
| 1424 | 1444 |
| 1425 | 1445 |
| 1426 } } // namespace v8::internal | 1446 } } // namespace v8::internal |
| OLD | NEW |