Changeset 49409 in webkit for trunk/JavaScriptCore/bytecode/CodeBlock.cpp
- Timestamp:
- Oct 9, 2009, 5:30:49 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/bytecode/CodeBlock.cpp
r48067 r49409 136 136 } 137 137 138 static int locationForOffset(const Vector<Instruction>::const_iterator& begin, Vector<Instruction>::const_iterator& it, int offset)139 {140 return it - begin + offset;141 }142 143 138 static void printUnaryOp(int location, Vector<Instruction>::const_iterator& it, const char* op) 144 139 { … … 157 152 } 158 153 159 static void printConditionalJump(const Vector<Instruction>::const_iterator& begin, Vector<Instruction>::const_iterator& it, int location, const char* op)154 static void printConditionalJump(const Vector<Instruction>::const_iterator&, Vector<Instruction>::const_iterator& it, int location, const char* op) 160 155 { 161 156 int r0 = (++it)->u.operand; 162 157 int offset = (++it)->u.operand; 163 printf("[%4d] %s\t\t %s, %d(->%d)\n", location, op, registerName(r0).c_str(), offset, location ForOffset(begin, it, offset));158 printf("[%4d] %s\t\t %s, %d(->%d)\n", location, op, registerName(r0).c_str(), offset, location + offset); 164 159 } 165 160 … … 853 848 case op_jmp: { 854 849 int offset = (++it)->u.operand; 855 printf("[%4d] jmp\t\t %d(->%d)\n", location, offset, location ForOffset(begin, it, offset));850 printf("[%4d] jmp\t\t %d(->%d)\n", location, offset, location + offset); 856 851 break; 857 852 } 858 853 case op_loop: { 859 854 int offset = (++it)->u.operand; 860 printf("[%4d] loop\t\t %d(->%d)\n", location, offset, location ForOffset(begin, it, offset));855 printf("[%4d] loop\t\t %d(->%d)\n", location, offset, location + offset); 861 856 break; 862 857 } … … 885 880 int r1 = (++it)->u.operand; 886 881 int offset = (++it)->u.operand; 887 printf("[%4d] jneq_ptr\t\t %s, %s, %d(->%d)\n", location, registerName(r0).c_str(), registerName(r1).c_str(), offset, location ForOffset(begin, it, offset));882 printf("[%4d] jneq_ptr\t\t %s, %s, %d(->%d)\n", location, registerName(r0).c_str(), registerName(r1).c_str(), offset, location + offset); 888 883 break; 889 884 } … … 892 887 int r1 = (++it)->u.operand; 893 888 int offset = (++it)->u.operand; 894 printf("[%4d] jnless\t\t %s, %s, %d(->%d)\n", location, registerName(r0).c_str(), registerName(r1).c_str(), offset, location ForOffset(begin, it, offset));889 printf("[%4d] jnless\t\t %s, %s, %d(->%d)\n", location, registerName(r0).c_str(), registerName(r1).c_str(), offset, location + offset); 895 890 break; 896 891 } … … 899 894 int r1 = (++it)->u.operand; 900 895 int offset = (++it)->u.operand; 901 printf("[%4d] jnlesseq\t\t %s, %s, %d(->%d)\n", location, registerName(r0).c_str(), registerName(r1).c_str(), offset, location ForOffset(begin, it, offset));896 printf("[%4d] jnlesseq\t\t %s, %s, %d(->%d)\n", location, registerName(r0).c_str(), registerName(r1).c_str(), offset, location + offset); 902 897 break; 903 898 } … … 906 901 int r1 = (++it)->u.operand; 907 902 int offset = (++it)->u.operand; 908 printf("[%4d] loop_if_less\t %s, %s, %d(->%d)\n", location, registerName(r0).c_str(), registerName(r1).c_str(), offset, location ForOffset(begin, it, offset));903 printf("[%4d] loop_if_less\t %s, %s, %d(->%d)\n", location, registerName(r0).c_str(), registerName(r1).c_str(), offset, location + offset); 909 904 break; 910 905 } … … 913 908 int r1 = (++it)->u.operand; 914 909 int offset = (++it)->u.operand; 915 printf("[%4d] loop_if_lesseq\t %s, %s, %d(->%d)\n", location, registerName(r0).c_str(), registerName(r1).c_str(), offset, location ForOffset(begin, it, offset));910 printf("[%4d] loop_if_lesseq\t %s, %s, %d(->%d)\n", location, registerName(r0).c_str(), registerName(r1).c_str(), offset, location + offset); 916 911 break; 917 912 } … … 920 915 int defaultTarget = (++it)->u.operand; 921 916 int scrutineeRegister = (++it)->u.operand; 922 printf("[%4d] switch_imm\t %d, %d(->%d), %s\n", location, tableIndex, defaultTarget, location ForOffset(begin, it, defaultTarget), registerName(scrutineeRegister).c_str());917 printf("[%4d] switch_imm\t %d, %d(->%d), %s\n", location, tableIndex, defaultTarget, location + defaultTarget, registerName(scrutineeRegister).c_str()); 923 918 break; 924 919 } … … 927 922 int defaultTarget = (++it)->u.operand; 928 923 int scrutineeRegister = (++it)->u.operand; 929 printf("[%4d] switch_char\t %d, %d(->%d), %s\n", location, tableIndex, defaultTarget, location ForOffset(begin, it, defaultTarget), registerName(scrutineeRegister).c_str());924 printf("[%4d] switch_char\t %d, %d(->%d), %s\n", location, tableIndex, defaultTarget, location + defaultTarget, registerName(scrutineeRegister).c_str()); 930 925 break; 931 926 } … … 934 929 int defaultTarget = (++it)->u.operand; 935 930 int scrutineeRegister = (++it)->u.operand; 936 printf("[%4d] switch_string\t %d, %d(->%d), %s\n", location, tableIndex, defaultTarget, location ForOffset(begin, it, defaultTarget), registerName(scrutineeRegister).c_str());931 printf("[%4d] switch_string\t %d, %d(->%d), %s\n", location, tableIndex, defaultTarget, location + defaultTarget, registerName(scrutineeRegister).c_str()); 937 932 break; 938 933 } … … 1030 1025 int iter = (++it)->u.operand; 1031 1026 int offset = (++it)->u.operand; 1032 printf("[%4d] next_pname\t %s, %s, %d(->%d)\n", location, registerName(dest).c_str(), registerName(iter).c_str(), offset, location ForOffset(begin, it, offset));1027 printf("[%4d] next_pname\t %s, %s, %d(->%d)\n", location, registerName(dest).c_str(), registerName(iter).c_str(), offset, location + offset); 1033 1028 break; 1034 1029 } … … 1052 1047 int scopeDelta = (++it)->u.operand; 1053 1048 int offset = (++it)->u.operand; 1054 printf("[%4d] jmp_scopes\t^%d, %d(->%d)\n", location, scopeDelta, offset, location ForOffset(begin, it, offset));1049 printf("[%4d] jmp_scopes\t^%d, %d(->%d)\n", location, scopeDelta, offset, location + offset); 1055 1050 break; 1056 1051 } … … 1075 1070 int retAddrDst = (++it)->u.operand; 1076 1071 int offset = (++it)->u.operand; 1077 printf("[%4d] jsr\t\t %s, %d(->%d)\n", location, registerName(retAddrDst).c_str(), offset, location ForOffset(begin, it, offset));1072 printf("[%4d] jsr\t\t %s, %d(->%d)\n", location, registerName(retAddrDst).c_str(), offset, location + offset); 1078 1073 break; 1079 1074 }
Note:
See TracChangeset
for help on using the changeset viewer.