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 1436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1447 Operand operand = Operand::StaticVariable(ExternalReference(counter)); | 1447 Operand operand = Operand::StaticVariable(ExternalReference(counter)); |
1448 if (value == 1) { | 1448 if (value == 1) { |
1449 dec(operand); | 1449 dec(operand); |
1450 } else { | 1450 } else { |
1451 sub(operand, Immediate(value)); | 1451 sub(operand, Immediate(value)); |
1452 } | 1452 } |
1453 } | 1453 } |
1454 } | 1454 } |
1455 | 1455 |
1456 | 1456 |
| 1457 void MacroAssembler::IncrementCounter(Condition cc, |
| 1458 StatsCounter* counter, |
| 1459 int value) { |
| 1460 ASSERT(value > 0); |
| 1461 if (FLAG_native_code_counters && counter->Enabled()) { |
| 1462 Label skip; |
| 1463 j(NegateCondition(cc), &skip); |
| 1464 pushfd(); |
| 1465 IncrementCounter(counter, value); |
| 1466 popfd(); |
| 1467 bind(&skip); |
| 1468 } |
| 1469 } |
| 1470 |
| 1471 |
| 1472 void MacroAssembler::DecrementCounter(Condition cc, |
| 1473 StatsCounter* counter, |
| 1474 int value) { |
| 1475 ASSERT(value > 0); |
| 1476 if (FLAG_native_code_counters && counter->Enabled()) { |
| 1477 Label skip; |
| 1478 j(NegateCondition(cc), &skip); |
| 1479 pushfd(); |
| 1480 DecrementCounter(counter, value); |
| 1481 popfd(); |
| 1482 bind(&skip); |
| 1483 } |
| 1484 } |
| 1485 |
| 1486 |
1457 void MacroAssembler::Assert(Condition cc, const char* msg) { | 1487 void MacroAssembler::Assert(Condition cc, const char* msg) { |
1458 if (FLAG_debug_code) Check(cc, msg); | 1488 if (FLAG_debug_code) Check(cc, msg); |
1459 } | 1489 } |
1460 | 1490 |
1461 | 1491 |
1462 void MacroAssembler::Check(Condition cc, const char* msg) { | 1492 void MacroAssembler::Check(Condition cc, const char* msg) { |
1463 Label L; | 1493 Label L; |
1464 j(cc, &L, taken); | 1494 j(cc, &L, taken); |
1465 Abort(msg); | 1495 Abort(msg); |
1466 // will not return here | 1496 // will not return here |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1508 // Indicate that code has changed. | 1538 // Indicate that code has changed. |
1509 CPU::FlushICache(address_, size_); | 1539 CPU::FlushICache(address_, size_); |
1510 | 1540 |
1511 // Check that the code was patched as expected. | 1541 // Check that the code was patched as expected. |
1512 ASSERT(masm_.pc_ == address_ + size_); | 1542 ASSERT(masm_.pc_ == address_ + size_); |
1513 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 1543 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
1514 } | 1544 } |
1515 | 1545 |
1516 | 1546 |
1517 } } // namespace v8::internal | 1547 } } // namespace v8::internal |
OLD | NEW |