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 26 matching lines...) Expand all Loading... |
37 #include "debug.h" | 37 #include "debug.h" |
38 #include "isolate-inl.h" | 38 #include "isolate-inl.h" |
39 #include "runtime.h" | 39 #include "runtime.h" |
40 | 40 |
41 namespace v8 { | 41 namespace v8 { |
42 namespace internal { | 42 namespace internal { |
43 | 43 |
44 MacroAssembler::MacroAssembler(Isolate* arg_isolate, void* buffer, int size) | 44 MacroAssembler::MacroAssembler(Isolate* arg_isolate, void* buffer, int size) |
45 : Assembler(arg_isolate, buffer, size), | 45 : Assembler(arg_isolate, buffer, size), |
46 generating_stub_(false), | 46 generating_stub_(false), |
47 allow_stub_calls_(true), | |
48 has_frame_(false) { | 47 has_frame_(false) { |
49 if (isolate() != NULL) { | 48 if (isolate() != NULL) { |
50 code_object_ = Handle<Object>(isolate()->heap()->undefined_value(), | 49 code_object_ = Handle<Object>(isolate()->heap()->undefined_value(), |
51 isolate()); | 50 isolate()); |
52 } | 51 } |
53 } | 52 } |
54 | 53 |
55 | 54 |
56 void MacroAssembler::Load(Register dst, | 55 void MacroAssembler::Load(Register dst, |
57 const MemOperand& src, | 56 const MemOperand& src, |
(...skipping 3821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3879 Register r1, | 3878 Register r1, |
3880 const Operand& r2, | 3879 const Operand& r2, |
3881 BranchDelaySlot bd) { | 3880 BranchDelaySlot bd) { |
3882 ASSERT(AllowThisStubCall(stub)); // Stub calls are not allowed in some stubs. | 3881 ASSERT(AllowThisStubCall(stub)); // Stub calls are not allowed in some stubs. |
3883 Call(stub->GetCode(isolate()), RelocInfo::CODE_TARGET, ast_id, | 3882 Call(stub->GetCode(isolate()), RelocInfo::CODE_TARGET, ast_id, |
3884 cond, r1, r2, bd); | 3883 cond, r1, r2, bd); |
3885 } | 3884 } |
3886 | 3885 |
3887 | 3886 |
3888 void MacroAssembler::TailCallStub(CodeStub* stub) { | 3887 void MacroAssembler::TailCallStub(CodeStub* stub) { |
3889 ASSERT(allow_stub_calls_ || | |
3890 stub->CompilingCallsToThisStubIsGCSafe(isolate())); | |
3891 Jump(stub->GetCode(isolate()), RelocInfo::CODE_TARGET); | 3888 Jump(stub->GetCode(isolate()), RelocInfo::CODE_TARGET); |
3892 } | 3889 } |
3893 | 3890 |
3894 | 3891 |
3895 static int AddressOffset(ExternalReference ref0, ExternalReference ref1) { | 3892 static int AddressOffset(ExternalReference ref0, ExternalReference ref1) { |
3896 return ref0.address() - ref1.address(); | 3893 return ref0.address() - ref1.address(); |
3897 } | 3894 } |
3898 | 3895 |
3899 | 3896 |
3900 void MacroAssembler::CallApiFunctionAndReturn( | 3897 void MacroAssembler::CallApiFunctionAndReturn( |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4020 PrepareCallCFunction(1, s1); | 4017 PrepareCallCFunction(1, s1); |
4021 li(a0, Operand(ExternalReference::isolate_address(isolate()))); | 4018 li(a0, Operand(ExternalReference::isolate_address(isolate()))); |
4022 CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate()), | 4019 CallCFunction(ExternalReference::delete_handle_scope_extensions(isolate()), |
4023 1); | 4020 1); |
4024 mov(v0, s0); | 4021 mov(v0, s0); |
4025 jmp(&leave_exit_frame); | 4022 jmp(&leave_exit_frame); |
4026 } | 4023 } |
4027 | 4024 |
4028 | 4025 |
4029 bool MacroAssembler::AllowThisStubCall(CodeStub* stub) { | 4026 bool MacroAssembler::AllowThisStubCall(CodeStub* stub) { |
4030 if (!has_frame_ && stub->SometimesSetsUpAFrame()) return false; | 4027 return has_frame_ || !stub->SometimesSetsUpAFrame(); |
4031 return allow_stub_calls_ || stub->CompilingCallsToThisStubIsGCSafe(isolate()); | |
4032 } | 4028 } |
4033 | 4029 |
4034 | 4030 |
4035 void MacroAssembler::IllegalOperation(int num_arguments) { | 4031 void MacroAssembler::IllegalOperation(int num_arguments) { |
4036 if (num_arguments > 0) { | 4032 if (num_arguments > 0) { |
4037 addiu(sp, sp, num_arguments * kPointerSize); | 4033 addiu(sp, sp, num_arguments * kPointerSize); |
4038 } | 4034 } |
4039 LoadRoot(v0, Heap::kUndefinedValueRootIndex); | 4035 LoadRoot(v0, Heap::kUndefinedValueRootIndex); |
4040 } | 4036 } |
4041 | 4037 |
(...skipping 1726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5768 opcode == BGTZL); | 5764 opcode == BGTZL); |
5769 opcode = (cond == eq) ? BEQ : BNE; | 5765 opcode = (cond == eq) ? BEQ : BNE; |
5770 instr = (instr & ~kOpcodeMask) | opcode; | 5766 instr = (instr & ~kOpcodeMask) | opcode; |
5771 masm_.emit(instr); | 5767 masm_.emit(instr); |
5772 } | 5768 } |
5773 | 5769 |
5774 | 5770 |
5775 } } // namespace v8::internal | 5771 } } // namespace v8::internal |
5776 | 5772 |
5777 #endif // V8_TARGET_ARCH_MIPS | 5773 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |