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 2500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2511 ret(bytes_dropped); | 2511 ret(bytes_dropped); |
2512 } else { | 2512 } else { |
2513 pop(scratch); | 2513 pop(scratch); |
2514 add(esp, Immediate(bytes_dropped)); | 2514 add(esp, Immediate(bytes_dropped)); |
2515 push(scratch); | 2515 push(scratch); |
2516 ret(0); | 2516 ret(0); |
2517 } | 2517 } |
2518 } | 2518 } |
2519 | 2519 |
2520 | 2520 |
| 2521 void MacroAssembler::VerifyX87StackDepth(uint depth) { |
| 2522 // Make sure the floating point stack is either empty or has depth items. |
| 2523 ASSERT(depth <= 7); |
| 2524 |
| 2525 // The top-of-stack (tos) is 7 if there is one item pushed. |
| 2526 int tos = (8 - depth) % 8; |
| 2527 const int kTopMask = 0x3800; |
| 2528 push(eax); |
| 2529 fwait(); |
| 2530 fnstsw_ax(); |
| 2531 and_(eax, kTopMask); |
| 2532 shr(eax, 11); |
| 2533 cmp(eax, Immediate(tos)); |
| 2534 Label all_ok; |
| 2535 j(equal, &all_ok); |
| 2536 Check(equal, "Unexpected FPU stack depth after instruction"); |
| 2537 bind(&all_ok); |
| 2538 fnclex(); |
| 2539 pop(eax); |
| 2540 } |
| 2541 |
| 2542 |
2521 void MacroAssembler::Drop(int stack_elements) { | 2543 void MacroAssembler::Drop(int stack_elements) { |
2522 if (stack_elements > 0) { | 2544 if (stack_elements > 0) { |
2523 add(esp, Immediate(stack_elements * kPointerSize)); | 2545 add(esp, Immediate(stack_elements * kPointerSize)); |
2524 } | 2546 } |
2525 } | 2547 } |
2526 | 2548 |
2527 | 2549 |
2528 void MacroAssembler::Move(Register dst, Register src) { | 2550 void MacroAssembler::Move(Register dst, Register src) { |
2529 if (!dst.is(src)) { | 2551 if (!dst.is(src)) { |
2530 mov(dst, src); | 2552 mov(dst, src); |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3093 j(greater, &no_info_available); | 3115 j(greater, &no_info_available); |
3094 cmp(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), | 3116 cmp(MemOperand(scratch_reg, -AllocationSiteInfo::kSize), |
3095 Immediate(Handle<Map>(isolate()->heap()->allocation_site_info_map()))); | 3117 Immediate(Handle<Map>(isolate()->heap()->allocation_site_info_map()))); |
3096 bind(&no_info_available); | 3118 bind(&no_info_available); |
3097 } | 3119 } |
3098 | 3120 |
3099 | 3121 |
3100 } } // namespace v8::internal | 3122 } } // namespace v8::internal |
3101 | 3123 |
3102 #endif // V8_TARGET_ARCH_IA32 | 3124 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |