| 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 if (and_then == kReturnAtEnd) { | 191 if (and_then == kReturnAtEnd) { |
| 192 Label buffer_overflowed; | 192 Label buffer_overflowed; |
| 193 j(not_equal, &buffer_overflowed, Label::kNear); | 193 j(not_equal, &buffer_overflowed, Label::kNear); |
| 194 ret(0); | 194 ret(0); |
| 195 bind(&buffer_overflowed); | 195 bind(&buffer_overflowed); |
| 196 } else { | 196 } else { |
| 197 ASSERT(and_then == kFallThroughAtEnd); | 197 ASSERT(and_then == kFallThroughAtEnd); |
| 198 j(equal, &done, Label::kNear); | 198 j(equal, &done, Label::kNear); |
| 199 } | 199 } |
| 200 StoreBufferOverflowStub store_buffer_overflow = | 200 StoreBufferOverflowStub store_buffer_overflow = |
| 201 StoreBufferOverflowStub(save_fp); | 201 StoreBufferOverflowStub(isolate(), save_fp); |
| 202 CallStub(&store_buffer_overflow); | 202 CallStub(&store_buffer_overflow); |
| 203 if (and_then == kReturnAtEnd) { | 203 if (and_then == kReturnAtEnd) { |
| 204 ret(0); | 204 ret(0); |
| 205 } else { | 205 } else { |
| 206 ASSERT(and_then == kFallThroughAtEnd); | 206 ASSERT(and_then == kFallThroughAtEnd); |
| 207 bind(&done); | 207 bind(&done); |
| 208 } | 208 } |
| 209 } | 209 } |
| 210 | 210 |
| 211 | 211 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 240 j(zero, &done, Label::kNear); | 240 j(zero, &done, Label::kNear); |
| 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(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(isolate()), 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); |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 zero, | 627 zero, |
| 628 &done, | 628 &done, |
| 629 Label::kNear); | 629 Label::kNear); |
| 630 | 630 |
| 631 // Delay the initialization of |address| and |value| for the stub until it's | 631 // Delay the initialization of |address| and |value| for the stub until it's |
| 632 // known that the will be needed. Up until this point their values are not | 632 // known that the will be needed. Up until this point their values are not |
| 633 // needed since they are embedded in the operands of instructions that need | 633 // needed since they are embedded in the operands of instructions that need |
| 634 // them. | 634 // them. |
| 635 lea(address, FieldOperand(object, HeapObject::kMapOffset)); | 635 lea(address, FieldOperand(object, HeapObject::kMapOffset)); |
| 636 mov(value, Immediate(map)); | 636 mov(value, Immediate(map)); |
| 637 RecordWriteStub stub(object, value, address, OMIT_REMEMBERED_SET, save_fp); | 637 RecordWriteStub stub(isolate(), object, value, address, OMIT_REMEMBERED_SET, |
| 638 save_fp); |
| 638 CallStub(&stub); | 639 CallStub(&stub); |
| 639 | 640 |
| 640 bind(&done); | 641 bind(&done); |
| 641 | 642 |
| 642 // Clobber clobbered input registers when running with the debug-code flag | 643 // Clobber clobbered input registers when running with the debug-code flag |
| 643 // turned on to provoke errors. | 644 // turned on to provoke errors. |
| 644 if (emit_debug_code()) { | 645 if (emit_debug_code()) { |
| 645 mov(value, Immediate(BitCast<int32_t>(kZapValue))); | 646 mov(value, Immediate(BitCast<int32_t>(kZapValue))); |
| 646 mov(scratch1, Immediate(BitCast<int32_t>(kZapValue))); | 647 mov(scratch1, Immediate(BitCast<int32_t>(kZapValue))); |
| 647 mov(scratch2, Immediate(BitCast<int32_t>(kZapValue))); | 648 mov(scratch2, Immediate(BitCast<int32_t>(kZapValue))); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 zero, | 693 zero, |
| 693 &done, | 694 &done, |
| 694 Label::kNear); | 695 Label::kNear); |
| 695 CheckPageFlag(object, | 696 CheckPageFlag(object, |
| 696 value, // Used as scratch. | 697 value, // Used as scratch. |
| 697 MemoryChunk::kPointersFromHereAreInterestingMask, | 698 MemoryChunk::kPointersFromHereAreInterestingMask, |
| 698 zero, | 699 zero, |
| 699 &done, | 700 &done, |
| 700 Label::kNear); | 701 Label::kNear); |
| 701 | 702 |
| 702 RecordWriteStub stub(object, value, address, remembered_set_action, fp_mode); | 703 RecordWriteStub stub(isolate(), object, value, address, remembered_set_action, |
| 704 fp_mode); |
| 703 CallStub(&stub); | 705 CallStub(&stub); |
| 704 | 706 |
| 705 bind(&done); | 707 bind(&done); |
| 706 | 708 |
| 707 // Clobber clobbered registers when running with the debug-code flag | 709 // Clobber clobbered registers when running with the debug-code flag |
| 708 // turned on to provoke errors. | 710 // turned on to provoke errors. |
| 709 if (emit_debug_code()) { | 711 if (emit_debug_code()) { |
| 710 mov(address, Immediate(BitCast<int32_t>(kZapValue))); | 712 mov(address, Immediate(BitCast<int32_t>(kZapValue))); |
| 711 mov(value, Immediate(BitCast<int32_t>(kZapValue))); | 713 mov(value, Immediate(BitCast<int32_t>(kZapValue))); |
| 712 } | 714 } |
| 713 } | 715 } |
| 714 | 716 |
| 715 | 717 |
| 716 #ifdef ENABLE_DEBUGGER_SUPPORT | 718 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 717 void MacroAssembler::DebugBreak() { | 719 void MacroAssembler::DebugBreak() { |
| 718 Move(eax, Immediate(0)); | 720 Move(eax, Immediate(0)); |
| 719 mov(ebx, Immediate(ExternalReference(Runtime::kDebugBreak, isolate()))); | 721 mov(ebx, Immediate(ExternalReference(Runtime::kDebugBreak, isolate()))); |
| 720 CEntryStub ces(1); | 722 CEntryStub ces(isolate(), 1); |
| 721 call(ces.GetCode(isolate()), RelocInfo::DEBUG_BREAK); | 723 call(ces.GetCode(isolate()), RelocInfo::DEBUG_BREAK); |
| 722 } | 724 } |
| 723 #endif | 725 #endif |
| 724 | 726 |
| 725 | 727 |
| 726 void MacroAssembler::Cvtsi2sd(XMMRegister dst, const Operand& src) { | 728 void MacroAssembler::Cvtsi2sd(XMMRegister dst, const Operand& src) { |
| 727 xorps(dst, dst); | 729 xorps(dst, dst); |
| 728 cvtsi2sd(dst, src); | 730 cvtsi2sd(dst, src); |
| 729 } | 731 } |
| 730 | 732 |
| (...skipping 1508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2239 IllegalOperation(num_arguments); | 2241 IllegalOperation(num_arguments); |
| 2240 return; | 2242 return; |
| 2241 } | 2243 } |
| 2242 | 2244 |
| 2243 // TODO(1236192): Most runtime routines don't need the number of | 2245 // TODO(1236192): Most runtime routines don't need the number of |
| 2244 // arguments passed in because it is constant. At some point we | 2246 // arguments passed in because it is constant. At some point we |
| 2245 // should remove this need and make the runtime routine entry code | 2247 // should remove this need and make the runtime routine entry code |
| 2246 // smarter. | 2248 // smarter. |
| 2247 Move(eax, Immediate(num_arguments)); | 2249 Move(eax, Immediate(num_arguments)); |
| 2248 mov(ebx, Immediate(ExternalReference(f, isolate()))); | 2250 mov(ebx, Immediate(ExternalReference(f, isolate()))); |
| 2249 CEntryStub ces(1, CpuFeatures::IsSupported(SSE2) ? save_doubles | 2251 CEntryStub ces(isolate(), |
| 2250 : kDontSaveFPRegs); | 2252 1, |
| 2253 CpuFeatures::IsSupported(SSE2) ? save_doubles |
| 2254 : kDontSaveFPRegs); |
| 2251 CallStub(&ces); | 2255 CallStub(&ces); |
| 2252 } | 2256 } |
| 2253 | 2257 |
| 2254 | 2258 |
| 2255 void MacroAssembler::CallExternalReference(ExternalReference ref, | 2259 void MacroAssembler::CallExternalReference(ExternalReference ref, |
| 2256 int num_arguments) { | 2260 int num_arguments) { |
| 2257 mov(eax, Immediate(num_arguments)); | 2261 mov(eax, Immediate(num_arguments)); |
| 2258 mov(ebx, Immediate(ref)); | 2262 mov(ebx, Immediate(ref)); |
| 2259 | 2263 |
| 2260 CEntryStub stub(1); | 2264 CEntryStub stub(isolate(), 1); |
| 2261 CallStub(&stub); | 2265 CallStub(&stub); |
| 2262 } | 2266 } |
| 2263 | 2267 |
| 2264 | 2268 |
| 2265 void MacroAssembler::TailCallExternalReference(const ExternalReference& ext, | 2269 void MacroAssembler::TailCallExternalReference(const ExternalReference& ext, |
| 2266 int num_arguments, | 2270 int num_arguments, |
| 2267 int result_size) { | 2271 int result_size) { |
| 2268 // TODO(1236192): Most runtime routines don't need the number of | 2272 // TODO(1236192): Most runtime routines don't need the number of |
| 2269 // arguments passed in because it is constant. At some point we | 2273 // arguments passed in because it is constant. At some point we |
| 2270 // should remove this need and make the runtime routine entry code | 2274 // should remove this need and make the runtime routine entry code |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2444 mov(eax, Immediate(delete_extensions)); | 2448 mov(eax, Immediate(delete_extensions)); |
| 2445 call(eax); | 2449 call(eax); |
| 2446 mov(eax, edi); | 2450 mov(eax, edi); |
| 2447 jmp(&leave_exit_frame); | 2451 jmp(&leave_exit_frame); |
| 2448 } | 2452 } |
| 2449 | 2453 |
| 2450 | 2454 |
| 2451 void MacroAssembler::JumpToExternalReference(const ExternalReference& ext) { | 2455 void MacroAssembler::JumpToExternalReference(const ExternalReference& ext) { |
| 2452 // 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. |
| 2453 mov(ebx, Immediate(ext)); | 2457 mov(ebx, Immediate(ext)); |
| 2454 CEntryStub ces(1); | 2458 CEntryStub ces(isolate(), 1); |
| 2455 jmp(ces.GetCode(isolate()), RelocInfo::CODE_TARGET); | 2459 jmp(ces.GetCode(isolate()), RelocInfo::CODE_TARGET); |
| 2456 } | 2460 } |
| 2457 | 2461 |
| 2458 | 2462 |
| 2459 void MacroAssembler::InvokePrologue(const ParameterCount& expected, | 2463 void MacroAssembler::InvokePrologue(const ParameterCount& expected, |
| 2460 const ParameterCount& actual, | 2464 const ParameterCount& actual, |
| 2461 Handle<Code> code_constant, | 2465 Handle<Code> code_constant, |
| 2462 const Operand& code_operand, | 2466 const Operand& code_operand, |
| 2463 Label* done, | 2467 Label* done, |
| 2464 bool* definitely_mismatches, | 2468 bool* definitely_mismatches, |
| (...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3646 if (ms.shift() > 0) sar(edx, ms.shift()); | 3650 if (ms.shift() > 0) sar(edx, ms.shift()); |
| 3647 mov(eax, dividend); | 3651 mov(eax, dividend); |
| 3648 shr(eax, 31); | 3652 shr(eax, 31); |
| 3649 add(edx, eax); | 3653 add(edx, eax); |
| 3650 } | 3654 } |
| 3651 | 3655 |
| 3652 | 3656 |
| 3653 } } // namespace v8::internal | 3657 } } // namespace v8::internal |
| 3654 | 3658 |
| 3655 #endif // V8_TARGET_ARCH_IA32 | 3659 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |