| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1278 // Don't base result on EFLAGS when a NaN is involved. Instead | 1278 // Don't base result on EFLAGS when a NaN is involved. Instead |
| 1279 // jump to the unordered case, which produces a false value. | 1279 // jump to the unordered case, which produces a false value. |
| 1280 __ ucomisd(ToDoubleRegister(left), ToDoubleRegister(right)); | 1280 __ ucomisd(ToDoubleRegister(left), ToDoubleRegister(right)); |
| 1281 __ j(parity_even, &unordered, not_taken); | 1281 __ j(parity_even, &unordered, not_taken); |
| 1282 } else { | 1282 } else { |
| 1283 EmitCmpI(left, right); | 1283 EmitCmpI(left, right); |
| 1284 } | 1284 } |
| 1285 | 1285 |
| 1286 NearLabel done; | 1286 NearLabel done; |
| 1287 Condition cc = TokenToCondition(instr->op(), instr->is_double()); | 1287 Condition cc = TokenToCondition(instr->op(), instr->is_double()); |
| 1288 __ mov(ToRegister(result), Handle<Object>(Heap::true_value())); | 1288 __ mov(ToRegister(result), Factory::true_value()); |
| 1289 __ j(cc, &done); | 1289 __ j(cc, &done); |
| 1290 | 1290 |
| 1291 __ bind(&unordered); | 1291 __ bind(&unordered); |
| 1292 __ mov(ToRegister(result), Handle<Object>(Heap::false_value())); | 1292 __ mov(ToRegister(result), Factory::false_value()); |
| 1293 __ bind(&done); | 1293 __ bind(&done); |
| 1294 } | 1294 } |
| 1295 | 1295 |
| 1296 | 1296 |
| 1297 void LCodeGen::DoCmpIDAndBranch(LCmpIDAndBranch* instr) { | 1297 void LCodeGen::DoCmpIDAndBranch(LCmpIDAndBranch* instr) { |
| 1298 LOperand* left = instr->InputAt(0); | 1298 LOperand* left = instr->InputAt(0); |
| 1299 LOperand* right = instr->InputAt(1); | 1299 LOperand* right = instr->InputAt(1); |
| 1300 int false_block = chunk_->LookupDestination(instr->false_block_id()); | 1300 int false_block = chunk_->LookupDestination(instr->false_block_id()); |
| 1301 int true_block = chunk_->LookupDestination(instr->true_block_id()); | 1301 int true_block = chunk_->LookupDestination(instr->true_block_id()); |
| 1302 | 1302 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1313 EmitBranch(true_block, false_block, cc); | 1313 EmitBranch(true_block, false_block, cc); |
| 1314 } | 1314 } |
| 1315 | 1315 |
| 1316 | 1316 |
| 1317 void LCodeGen::DoCmpJSObjectEq(LCmpJSObjectEq* instr) { | 1317 void LCodeGen::DoCmpJSObjectEq(LCmpJSObjectEq* instr) { |
| 1318 Register left = ToRegister(instr->InputAt(0)); | 1318 Register left = ToRegister(instr->InputAt(0)); |
| 1319 Register right = ToRegister(instr->InputAt(1)); | 1319 Register right = ToRegister(instr->InputAt(1)); |
| 1320 Register result = ToRegister(instr->result()); | 1320 Register result = ToRegister(instr->result()); |
| 1321 | 1321 |
| 1322 __ cmp(left, Operand(right)); | 1322 __ cmp(left, Operand(right)); |
| 1323 __ mov(result, Handle<Object>(Heap::true_value())); | 1323 __ mov(result, Factory::true_value()); |
| 1324 NearLabel done; | 1324 NearLabel done; |
| 1325 __ j(equal, &done); | 1325 __ j(equal, &done); |
| 1326 __ mov(result, Handle<Object>(Heap::false_value())); | 1326 __ mov(result, Factory::false_value()); |
| 1327 __ bind(&done); | 1327 __ bind(&done); |
| 1328 } | 1328 } |
| 1329 | 1329 |
| 1330 | 1330 |
| 1331 void LCodeGen::DoCmpJSObjectEqAndBranch(LCmpJSObjectEqAndBranch* instr) { | 1331 void LCodeGen::DoCmpJSObjectEqAndBranch(LCmpJSObjectEqAndBranch* instr) { |
| 1332 Register left = ToRegister(instr->InputAt(0)); | 1332 Register left = ToRegister(instr->InputAt(0)); |
| 1333 Register right = ToRegister(instr->InputAt(1)); | 1333 Register right = ToRegister(instr->InputAt(1)); |
| 1334 int false_block = chunk_->LookupDestination(instr->false_block_id()); | 1334 int false_block = chunk_->LookupDestination(instr->false_block_id()); |
| 1335 int true_block = chunk_->LookupDestination(instr->true_block_id()); | 1335 int true_block = chunk_->LookupDestination(instr->true_block_id()); |
| 1336 | 1336 |
| 1337 __ cmp(left, Operand(right)); | 1337 __ cmp(left, Operand(right)); |
| 1338 EmitBranch(true_block, false_block, equal); | 1338 EmitBranch(true_block, false_block, equal); |
| 1339 } | 1339 } |
| 1340 | 1340 |
| 1341 | 1341 |
| 1342 void LCodeGen::DoIsNull(LIsNull* instr) { | 1342 void LCodeGen::DoIsNull(LIsNull* instr) { |
| 1343 Register reg = ToRegister(instr->InputAt(0)); | 1343 Register reg = ToRegister(instr->InputAt(0)); |
| 1344 Register result = ToRegister(instr->result()); | 1344 Register result = ToRegister(instr->result()); |
| 1345 | 1345 |
| 1346 // TODO(fsc): If the expression is known to be a smi, then it's | 1346 // TODO(fsc): If the expression is known to be a smi, then it's |
| 1347 // definitely not null. Materialize false. | 1347 // definitely not null. Materialize false. |
| 1348 | 1348 |
| 1349 __ cmp(reg, Factory::null_value()); | 1349 __ cmp(reg, Factory::null_value()); |
| 1350 if (instr->is_strict()) { | 1350 if (instr->is_strict()) { |
| 1351 __ mov(result, Handle<Object>(Heap::true_value())); | 1351 __ mov(result, Factory::true_value()); |
| 1352 NearLabel done; | 1352 NearLabel done; |
| 1353 __ j(equal, &done); | 1353 __ j(equal, &done); |
| 1354 __ mov(result, Handle<Object>(Heap::false_value())); | 1354 __ mov(result, Factory::false_value()); |
| 1355 __ bind(&done); | 1355 __ bind(&done); |
| 1356 } else { | 1356 } else { |
| 1357 NearLabel true_value, false_value, done; | 1357 NearLabel true_value, false_value, done; |
| 1358 __ j(equal, &true_value); | 1358 __ j(equal, &true_value); |
| 1359 __ cmp(reg, Factory::undefined_value()); | 1359 __ cmp(reg, Factory::undefined_value()); |
| 1360 __ j(equal, &true_value); | 1360 __ j(equal, &true_value); |
| 1361 __ test(reg, Immediate(kSmiTagMask)); | 1361 __ test(reg, Immediate(kSmiTagMask)); |
| 1362 __ j(zero, &false_value); | 1362 __ j(zero, &false_value); |
| 1363 // Check for undetectable objects by looking in the bit field in | 1363 // Check for undetectable objects by looking in the bit field in |
| 1364 // the map. The object has already been smi checked. | 1364 // the map. The object has already been smi checked. |
| 1365 Register scratch = result; | 1365 Register scratch = result; |
| 1366 __ mov(scratch, FieldOperand(reg, HeapObject::kMapOffset)); | 1366 __ mov(scratch, FieldOperand(reg, HeapObject::kMapOffset)); |
| 1367 __ movzx_b(scratch, FieldOperand(scratch, Map::kBitFieldOffset)); | 1367 __ movzx_b(scratch, FieldOperand(scratch, Map::kBitFieldOffset)); |
| 1368 __ test(scratch, Immediate(1 << Map::kIsUndetectable)); | 1368 __ test(scratch, Immediate(1 << Map::kIsUndetectable)); |
| 1369 __ j(not_zero, &true_value); | 1369 __ j(not_zero, &true_value); |
| 1370 __ bind(&false_value); | 1370 __ bind(&false_value); |
| 1371 __ mov(result, Handle<Object>(Heap::false_value())); | 1371 __ mov(result, Factory::false_value()); |
| 1372 __ jmp(&done); | 1372 __ jmp(&done); |
| 1373 __ bind(&true_value); | 1373 __ bind(&true_value); |
| 1374 __ mov(result, Handle<Object>(Heap::true_value())); | 1374 __ mov(result, Factory::true_value()); |
| 1375 __ bind(&done); | 1375 __ bind(&done); |
| 1376 } | 1376 } |
| 1377 } | 1377 } |
| 1378 | 1378 |
| 1379 | 1379 |
| 1380 void LCodeGen::DoIsNullAndBranch(LIsNullAndBranch* instr) { | 1380 void LCodeGen::DoIsNullAndBranch(LIsNullAndBranch* instr) { |
| 1381 Register reg = ToRegister(instr->InputAt(0)); | 1381 Register reg = ToRegister(instr->InputAt(0)); |
| 1382 | 1382 |
| 1383 // TODO(fsc): If the expression is known to be a smi, then it's | 1383 // TODO(fsc): If the expression is known to be a smi, then it's |
| 1384 // definitely not null. Jump to the false block. | 1384 // definitely not null. Jump to the false block. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1440 void LCodeGen::DoIsObject(LIsObject* instr) { | 1440 void LCodeGen::DoIsObject(LIsObject* instr) { |
| 1441 Register reg = ToRegister(instr->InputAt(0)); | 1441 Register reg = ToRegister(instr->InputAt(0)); |
| 1442 Register result = ToRegister(instr->result()); | 1442 Register result = ToRegister(instr->result()); |
| 1443 Register temp = ToRegister(instr->TempAt(0)); | 1443 Register temp = ToRegister(instr->TempAt(0)); |
| 1444 Label is_false, is_true, done; | 1444 Label is_false, is_true, done; |
| 1445 | 1445 |
| 1446 Condition true_cond = EmitIsObject(reg, result, temp, &is_false, &is_true); | 1446 Condition true_cond = EmitIsObject(reg, result, temp, &is_false, &is_true); |
| 1447 __ j(true_cond, &is_true); | 1447 __ j(true_cond, &is_true); |
| 1448 | 1448 |
| 1449 __ bind(&is_false); | 1449 __ bind(&is_false); |
| 1450 __ mov(result, Handle<Object>(Heap::false_value())); | 1450 __ mov(result, Factory::false_value()); |
| 1451 __ jmp(&done); | 1451 __ jmp(&done); |
| 1452 | 1452 |
| 1453 __ bind(&is_true); | 1453 __ bind(&is_true); |
| 1454 __ mov(result, Handle<Object>(Heap::true_value())); | 1454 __ mov(result, Factory::true_value()); |
| 1455 | 1455 |
| 1456 __ bind(&done); | 1456 __ bind(&done); |
| 1457 } | 1457 } |
| 1458 | 1458 |
| 1459 | 1459 |
| 1460 void LCodeGen::DoIsObjectAndBranch(LIsObjectAndBranch* instr) { | 1460 void LCodeGen::DoIsObjectAndBranch(LIsObjectAndBranch* instr) { |
| 1461 Register reg = ToRegister(instr->InputAt(0)); | 1461 Register reg = ToRegister(instr->InputAt(0)); |
| 1462 Register temp = ToRegister(instr->TempAt(0)); | 1462 Register temp = ToRegister(instr->TempAt(0)); |
| 1463 Register temp2 = ToRegister(instr->TempAt(1)); | 1463 Register temp2 = ToRegister(instr->TempAt(1)); |
| 1464 | 1464 |
| 1465 int true_block = chunk_->LookupDestination(instr->true_block_id()); | 1465 int true_block = chunk_->LookupDestination(instr->true_block_id()); |
| 1466 int false_block = chunk_->LookupDestination(instr->false_block_id()); | 1466 int false_block = chunk_->LookupDestination(instr->false_block_id()); |
| 1467 Label* true_label = chunk_->GetAssemblyLabel(true_block); | 1467 Label* true_label = chunk_->GetAssemblyLabel(true_block); |
| 1468 Label* false_label = chunk_->GetAssemblyLabel(false_block); | 1468 Label* false_label = chunk_->GetAssemblyLabel(false_block); |
| 1469 | 1469 |
| 1470 Condition true_cond = EmitIsObject(reg, temp, temp2, false_label, true_label); | 1470 Condition true_cond = EmitIsObject(reg, temp, temp2, false_label, true_label); |
| 1471 | 1471 |
| 1472 EmitBranch(true_block, false_block, true_cond); | 1472 EmitBranch(true_block, false_block, true_cond); |
| 1473 } | 1473 } |
| 1474 | 1474 |
| 1475 | 1475 |
| 1476 void LCodeGen::DoIsSmi(LIsSmi* instr) { | 1476 void LCodeGen::DoIsSmi(LIsSmi* instr) { |
| 1477 Operand input = ToOperand(instr->InputAt(0)); | 1477 Operand input = ToOperand(instr->InputAt(0)); |
| 1478 Register result = ToRegister(instr->result()); | 1478 Register result = ToRegister(instr->result()); |
| 1479 | 1479 |
| 1480 ASSERT(instr->hydrogen()->value()->representation().IsTagged()); | 1480 ASSERT(instr->hydrogen()->value()->representation().IsTagged()); |
| 1481 __ test(input, Immediate(kSmiTagMask)); | 1481 __ test(input, Immediate(kSmiTagMask)); |
| 1482 __ mov(result, Handle<Object>(Heap::true_value())); | 1482 __ mov(result, Factory::true_value()); |
| 1483 NearLabel done; | 1483 NearLabel done; |
| 1484 __ j(zero, &done); | 1484 __ j(zero, &done); |
| 1485 __ mov(result, Handle<Object>(Heap::false_value())); | 1485 __ mov(result, Factory::false_value()); |
| 1486 __ bind(&done); | 1486 __ bind(&done); |
| 1487 } | 1487 } |
| 1488 | 1488 |
| 1489 | 1489 |
| 1490 void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) { | 1490 void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) { |
| 1491 Operand input = ToOperand(instr->InputAt(0)); | 1491 Operand input = ToOperand(instr->InputAt(0)); |
| 1492 | 1492 |
| 1493 int true_block = chunk_->LookupDestination(instr->true_block_id()); | 1493 int true_block = chunk_->LookupDestination(instr->true_block_id()); |
| 1494 int false_block = chunk_->LookupDestination(instr->false_block_id()); | 1494 int false_block = chunk_->LookupDestination(instr->false_block_id()); |
| 1495 | 1495 |
| 1496 __ test(input, Immediate(kSmiTagMask)); | 1496 __ test(input, Immediate(kSmiTagMask)); |
| 1497 EmitBranch(true_block, false_block, zero); | 1497 EmitBranch(true_block, false_block, zero); |
| 1498 } | 1498 } |
| 1499 | 1499 |
| 1500 | 1500 |
| 1501 static InstanceType TestType(HHasInstanceType* instr) { | 1501 static InstanceType TestType(HHasInstanceType* instr) { |
| 1502 InstanceType from = instr->from(); | 1502 InstanceType from = instr->from(); |
| 1503 InstanceType to = instr->to(); | 1503 InstanceType to = instr->to(); |
| 1504 if (from == FIRST_TYPE) return to; | 1504 if (from == FIRST_TYPE) return to; |
| 1505 ASSERT(from == to || to == LAST_TYPE); | 1505 ASSERT(from == to || to == LAST_TYPE); |
| 1506 return from; | 1506 return from; |
| 1507 } | 1507 } |
| 1508 | 1508 |
| 1509 | 1509 |
| 1510 | |
| 1511 static Condition BranchCondition(HHasInstanceType* instr) { | 1510 static Condition BranchCondition(HHasInstanceType* instr) { |
| 1512 InstanceType from = instr->from(); | 1511 InstanceType from = instr->from(); |
| 1513 InstanceType to = instr->to(); | 1512 InstanceType to = instr->to(); |
| 1514 if (from == to) return equal; | 1513 if (from == to) return equal; |
| 1515 if (to == LAST_TYPE) return above_equal; | 1514 if (to == LAST_TYPE) return above_equal; |
| 1516 if (from == FIRST_TYPE) return below_equal; | 1515 if (from == FIRST_TYPE) return below_equal; |
| 1517 UNREACHABLE(); | 1516 UNREACHABLE(); |
| 1518 return equal; | 1517 return equal; |
| 1519 } | 1518 } |
| 1520 | 1519 |
| 1521 | 1520 |
| 1522 void LCodeGen::DoHasInstanceType(LHasInstanceType* instr) { | 1521 void LCodeGen::DoHasInstanceType(LHasInstanceType* instr) { |
| 1523 Register input = ToRegister(instr->InputAt(0)); | 1522 Register input = ToRegister(instr->InputAt(0)); |
| 1524 Register result = ToRegister(instr->result()); | 1523 Register result = ToRegister(instr->result()); |
| 1525 | 1524 |
| 1526 ASSERT(instr->hydrogen()->value()->representation().IsTagged()); | 1525 ASSERT(instr->hydrogen()->value()->representation().IsTagged()); |
| 1527 __ test(input, Immediate(kSmiTagMask)); | 1526 __ test(input, Immediate(kSmiTagMask)); |
| 1528 NearLabel done, is_false; | 1527 NearLabel done, is_false; |
| 1529 __ j(zero, &is_false); | 1528 __ j(zero, &is_false); |
| 1530 __ CmpObjectType(input, TestType(instr->hydrogen()), result); | 1529 __ CmpObjectType(input, TestType(instr->hydrogen()), result); |
| 1531 __ j(NegateCondition(BranchCondition(instr->hydrogen())), &is_false); | 1530 __ j(NegateCondition(BranchCondition(instr->hydrogen())), &is_false); |
| 1532 __ mov(result, Handle<Object>(Heap::true_value())); | 1531 __ mov(result, Factory::true_value()); |
| 1533 __ jmp(&done); | 1532 __ jmp(&done); |
| 1534 __ bind(&is_false); | 1533 __ bind(&is_false); |
| 1535 __ mov(result, Handle<Object>(Heap::false_value())); | 1534 __ mov(result, Factory::false_value()); |
| 1536 __ bind(&done); | 1535 __ bind(&done); |
| 1537 } | 1536 } |
| 1538 | 1537 |
| 1539 | 1538 |
| 1540 void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) { | 1539 void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) { |
| 1541 Register input = ToRegister(instr->InputAt(0)); | 1540 Register input = ToRegister(instr->InputAt(0)); |
| 1542 Register temp = ToRegister(instr->TempAt(0)); | 1541 Register temp = ToRegister(instr->TempAt(0)); |
| 1543 | 1542 |
| 1544 int true_block = chunk_->LookupDestination(instr->true_block_id()); | 1543 int true_block = chunk_->LookupDestination(instr->true_block_id()); |
| 1545 int false_block = chunk_->LookupDestination(instr->false_block_id()); | 1544 int false_block = chunk_->LookupDestination(instr->false_block_id()); |
| 1546 | 1545 |
| 1547 Label* false_label = chunk_->GetAssemblyLabel(false_block); | 1546 Label* false_label = chunk_->GetAssemblyLabel(false_block); |
| 1548 | 1547 |
| 1549 __ test(input, Immediate(kSmiTagMask)); | 1548 __ test(input, Immediate(kSmiTagMask)); |
| 1550 __ j(zero, false_label); | 1549 __ j(zero, false_label); |
| 1551 | 1550 |
| 1552 __ CmpObjectType(input, TestType(instr->hydrogen()), temp); | 1551 __ CmpObjectType(input, TestType(instr->hydrogen()), temp); |
| 1553 EmitBranch(true_block, false_block, BranchCondition(instr->hydrogen())); | 1552 EmitBranch(true_block, false_block, BranchCondition(instr->hydrogen())); |
| 1554 } | 1553 } |
| 1555 | 1554 |
| 1556 | 1555 |
| 1557 void LCodeGen::DoHasCachedArrayIndex(LHasCachedArrayIndex* instr) { | 1556 void LCodeGen::DoHasCachedArrayIndex(LHasCachedArrayIndex* instr) { |
| 1558 Register input = ToRegister(instr->InputAt(0)); | 1557 Register input = ToRegister(instr->InputAt(0)); |
| 1559 Register result = ToRegister(instr->result()); | 1558 Register result = ToRegister(instr->result()); |
| 1560 | 1559 |
| 1561 ASSERT(instr->hydrogen()->value()->representation().IsTagged()); | 1560 ASSERT(instr->hydrogen()->value()->representation().IsTagged()); |
| 1562 __ mov(result, Handle<Object>(Heap::true_value())); | 1561 __ mov(result, Factory::true_value()); |
| 1563 __ test(FieldOperand(input, String::kHashFieldOffset), | 1562 __ test(FieldOperand(input, String::kHashFieldOffset), |
| 1564 Immediate(String::kContainsCachedArrayIndexMask)); | 1563 Immediate(String::kContainsCachedArrayIndexMask)); |
| 1565 NearLabel done; | 1564 NearLabel done; |
| 1566 __ j(not_zero, &done); | 1565 __ j(not_zero, &done); |
| 1567 __ mov(result, Handle<Object>(Heap::false_value())); | 1566 __ mov(result, Factory::false_value()); |
| 1568 __ bind(&done); | 1567 __ bind(&done); |
| 1569 } | 1568 } |
| 1570 | 1569 |
| 1571 | 1570 |
| 1572 void LCodeGen::DoHasCachedArrayIndexAndBranch( | 1571 void LCodeGen::DoHasCachedArrayIndexAndBranch( |
| 1573 LHasCachedArrayIndexAndBranch* instr) { | 1572 LHasCachedArrayIndexAndBranch* instr) { |
| 1574 Register input = ToRegister(instr->InputAt(0)); | 1573 Register input = ToRegister(instr->InputAt(0)); |
| 1575 | 1574 |
| 1576 int true_block = chunk_->LookupDestination(instr->true_block_id()); | 1575 int true_block = chunk_->LookupDestination(instr->true_block_id()); |
| 1577 int false_block = chunk_->LookupDestination(instr->false_block_id()); | 1576 int false_block = chunk_->LookupDestination(instr->false_block_id()); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1646 Register temp = ToRegister(instr->TempAt(0)); | 1645 Register temp = ToRegister(instr->TempAt(0)); |
| 1647 Handle<String> class_name = instr->hydrogen()->class_name(); | 1646 Handle<String> class_name = instr->hydrogen()->class_name(); |
| 1648 NearLabel done; | 1647 NearLabel done; |
| 1649 Label is_true, is_false; | 1648 Label is_true, is_false; |
| 1650 | 1649 |
| 1651 EmitClassOfTest(&is_true, &is_false, class_name, input, temp, input); | 1650 EmitClassOfTest(&is_true, &is_false, class_name, input, temp, input); |
| 1652 | 1651 |
| 1653 __ j(not_equal, &is_false); | 1652 __ j(not_equal, &is_false); |
| 1654 | 1653 |
| 1655 __ bind(&is_true); | 1654 __ bind(&is_true); |
| 1656 __ mov(result, Handle<Object>(Heap::true_value())); | 1655 __ mov(result, Factory::true_value()); |
| 1657 __ jmp(&done); | 1656 __ jmp(&done); |
| 1658 | 1657 |
| 1659 __ bind(&is_false); | 1658 __ bind(&is_false); |
| 1660 __ mov(result, Handle<Object>(Heap::false_value())); | 1659 __ mov(result, Factory::false_value()); |
| 1661 __ bind(&done); | 1660 __ bind(&done); |
| 1662 } | 1661 } |
| 1663 | 1662 |
| 1664 | 1663 |
| 1665 void LCodeGen::DoClassOfTestAndBranch(LClassOfTestAndBranch* instr) { | 1664 void LCodeGen::DoClassOfTestAndBranch(LClassOfTestAndBranch* instr) { |
| 1666 Register input = ToRegister(instr->InputAt(0)); | 1665 Register input = ToRegister(instr->InputAt(0)); |
| 1667 Register temp = ToRegister(instr->TempAt(0)); | 1666 Register temp = ToRegister(instr->TempAt(0)); |
| 1668 Register temp2 = ToRegister(instr->TempAt(1)); | 1667 Register temp2 = ToRegister(instr->TempAt(1)); |
| 1669 if (input.is(temp)) { | 1668 if (input.is(temp)) { |
| 1670 // Swap. | 1669 // Swap. |
| (...skipping 1614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3285 Label true_label; | 3284 Label true_label; |
| 3286 Label false_label; | 3285 Label false_label; |
| 3287 NearLabel done; | 3286 NearLabel done; |
| 3288 | 3287 |
| 3289 Condition final_branch_condition = EmitTypeofIs(&true_label, | 3288 Condition final_branch_condition = EmitTypeofIs(&true_label, |
| 3290 &false_label, | 3289 &false_label, |
| 3291 input, | 3290 input, |
| 3292 instr->type_literal()); | 3291 instr->type_literal()); |
| 3293 __ j(final_branch_condition, &true_label); | 3292 __ j(final_branch_condition, &true_label); |
| 3294 __ bind(&false_label); | 3293 __ bind(&false_label); |
| 3295 __ mov(result, Handle<Object>(Heap::false_value())); | 3294 __ mov(result, Factory::false_value()); |
| 3296 __ jmp(&done); | 3295 __ jmp(&done); |
| 3297 | 3296 |
| 3298 __ bind(&true_label); | 3297 __ bind(&true_label); |
| 3299 __ mov(result, Handle<Object>(Heap::true_value())); | 3298 __ mov(result, Factory::true_value()); |
| 3300 | 3299 |
| 3301 __ bind(&done); | 3300 __ bind(&done); |
| 3302 } | 3301 } |
| 3303 | 3302 |
| 3304 | 3303 |
| 3305 void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) { | 3304 void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) { |
| 3306 Register input = ToRegister(instr->InputAt(0)); | 3305 Register input = ToRegister(instr->InputAt(0)); |
| 3307 int true_block = chunk_->LookupDestination(instr->true_block_id()); | 3306 int true_block = chunk_->LookupDestination(instr->true_block_id()); |
| 3308 int false_block = chunk_->LookupDestination(instr->false_block_id()); | 3307 int false_block = chunk_->LookupDestination(instr->false_block_id()); |
| 3309 Label* true_label = chunk_->GetAssemblyLabel(true_block); | 3308 Label* true_label = chunk_->GetAssemblyLabel(true_block); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 3334 __ test(input, Immediate(kSmiTagMask)); | 3333 __ test(input, Immediate(kSmiTagMask)); |
| 3335 __ j(zero, false_label); | 3334 __ j(zero, false_label); |
| 3336 __ mov(input, FieldOperand(input, HeapObject::kMapOffset)); | 3335 __ mov(input, FieldOperand(input, HeapObject::kMapOffset)); |
| 3337 __ test_b(FieldOperand(input, Map::kBitFieldOffset), | 3336 __ test_b(FieldOperand(input, Map::kBitFieldOffset), |
| 3338 1 << Map::kIsUndetectable); | 3337 1 << Map::kIsUndetectable); |
| 3339 __ j(not_zero, false_label); | 3338 __ j(not_zero, false_label); |
| 3340 __ CmpInstanceType(input, FIRST_NONSTRING_TYPE); | 3339 __ CmpInstanceType(input, FIRST_NONSTRING_TYPE); |
| 3341 final_branch_condition = below; | 3340 final_branch_condition = below; |
| 3342 | 3341 |
| 3343 } else if (type_name->Equals(Heap::boolean_symbol())) { | 3342 } else if (type_name->Equals(Heap::boolean_symbol())) { |
| 3344 __ cmp(input, Handle<Object>(Heap::true_value())); | 3343 __ cmp(input, Factory::true_value()); |
| 3345 __ j(equal, true_label); | 3344 __ j(equal, true_label); |
| 3346 __ cmp(input, Handle<Object>(Heap::false_value())); | 3345 __ cmp(input, Factory::false_value()); |
| 3347 final_branch_condition = equal; | 3346 final_branch_condition = equal; |
| 3348 | 3347 |
| 3349 } else if (type_name->Equals(Heap::undefined_symbol())) { | 3348 } else if (type_name->Equals(Heap::undefined_symbol())) { |
| 3350 __ cmp(input, Factory::undefined_value()); | 3349 __ cmp(input, Factory::undefined_value()); |
| 3351 __ j(equal, true_label); | 3350 __ j(equal, true_label); |
| 3352 __ test(input, Immediate(kSmiTagMask)); | 3351 __ test(input, Immediate(kSmiTagMask)); |
| 3353 __ j(zero, false_label); | 3352 __ j(zero, false_label); |
| 3354 // Check for undetectable objects => true. | 3353 // Check for undetectable objects => true. |
| 3355 __ mov(input, FieldOperand(input, HeapObject::kMapOffset)); | 3354 __ mov(input, FieldOperand(input, HeapObject::kMapOffset)); |
| 3356 __ test_b(FieldOperand(input, Map::kBitFieldOffset), | 3355 __ test_b(FieldOperand(input, Map::kBitFieldOffset), |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3450 ASSERT(osr_pc_offset_ == -1); | 3449 ASSERT(osr_pc_offset_ == -1); |
| 3451 osr_pc_offset_ = masm()->pc_offset(); | 3450 osr_pc_offset_ = masm()->pc_offset(); |
| 3452 } | 3451 } |
| 3453 | 3452 |
| 3454 | 3453 |
| 3455 #undef __ | 3454 #undef __ |
| 3456 | 3455 |
| 3457 } } // namespace v8::internal | 3456 } } // namespace v8::internal |
| 3458 | 3457 |
| 3459 #endif // V8_TARGET_ARCH_IA32 | 3458 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |