| 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::Jump(Register target, Condition cond) { | 55 void MacroAssembler::Jump(Register target, Condition cond) { |
| 57 bx(target, cond); | 56 bx(target, cond); |
| (...skipping 2211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2269 | 2268 |
| 2270 void MacroAssembler::CallStub(CodeStub* stub, | 2269 void MacroAssembler::CallStub(CodeStub* stub, |
| 2271 TypeFeedbackId ast_id, | 2270 TypeFeedbackId ast_id, |
| 2272 Condition cond) { | 2271 Condition cond) { |
| 2273 ASSERT(AllowThisStubCall(stub)); // Stub calls are not allowed in some stubs. | 2272 ASSERT(AllowThisStubCall(stub)); // Stub calls are not allowed in some stubs. |
| 2274 Call(stub->GetCode(isolate()), RelocInfo::CODE_TARGET, ast_id, cond); | 2273 Call(stub->GetCode(isolate()), RelocInfo::CODE_TARGET, ast_id, cond); |
| 2275 } | 2274 } |
| 2276 | 2275 |
| 2277 | 2276 |
| 2278 void MacroAssembler::TailCallStub(CodeStub* stub, Condition cond) { | 2277 void MacroAssembler::TailCallStub(CodeStub* stub, Condition cond) { |
| 2279 ASSERT(allow_stub_calls_ || | |
| 2280 stub->CompilingCallsToThisStubIsGCSafe(isolate())); | |
| 2281 Jump(stub->GetCode(isolate()), RelocInfo::CODE_TARGET, cond); | 2278 Jump(stub->GetCode(isolate()), RelocInfo::CODE_TARGET, cond); |
| 2282 } | 2279 } |
| 2283 | 2280 |
| 2284 | 2281 |
| 2285 static int AddressOffset(ExternalReference ref0, ExternalReference ref1) { | 2282 static int AddressOffset(ExternalReference ref0, ExternalReference ref1) { |
| 2286 return ref0.address() - ref1.address(); | 2283 return ref0.address() - ref1.address(); |
| 2287 } | 2284 } |
| 2288 | 2285 |
| 2289 | 2286 |
| 2290 void MacroAssembler::CallApiFunctionAndReturn( | 2287 void MacroAssembler::CallApiFunctionAndReturn( |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2415 PrepareCallCFunction(1, r5); | 2412 PrepareCallCFunction(1, r5); |
| 2416 mov(r0, Operand(ExternalReference::isolate_address(isolate()))); | 2413 mov(r0, Operand(ExternalReference::isolate_address(isolate()))); |
| 2417 CallCFunction( | 2414 CallCFunction( |
| 2418 ExternalReference::delete_handle_scope_extensions(isolate()), 1); | 2415 ExternalReference::delete_handle_scope_extensions(isolate()), 1); |
| 2419 mov(r0, r4); | 2416 mov(r0, r4); |
| 2420 jmp(&leave_exit_frame); | 2417 jmp(&leave_exit_frame); |
| 2421 } | 2418 } |
| 2422 | 2419 |
| 2423 | 2420 |
| 2424 bool MacroAssembler::AllowThisStubCall(CodeStub* stub) { | 2421 bool MacroAssembler::AllowThisStubCall(CodeStub* stub) { |
| 2425 if (!has_frame_ && stub->SometimesSetsUpAFrame()) return false; | 2422 return has_frame_ || !stub->SometimesSetsUpAFrame(); |
| 2426 return allow_stub_calls_ || stub->CompilingCallsToThisStubIsGCSafe(isolate()); | |
| 2427 } | 2423 } |
| 2428 | 2424 |
| 2429 | 2425 |
| 2430 void MacroAssembler::IllegalOperation(int num_arguments) { | 2426 void MacroAssembler::IllegalOperation(int num_arguments) { |
| 2431 if (num_arguments > 0) { | 2427 if (num_arguments > 0) { |
| 2432 add(sp, sp, Operand(num_arguments * kPointerSize)); | 2428 add(sp, sp, Operand(num_arguments * kPointerSize)); |
| 2433 } | 2429 } |
| 2434 LoadRoot(r0, Heap::kUndefinedValueRootIndex); | 2430 LoadRoot(r0, Heap::kUndefinedValueRootIndex); |
| 2435 } | 2431 } |
| 2436 | 2432 |
| (...skipping 1633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4070 void CodePatcher::EmitCondition(Condition cond) { | 4066 void CodePatcher::EmitCondition(Condition cond) { |
| 4071 Instr instr = Assembler::instr_at(masm_.pc_); | 4067 Instr instr = Assembler::instr_at(masm_.pc_); |
| 4072 instr = (instr & ~kCondMask) | cond; | 4068 instr = (instr & ~kCondMask) | cond; |
| 4073 masm_.emit(instr); | 4069 masm_.emit(instr); |
| 4074 } | 4070 } |
| 4075 | 4071 |
| 4076 | 4072 |
| 4077 } } // namespace v8::internal | 4073 } } // namespace v8::internal |
| 4078 | 4074 |
| 4079 #endif // V8_TARGET_ARCH_ARM | 4075 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |