OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 } else { | 376 } else { |
377 fucompp(); | 377 fucompp(); |
378 push(eax); | 378 push(eax); |
379 fnstsw_ax(); | 379 fnstsw_ax(); |
380 sahf(); | 380 sahf(); |
381 pop(eax); | 381 pop(eax); |
382 } | 382 } |
383 } | 383 } |
384 | 384 |
385 | 385 |
| 386 void MacroAssembler::AbortIfNotNumber(Register object, const char* msg) { |
| 387 Label ok; |
| 388 test(object, Immediate(kSmiTagMask)); |
| 389 j(zero, &ok); |
| 390 cmp(FieldOperand(object, HeapObject::kMapOffset), |
| 391 Factory::heap_number_map()); |
| 392 Assert(equal, msg); |
| 393 bind(&ok); |
| 394 } |
| 395 |
| 396 |
386 void MacroAssembler::EnterFrame(StackFrame::Type type) { | 397 void MacroAssembler::EnterFrame(StackFrame::Type type) { |
387 push(ebp); | 398 push(ebp); |
388 mov(ebp, Operand(esp)); | 399 mov(ebp, Operand(esp)); |
389 push(esi); | 400 push(esi); |
390 push(Immediate(Smi::FromInt(type))); | 401 push(Immediate(Smi::FromInt(type))); |
391 push(Immediate(CodeObject())); | 402 push(Immediate(CodeObject())); |
392 if (FLAG_debug_code) { | 403 if (FLAG_debug_code) { |
393 cmp(Operand(esp, 0), Immediate(Factory::undefined_value())); | 404 cmp(Operand(esp, 0), Immediate(Factory::undefined_value())); |
394 Check(not_equal, "code object not properly patched"); | 405 Check(not_equal, "code object not properly patched"); |
395 } | 406 } |
(...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1617 // Indicate that code has changed. | 1628 // Indicate that code has changed. |
1618 CPU::FlushICache(address_, size_); | 1629 CPU::FlushICache(address_, size_); |
1619 | 1630 |
1620 // Check that the code was patched as expected. | 1631 // Check that the code was patched as expected. |
1621 ASSERT(masm_.pc_ == address_ + size_); | 1632 ASSERT(masm_.pc_ == address_ + size_); |
1622 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 1633 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
1623 } | 1634 } |
1624 | 1635 |
1625 | 1636 |
1626 } } // namespace v8::internal | 1637 } } // namespace v8::internal |
OLD | NEW |