Changeset 38428 in webkit for trunk/JavaScriptCore/parser
- Timestamp:
- Nov 15, 2008, 1:37:49 PM (17 years ago)
- Location:
- trunk/JavaScriptCore/parser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/parser/Nodes.cpp
r38427 r38428 1094 1094 { 1095 1095 RegisterID* src = generator.emitNode(m_expr.get()); 1096 return generator.emitUnaryOp( bytecode(), generator.finalDestination(dst), src, m_expr->resultDescriptor());1096 return generator.emitUnaryOp(opcodeID(), generator.finalDestination(dst), src, m_expr->resultDescriptor()); 1097 1097 } 1098 1098 … … 1112 1112 RegisterID* BinaryOpNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst) 1113 1113 { 1114 BytecodeID bytecode = this->bytecode();1115 if ( bytecode== op_neq) {1114 OpcodeID opcodeID = this->opcodeID(); 1115 if (opcodeID == op_neq) { 1116 1116 if (m_expr1->isNull() || m_expr2->isNull()) { 1117 1117 RefPtr<RegisterID> src = generator.emitNode(dst, m_expr1->isNull() ? m_expr2.get() : m_expr1.get()); … … 1122 1122 RefPtr<RegisterID> src1 = generator.emitNodeForLeftHandSide(m_expr1.get(), m_rightHasAssignments, m_expr2->isPure(generator)); 1123 1123 RegisterID* src2 = generator.emitNode(m_expr2.get()); 1124 return generator.emitBinaryOp( bytecode, generator.finalDestination(dst, src1.get()), src1.get(), src2, OperandTypes(m_expr1->resultDescriptor(), m_expr2->resultDescriptor()));1124 return generator.emitBinaryOp(opcodeID, generator.finalDestination(dst, src1.get()), src1.get(), src2, OperandTypes(m_expr1->resultDescriptor(), m_expr2->resultDescriptor())); 1125 1125 } 1126 1126 … … 1148 1148 RefPtr<RegisterID> src1 = generator.emitNodeForLeftHandSide(m_expr1.get(), m_rightHasAssignments, m_expr2->isPure(generator)); 1149 1149 RegisterID* src2 = generator.emitNode(m_expr2.get()); 1150 return generator.emitBinaryOp( bytecode(), generator.finalDestination(dst, src1.get()), src2, src1.get(), OperandTypes(m_expr2->resultDescriptor(), m_expr1->resultDescriptor()));1150 return generator.emitBinaryOp(opcodeID(), generator.finalDestination(dst, src1.get()), src2, src1.get(), OperandTypes(m_expr2->resultDescriptor(), m_expr1->resultDescriptor())); 1151 1151 } 1152 1152 … … 1156 1156 RegisterID* src2 = generator.emitNode(m_expr2.get()); 1157 1157 generator.emitExpressionInfo(divot(), startOffset(), endOffset()); 1158 return generator.emitBinaryOp( bytecode(), generator.finalDestination(dst, src1.get()), src1.get(), src2, OperandTypes(m_expr1->resultDescriptor(), m_expr2->resultDescriptor()));1158 return generator.emitBinaryOp(opcodeID(), generator.finalDestination(dst, src1.get()), src1.get(), src2, OperandTypes(m_expr1->resultDescriptor(), m_expr2->resultDescriptor())); 1159 1159 } 1160 1160 … … 1249 1249 static ALWAYS_INLINE RegisterID* emitReadModifyAssignment(BytecodeGenerator& generator, RegisterID* dst, RegisterID* src1, RegisterID* src2, Operator oper, OperandTypes types) 1250 1250 { 1251 BytecodeID bytecode;1251 OpcodeID opcodeID; 1252 1252 switch (oper) { 1253 1253 case OpMultEq: 1254 bytecode= op_mul;1254 opcodeID = op_mul; 1255 1255 break; 1256 1256 case OpDivEq: 1257 bytecode= op_div;1257 opcodeID = op_div; 1258 1258 break; 1259 1259 case OpPlusEq: 1260 bytecode= op_add;1260 opcodeID = op_add; 1261 1261 break; 1262 1262 case OpMinusEq: 1263 bytecode= op_sub;1263 opcodeID = op_sub; 1264 1264 break; 1265 1265 case OpLShift: 1266 bytecode= op_lshift;1266 opcodeID = op_lshift; 1267 1267 break; 1268 1268 case OpRShift: 1269 bytecode= op_rshift;1269 opcodeID = op_rshift; 1270 1270 break; 1271 1271 case OpURShift: 1272 bytecode= op_urshift;1272 opcodeID = op_urshift; 1273 1273 break; 1274 1274 case OpAndEq: 1275 bytecode= op_bitand;1275 opcodeID = op_bitand; 1276 1276 break; 1277 1277 case OpXOrEq: 1278 bytecode= op_bitxor;1278 opcodeID = op_bitxor; 1279 1279 break; 1280 1280 case OpOrEq: 1281 bytecode= op_bitor;1281 opcodeID = op_bitor; 1282 1282 break; 1283 1283 case OpModEq: 1284 bytecode= op_mod;1284 opcodeID = op_mod; 1285 1285 break; 1286 1286 default: … … 1289 1289 } 1290 1290 1291 return generator.emitBinaryOp( bytecode, dst, src1, src2, types);1291 return generator.emitBinaryOp(opcodeID, dst, src1, src2, types); 1292 1292 } 1293 1293 … … 2390 2390 if (funcStack) 2391 2391 m_functionStack = *funcStack; 2392 #if ENABLE( BYTECODE_SAMPLING)2392 #if ENABLE(OPCODE_SAMPLING) 2393 2393 globalData->interpreter->sampler()->notifyOfScope(this); 2394 2394 #endif -
trunk/JavaScriptCore/parser/Nodes.h
r38427 r38428 1078 1078 1079 1079 virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0) JSC_FAST_CALL; 1080 virtual BytecodeID bytecode() const JSC_FAST_CALL = 0;1080 virtual OpcodeID opcodeID() const JSC_FAST_CALL = 0; 1081 1081 1082 1082 protected: … … 1093 1093 virtual ExpressionNode* stripUnaryPlus() { return m_expr.get(); } 1094 1094 1095 virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_to_jsnumber; }1095 virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_to_jsnumber; } 1096 1096 }; 1097 1097 … … 1103 1103 } 1104 1104 1105 virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_negate; }1105 virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_negate; } 1106 1106 }; 1107 1107 … … 1113 1113 } 1114 1114 1115 virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_bitnot; }1115 virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_bitnot; } 1116 1116 }; 1117 1117 … … 1123 1123 } 1124 1124 1125 virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_not; }1125 virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_not; } 1126 1126 }; 1127 1127 … … 1148 1148 1149 1149 virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0) JSC_FAST_CALL; 1150 virtual BytecodeID bytecode() const JSC_FAST_CALL = 0;1150 virtual OpcodeID opcodeID() const JSC_FAST_CALL = 0; 1151 1151 1152 1152 protected: … … 1178 1178 } 1179 1179 1180 virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_mul; }1180 virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_mul; } 1181 1181 }; 1182 1182 … … 1188 1188 } 1189 1189 1190 virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_div; }1190 virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_div; } 1191 1191 }; 1192 1192 … … 1198 1198 } 1199 1199 1200 virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_mod; }1200 virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_mod; } 1201 1201 }; 1202 1202 … … 1208 1208 } 1209 1209 1210 virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_add; }1210 virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_add; } 1211 1211 }; 1212 1212 … … 1218 1218 } 1219 1219 1220 virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_sub; }1220 virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_sub; } 1221 1221 }; 1222 1222 … … 1228 1228 } 1229 1229 1230 virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_lshift; }1230 virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_lshift; } 1231 1231 }; 1232 1232 … … 1238 1238 } 1239 1239 1240 virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_rshift; }1240 virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_rshift; } 1241 1241 }; 1242 1242 … … 1248 1248 } 1249 1249 1250 virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_urshift; }1250 virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_urshift; } 1251 1251 }; 1252 1252 … … 1258 1258 } 1259 1259 1260 virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_less; }1260 virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_less; } 1261 1261 }; 1262 1262 … … 1268 1268 } 1269 1269 1270 virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_less; }1270 virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_less; } 1271 1271 }; 1272 1272 … … 1278 1278 } 1279 1279 1280 virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_lesseq; }1280 virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_lesseq; } 1281 1281 }; 1282 1282 … … 1288 1288 } 1289 1289 1290 virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_lesseq; }1290 virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_lesseq; } 1291 1291 }; 1292 1292 … … 1311 1311 } 1312 1312 1313 virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_instanceof; }1313 virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_instanceof; } 1314 1314 1315 1315 virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0) JSC_FAST_CALL; … … 1323 1323 } 1324 1324 1325 virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_in; }1325 virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_in; } 1326 1326 }; 1327 1327 … … 1334 1334 1335 1335 virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0) JSC_FAST_CALL; 1336 virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_eq; }1336 virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_eq; } 1337 1337 }; 1338 1338 … … 1344 1344 } 1345 1345 1346 virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_neq; }1346 virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_neq; } 1347 1347 }; 1348 1348 … … 1355 1355 1356 1356 virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0) JSC_FAST_CALL; 1357 virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_stricteq; }1357 virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_stricteq; } 1358 1358 }; 1359 1359 … … 1365 1365 } 1366 1366 1367 virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_nstricteq; }1367 virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_nstricteq; } 1368 1368 }; 1369 1369 … … 1375 1375 } 1376 1376 1377 virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_bitand; }1377 virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_bitand; } 1378 1378 }; 1379 1379 … … 1385 1385 } 1386 1386 1387 virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_bitor; }1387 virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_bitor; } 1388 1388 }; 1389 1389 … … 1395 1395 } 1396 1396 1397 virtual BytecodeID bytecode() const JSC_FAST_CALL { return op_bitxor; }1397 virtual OpcodeID opcodeID() const JSC_FAST_CALL { return op_bitxor; } 1398 1398 }; 1399 1399
Note:
See TracChangeset
for help on using the changeset viewer.