OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 Bootstrapper::FixupFlagsIsPCRelative::encode(true) | | 839 Bootstrapper::FixupFlagsIsPCRelative::encode(true) | |
840 Bootstrapper::FixupFlagsUseCodeObject::encode(true); | 840 Bootstrapper::FixupFlagsUseCodeObject::encode(true); |
841 Unresolved entry = { pc_offset() - sizeof(Instr), flags, name }; | 841 Unresolved entry = { pc_offset() - sizeof(Instr), flags, name }; |
842 unresolved_.Add(entry); | 842 unresolved_.Add(entry); |
843 } | 843 } |
844 | 844 |
845 add(target, target, Operand(Code::kHeaderSize - kHeapObjectTag)); | 845 add(target, target, Operand(Code::kHeaderSize - kHeapObjectTag)); |
846 } | 846 } |
847 | 847 |
848 | 848 |
| 849 void MacroAssembler::SetCounter(StatsCounter* counter, int value, |
| 850 Register scratch1, Register scratch2) { |
| 851 if (FLAG_native_code_counters && counter->Enabled()) { |
| 852 mov(scratch1, Operand(value)); |
| 853 mov(scratch2, Operand(ExternalReference(counter))); |
| 854 str(scratch1, MemOperand(scratch2)); |
| 855 } |
| 856 } |
| 857 |
| 858 |
| 859 void MacroAssembler::IncrementCounter(StatsCounter* counter, int value, |
| 860 Register scratch1, Register scratch2) { |
| 861 ASSERT(value > 0); |
| 862 if (FLAG_native_code_counters && counter->Enabled()) { |
| 863 mov(scratch2, Operand(ExternalReference(counter))); |
| 864 ldr(scratch1, MemOperand(scratch2)); |
| 865 add(scratch1, scratch1, Operand(value)); |
| 866 str(scratch1, MemOperand(scratch2)); |
| 867 } |
| 868 } |
| 869 |
| 870 |
| 871 void MacroAssembler::DecrementCounter(StatsCounter* counter, int value, |
| 872 Register scratch1, Register scratch2) { |
| 873 ASSERT(value > 0); |
| 874 if (FLAG_native_code_counters && counter->Enabled()) { |
| 875 mov(scratch2, Operand(ExternalReference(counter))); |
| 876 ldr(scratch1, MemOperand(scratch2)); |
| 877 sub(scratch1, scratch1, Operand(value)); |
| 878 str(scratch1, MemOperand(scratch2)); |
| 879 } |
| 880 } |
| 881 |
| 882 |
849 void MacroAssembler::Assert(Condition cc, const char* msg) { | 883 void MacroAssembler::Assert(Condition cc, const char* msg) { |
850 if (FLAG_debug_code) | 884 if (FLAG_debug_code) |
851 Check(cc, msg); | 885 Check(cc, msg); |
852 } | 886 } |
853 | 887 |
854 | 888 |
855 void MacroAssembler::Check(Condition cc, const char* msg) { | 889 void MacroAssembler::Check(Condition cc, const char* msg) { |
856 Label L; | 890 Label L; |
857 b(cc, &L); | 891 b(cc, &L); |
858 Abort(msg); | 892 Abort(msg); |
(...skipping 19 matching lines...) Expand all Loading... |
878 #endif | 912 #endif |
879 mov(r0, Operand(p0)); | 913 mov(r0, Operand(p0)); |
880 push(r0); | 914 push(r0); |
881 mov(r0, Operand(Smi::FromInt(p1 - p0))); | 915 mov(r0, Operand(Smi::FromInt(p1 - p0))); |
882 push(r0); | 916 push(r0); |
883 CallRuntime(Runtime::kAbort, 2); | 917 CallRuntime(Runtime::kAbort, 2); |
884 // will not return here | 918 // will not return here |
885 } | 919 } |
886 | 920 |
887 } } // namespace v8::internal | 921 } } // namespace v8::internal |
OLD | NEW |