Changeset 36036 in webkit for trunk/JavaScriptCore/VM/Machine.cpp
- Timestamp:
- Sep 2, 2008, 7:58:14 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/VM/Machine.cpp
r36032 r36036 1418 1418 NEXT_OPCODE; 1419 1419 } 1420 BEGIN_OPCODE(op_eq_null) { 1421 /* neq dst(r) src(r) 1422 1423 Checks whether register src is null, as with the ECMAScript '!=' 1424 operator, and puts the result as a boolean in register dst. 1425 */ 1426 int dst = (++vPC)->u.operand; 1427 JSValue* src = r[(++vPC)->u.operand].jsValue(exec); 1428 1429 if (src->isNull()) { 1430 r[dst] = jsBoolean(true); 1431 ++vPC; 1432 NEXT_OPCODE; 1433 } 1434 1435 if (src->isUndefined()) { 1436 r[dst] = jsBoolean(true); 1437 ++vPC; 1438 NEXT_OPCODE; 1439 } 1440 1441 r[dst] = jsBoolean(!JSImmediate::isImmediate(src) && static_cast<JSCell*>(src)->masqueradeAsUndefined()); 1442 ++vPC; 1443 NEXT_OPCODE; 1444 } 1420 1445 BEGIN_OPCODE(op_neq) { 1421 1446 /* neq dst(r) src1(r) src2(r) … … 1436 1461 } 1437 1462 1463 ++vPC; 1464 NEXT_OPCODE; 1465 } 1466 BEGIN_OPCODE(op_neq_null) { 1467 /* neq dst(r) src(r) 1468 1469 Checks whether register src is not null, as with the ECMAScript '!=' 1470 operator, and puts the result as a boolean in register dst. 1471 */ 1472 int dst = (++vPC)->u.operand; 1473 JSValue* src = r[(++vPC)->u.operand].jsValue(exec); 1474 1475 if (src->isNull()) { 1476 r[dst] = jsBoolean(false); 1477 ++vPC; 1478 NEXT_OPCODE; 1479 } 1480 1481 if (src->isUndefined()) { 1482 r[dst] = jsBoolean(false); 1483 ++vPC; 1484 NEXT_OPCODE; 1485 } 1486 1487 r[dst] = jsBoolean(JSImmediate::isImmediate(src) || !static_cast<JSCell*>(src)->masqueradeAsUndefined()); 1438 1488 ++vPC; 1439 1489 NEXT_OPCODE;
Note:
See TracChangeset
for help on using the changeset viewer.