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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 setcc(negative, reg); // 1 if negative, 0 if positive. | 241 setcc(negative, reg); // 1 if negative, 0 if positive. |
242 dec_b(reg); // 0 if negative, 255 if positive. | 242 dec_b(reg); // 0 if negative, 255 if positive. |
243 bind(&done); | 243 bind(&done); |
244 } | 244 } |
245 | 245 |
246 | 246 |
247 void MacroAssembler::SlowTruncateToI(Register result_reg, | 247 void MacroAssembler::SlowTruncateToI(Register result_reg, |
248 Register input_reg, | 248 Register input_reg, |
249 int offset) { | 249 int offset) { |
250 DoubleToIStub stub(isolate(), input_reg, result_reg, offset, true); | 250 DoubleToIStub stub(isolate(), input_reg, result_reg, offset, true); |
251 call(stub.GetCode(isolate()), RelocInfo::CODE_TARGET); | 251 call(stub.GetCode(), RelocInfo::CODE_TARGET); |
252 } | 252 } |
253 | 253 |
254 | 254 |
255 void MacroAssembler::TruncateDoubleToI(Register result_reg, | 255 void MacroAssembler::TruncateDoubleToI(Register result_reg, |
256 XMMRegister input_reg) { | 256 XMMRegister input_reg) { |
257 Label done; | 257 Label done; |
258 cvttsd2si(result_reg, Operand(input_reg)); | 258 cvttsd2si(result_reg, Operand(input_reg)); |
259 cmp(result_reg, 0x1); | 259 cmp(result_reg, 0x1); |
260 j(no_overflow, &done, Label::kNear); | 260 j(no_overflow, &done, Label::kNear); |
261 | 261 |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 mov(value, Immediate(BitCast<int32_t>(kZapValue))); | 713 mov(value, Immediate(BitCast<int32_t>(kZapValue))); |
714 } | 714 } |
715 } | 715 } |
716 | 716 |
717 | 717 |
718 #ifdef ENABLE_DEBUGGER_SUPPORT | 718 #ifdef ENABLE_DEBUGGER_SUPPORT |
719 void MacroAssembler::DebugBreak() { | 719 void MacroAssembler::DebugBreak() { |
720 Move(eax, Immediate(0)); | 720 Move(eax, Immediate(0)); |
721 mov(ebx, Immediate(ExternalReference(Runtime::kDebugBreak, isolate()))); | 721 mov(ebx, Immediate(ExternalReference(Runtime::kDebugBreak, isolate()))); |
722 CEntryStub ces(isolate(), 1); | 722 CEntryStub ces(isolate(), 1); |
723 call(ces.GetCode(isolate()), RelocInfo::DEBUG_BREAK); | 723 call(ces.GetCode(), RelocInfo::DEBUG_BREAK); |
724 } | 724 } |
725 #endif | 725 #endif |
726 | 726 |
727 | 727 |
728 void MacroAssembler::Cvtsi2sd(XMMRegister dst, const Operand& src) { | 728 void MacroAssembler::Cvtsi2sd(XMMRegister dst, const Operand& src) { |
729 xorps(dst, dst); | 729 xorps(dst, dst); |
730 cvtsi2sd(dst, src); | 730 cvtsi2sd(dst, src); |
731 } | 731 } |
732 | 732 |
733 | 733 |
(...skipping 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2177 bind(&non_instance); | 2177 bind(&non_instance); |
2178 mov(result, FieldOperand(result, Map::kConstructorOffset)); | 2178 mov(result, FieldOperand(result, Map::kConstructorOffset)); |
2179 | 2179 |
2180 // All done. | 2180 // All done. |
2181 bind(&done); | 2181 bind(&done); |
2182 } | 2182 } |
2183 | 2183 |
2184 | 2184 |
2185 void MacroAssembler::CallStub(CodeStub* stub, TypeFeedbackId ast_id) { | 2185 void MacroAssembler::CallStub(CodeStub* stub, TypeFeedbackId ast_id) { |
2186 ASSERT(AllowThisStubCall(stub)); // Calls are not allowed in some stubs. | 2186 ASSERT(AllowThisStubCall(stub)); // Calls are not allowed in some stubs. |
2187 call(stub->GetCode(isolate()), RelocInfo::CODE_TARGET, ast_id); | 2187 call(stub->GetCode(), RelocInfo::CODE_TARGET, ast_id); |
2188 } | 2188 } |
2189 | 2189 |
2190 | 2190 |
2191 void MacroAssembler::TailCallStub(CodeStub* stub) { | 2191 void MacroAssembler::TailCallStub(CodeStub* stub) { |
2192 jmp(stub->GetCode(isolate()), RelocInfo::CODE_TARGET); | 2192 jmp(stub->GetCode(), RelocInfo::CODE_TARGET); |
2193 } | 2193 } |
2194 | 2194 |
2195 | 2195 |
2196 void MacroAssembler::StubReturn(int argc) { | 2196 void MacroAssembler::StubReturn(int argc) { |
2197 ASSERT(argc >= 1 && generating_stub()); | 2197 ASSERT(argc >= 1 && generating_stub()); |
2198 ret((argc - 1) * kPointerSize); | 2198 ret((argc - 1) * kPointerSize); |
2199 } | 2199 } |
2200 | 2200 |
2201 | 2201 |
2202 bool MacroAssembler::AllowThisStubCall(CodeStub* stub) { | 2202 bool MacroAssembler::AllowThisStubCall(CodeStub* stub) { |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2449 call(eax); | 2449 call(eax); |
2450 mov(eax, edi); | 2450 mov(eax, edi); |
2451 jmp(&leave_exit_frame); | 2451 jmp(&leave_exit_frame); |
2452 } | 2452 } |
2453 | 2453 |
2454 | 2454 |
2455 void MacroAssembler::JumpToExternalReference(const ExternalReference& ext) { | 2455 void MacroAssembler::JumpToExternalReference(const ExternalReference& ext) { |
2456 // Set the entry point and jump to the C entry runtime stub. | 2456 // Set the entry point and jump to the C entry runtime stub. |
2457 mov(ebx, Immediate(ext)); | 2457 mov(ebx, Immediate(ext)); |
2458 CEntryStub ces(isolate(), 1); | 2458 CEntryStub ces(isolate(), 1); |
2459 jmp(ces.GetCode(isolate()), RelocInfo::CODE_TARGET); | 2459 jmp(ces.GetCode(), RelocInfo::CODE_TARGET); |
2460 } | 2460 } |
2461 | 2461 |
2462 | 2462 |
2463 void MacroAssembler::InvokePrologue(const ParameterCount& expected, | 2463 void MacroAssembler::InvokePrologue(const ParameterCount& expected, |
2464 const ParameterCount& actual, | 2464 const ParameterCount& actual, |
2465 Handle<Code> code_constant, | 2465 Handle<Code> code_constant, |
2466 const Operand& code_operand, | 2466 const Operand& code_operand, |
2467 Label* done, | 2467 Label* done, |
2468 bool* definitely_mismatches, | 2468 bool* definitely_mismatches, |
2469 InvokeFlag flag, | 2469 InvokeFlag flag, |
(...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3650 if (ms.shift() > 0) sar(edx, ms.shift()); | 3650 if (ms.shift() > 0) sar(edx, ms.shift()); |
3651 mov(eax, dividend); | 3651 mov(eax, dividend); |
3652 shr(eax, 31); | 3652 shr(eax, 31); |
3653 add(edx, eax); | 3653 add(edx, eax); |
3654 } | 3654 } |
3655 | 3655 |
3656 | 3656 |
3657 } } // namespace v8::internal | 3657 } } // namespace v8::internal |
3658 | 3658 |
3659 #endif // V8_TARGET_ARCH_IA32 | 3659 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |