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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 void LClassOfTestAndBranch::PrintDataTo(StringStream* stream) { | 260 void LClassOfTestAndBranch::PrintDataTo(StringStream* stream) { |
261 stream->Add("if class_of_test("); | 261 stream->Add("if class_of_test("); |
262 InputAt(0)->PrintTo(stream); | 262 InputAt(0)->PrintTo(stream); |
263 stream->Add(", \"%o\") then B%d else B%d", | 263 stream->Add(", \"%o\") then B%d else B%d", |
264 *hydrogen()->class_name(), | 264 *hydrogen()->class_name(), |
265 true_block_id(), | 265 true_block_id(), |
266 false_block_id()); | 266 false_block_id()); |
267 } | 267 } |
268 | 268 |
269 | 269 |
270 void LTypeofIs::PrintDataTo(StringStream* stream) { | |
271 InputAt(0)->PrintTo(stream); | |
272 stream->Add(" == \"%s\"", *hydrogen()->type_literal()->ToCString()); | |
273 } | |
274 | |
275 | |
276 void LTypeofIsAndBranch::PrintDataTo(StringStream* stream) { | 270 void LTypeofIsAndBranch::PrintDataTo(StringStream* stream) { |
277 stream->Add("if typeof "); | 271 stream->Add("if typeof "); |
278 InputAt(0)->PrintTo(stream); | 272 InputAt(0)->PrintTo(stream); |
279 stream->Add(" == \"%s\" then B%d else B%d", | 273 stream->Add(" == \"%s\" then B%d else B%d", |
280 *hydrogen()->type_literal()->ToCString(), | 274 *hydrogen()->type_literal()->ToCString(), |
281 true_block_id(), false_block_id()); | 275 true_block_id(), false_block_id()); |
282 } | 276 } |
283 | 277 |
284 | 278 |
285 void LCallConstantFunction::PrintDataTo(StringStream* stream) { | 279 void LCallConstantFunction::PrintDataTo(StringStream* stream) { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 } | 329 } |
336 | 330 |
337 | 331 |
338 void LCallNew::PrintDataTo(StringStream* stream) { | 332 void LCallNew::PrintDataTo(StringStream* stream) { |
339 stream->Add("= "); | 333 stream->Add("= "); |
340 InputAt(0)->PrintTo(stream); | 334 InputAt(0)->PrintTo(stream); |
341 stream->Add(" #%d / ", arity()); | 335 stream->Add(" #%d / ", arity()); |
342 } | 336 } |
343 | 337 |
344 | 338 |
345 void LClassOfTest::PrintDataTo(StringStream* stream) { | |
346 stream->Add("= class_of_test("); | |
347 InputAt(0)->PrintTo(stream); | |
348 stream->Add(", \"%o\")", *hydrogen()->class_name()); | |
349 } | |
350 | |
351 | |
352 void LAccessArgumentsAt::PrintDataTo(StringStream* stream) { | 339 void LAccessArgumentsAt::PrintDataTo(StringStream* stream) { |
353 arguments()->PrintTo(stream); | 340 arguments()->PrintTo(stream); |
354 | 341 |
355 stream->Add(" length "); | 342 stream->Add(" length "); |
356 length()->PrintTo(stream); | 343 length()->PrintTo(stream); |
357 | 344 |
358 stream->Add(" index "); | 345 stream->Add(" index "); |
359 index()->PrintTo(stream); | 346 index()->PrintTo(stream); |
360 } | 347 } |
361 | 348 |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
978 if (current->has_position()) position_ = current->position(); | 965 if (current->has_position()) position_ = current->position(); |
979 LInstruction* instr = current->CompileToLithium(this); | 966 LInstruction* instr = current->CompileToLithium(this); |
980 | 967 |
981 if (instr != NULL) { | 968 if (instr != NULL) { |
982 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) { | 969 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) { |
983 instr = AssignPointerMap(instr); | 970 instr = AssignPointerMap(instr); |
984 } | 971 } |
985 if (FLAG_stress_environments && !instr->HasEnvironment()) { | 972 if (FLAG_stress_environments && !instr->HasEnvironment()) { |
986 instr = AssignEnvironment(instr); | 973 instr = AssignEnvironment(instr); |
987 } | 974 } |
988 if (current->IsTest() && !instr->IsGoto()) { | 975 instr->set_hydrogen_value(current); |
989 ASSERT(instr->IsControl()); | |
990 HTest* test = HTest::cast(current); | |
991 instr->set_hydrogen_value(test->value()); | |
992 HBasicBlock* first = test->FirstSuccessor(); | |
993 HBasicBlock* second = test->SecondSuccessor(); | |
994 ASSERT(first != NULL && second != NULL); | |
995 instr->SetBranchTargets(first->block_id(), second->block_id()); | |
996 } else { | |
997 instr->set_hydrogen_value(current); | |
998 } | |
999 | |
1000 chunk_->AddInstruction(instr, current_block_); | 976 chunk_->AddInstruction(instr, current_block_); |
1001 } | 977 } |
1002 current_instruction_ = old_current; | 978 current_instruction_ = old_current; |
1003 } | 979 } |
1004 | 980 |
1005 | 981 |
1006 LEnvironment* LChunkBuilder::CreateEnvironment(HEnvironment* hydrogen_env) { | 982 LEnvironment* LChunkBuilder::CreateEnvironment(HEnvironment* hydrogen_env) { |
1007 if (hydrogen_env == NULL) return NULL; | 983 if (hydrogen_env == NULL) return NULL; |
1008 | 984 |
1009 LEnvironment* outer = CreateEnvironment(hydrogen_env->outer()); | 985 LEnvironment* outer = CreateEnvironment(hydrogen_env->outer()); |
(...skipping 24 matching lines...) Expand all Loading... |
1034 | 1010 |
1035 return result; | 1011 return result; |
1036 } | 1012 } |
1037 | 1013 |
1038 | 1014 |
1039 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) { | 1015 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) { |
1040 return new LGoto(instr->FirstSuccessor()->block_id()); | 1016 return new LGoto(instr->FirstSuccessor()->block_id()); |
1041 } | 1017 } |
1042 | 1018 |
1043 | 1019 |
1044 LInstruction* LChunkBuilder::DoTest(HTest* instr) { | 1020 LInstruction* LChunkBuilder::DoBranch(HBranch* instr) { |
1045 HValue* v = instr->value(); | 1021 HValue* v = instr->value(); |
1046 if (!v->EmitAtUses()) return new LBranch(UseRegisterAtStart(v)); | 1022 if (v->EmitAtUses()) { |
1047 ASSERT(!v->HasSideEffects()); | 1023 ASSERT(v->IsConstant()); |
1048 if (v->IsClassOfTest()) { | 1024 ASSERT(!v->representation().IsDouble()); |
1049 HClassOfTest* compare = HClassOfTest::cast(v); | |
1050 ASSERT(compare->value()->representation().IsTagged()); | |
1051 return new LClassOfTestAndBranch(UseTempRegister(compare->value()), | |
1052 TempRegister()); | |
1053 } else if (v->IsCompare()) { | |
1054 HCompare* compare = HCompare::cast(v); | |
1055 HValue* left = compare->left(); | |
1056 HValue* right = compare->right(); | |
1057 Representation r = compare->GetInputRepresentation(); | |
1058 if (r.IsInteger32()) { | |
1059 ASSERT(left->representation().IsInteger32()); | |
1060 ASSERT(right->representation().IsInteger32()); | |
1061 return new LCmpIDAndBranch(UseRegisterAtStart(left), | |
1062 UseOrConstantAtStart(right)); | |
1063 } else { | |
1064 ASSERT(r.IsDouble()); | |
1065 ASSERT(left->representation().IsDouble()); | |
1066 ASSERT(right->representation().IsDouble()); | |
1067 return new LCmpIDAndBranch(UseRegisterAtStart(left), | |
1068 UseRegisterAtStart(right)); | |
1069 } | |
1070 } else if (v->IsIsSmi()) { | |
1071 HIsSmi* compare = HIsSmi::cast(v); | |
1072 ASSERT(compare->value()->representation().IsTagged()); | |
1073 return new LIsSmiAndBranch(Use(compare->value())); | |
1074 } else if (v->IsIsUndetectable()) { | |
1075 HIsUndetectable* compare = HIsUndetectable::cast(v); | |
1076 ASSERT(compare->value()->representation().IsTagged()); | |
1077 return new LIsUndetectableAndBranch(UseRegisterAtStart(compare->value()), | |
1078 TempRegister()); | |
1079 } else if (v->IsHasInstanceType()) { | |
1080 HHasInstanceType* compare = HHasInstanceType::cast(v); | |
1081 ASSERT(compare->value()->representation().IsTagged()); | |
1082 return new LHasInstanceTypeAndBranch(UseRegisterAtStart(compare->value())); | |
1083 } else if (v->IsHasCachedArrayIndex()) { | |
1084 HHasCachedArrayIndex* compare = HHasCachedArrayIndex::cast(v); | |
1085 ASSERT(compare->value()->representation().IsTagged()); | |
1086 return new LHasCachedArrayIndexAndBranch( | |
1087 UseRegisterAtStart(compare->value())); | |
1088 } else if (v->IsIsNull()) { | |
1089 HIsNull* compare = HIsNull::cast(v); | |
1090 ASSERT(compare->value()->representation().IsTagged()); | |
1091 // We only need a temp register for non-strict compare. | |
1092 LOperand* temp = compare->is_strict() ? NULL : TempRegister(); | |
1093 return new LIsNullAndBranch(UseRegisterAtStart(compare->value()), temp); | |
1094 } else if (v->IsIsObject()) { | |
1095 HIsObject* compare = HIsObject::cast(v); | |
1096 ASSERT(compare->value()->representation().IsTagged()); | |
1097 return new LIsObjectAndBranch(UseRegisterAtStart(compare->value())); | |
1098 } else if (v->IsCompareObjectEq()) { | |
1099 HCompareObjectEq* compare = HCompareObjectEq::cast(v); | |
1100 return new LCmpObjectEqAndBranch(UseRegisterAtStart(compare->left()), | |
1101 UseRegisterAtStart(compare->right())); | |
1102 } else if (v->IsCompareConstantEq()) { | |
1103 HCompareConstantEq* compare = HCompareConstantEq::cast(v); | |
1104 return new LCmpConstantEqAndBranch(UseRegisterAtStart(compare->value())); | |
1105 } else if (v->IsTypeofIs()) { | |
1106 HTypeofIs* typeof_is = HTypeofIs::cast(v); | |
1107 return new LTypeofIsAndBranch(UseTempRegister(typeof_is->value())); | |
1108 } else if (v->IsIsConstructCall()) { | |
1109 return new LIsConstructCallAndBranch(TempRegister()); | |
1110 } else if (v->IsConstant()) { | |
1111 HBasicBlock* successor = HConstant::cast(v)->ToBoolean() | 1025 HBasicBlock* successor = HConstant::cast(v)->ToBoolean() |
1112 ? instr->FirstSuccessor() | 1026 ? instr->FirstSuccessor() |
1113 : instr->SecondSuccessor(); | 1027 : instr->SecondSuccessor(); |
1114 return new LGoto(successor->block_id()); | 1028 return new LGoto(successor->block_id()); |
1115 } else { | |
1116 Abort("Undefined compare before branch"); | |
1117 return NULL; | |
1118 } | 1029 } |
| 1030 return new LBranch(UseRegisterAtStart(v)); |
1119 } | 1031 } |
1120 | 1032 |
1121 | 1033 |
1122 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) { | 1034 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) { |
1123 ASSERT(instr->value()->representation().IsTagged()); | 1035 ASSERT(instr->value()->representation().IsTagged()); |
1124 LOperand* value = UseRegisterAtStart(instr->value()); | 1036 LOperand* value = UseRegisterAtStart(instr->value()); |
1125 return new LCmpMapAndBranch(value); | 1037 return new LCmpMapAndBranch(value); |
1126 } | 1038 } |
1127 | 1039 |
1128 | 1040 |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1461 UseFixed(instr->right(), rdx); | 1373 UseFixed(instr->right(), rdx); |
1462 #else | 1374 #else |
1463 UseFixed(instr->right(), rdi); | 1375 UseFixed(instr->right(), rdi); |
1464 #endif | 1376 #endif |
1465 LPower* result = new LPower(left, right); | 1377 LPower* result = new LPower(left, right); |
1466 return MarkAsCall(DefineFixedDouble(result, xmm1), instr, | 1378 return MarkAsCall(DefineFixedDouble(result, xmm1), instr, |
1467 CAN_DEOPTIMIZE_EAGERLY); | 1379 CAN_DEOPTIMIZE_EAGERLY); |
1468 } | 1380 } |
1469 | 1381 |
1470 | 1382 |
1471 LInstruction* LChunkBuilder::DoCompare(HCompare* instr) { | 1383 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) { |
1472 Token::Value op = instr->token(); | 1384 Token::Value op = instr->token(); |
| 1385 ASSERT(instr->left()->representation().IsTagged()); |
| 1386 ASSERT(instr->right()->representation().IsTagged()); |
| 1387 bool reversed = (op == Token::GT || op == Token::LTE); |
| 1388 LOperand* left = UseFixed(instr->left(), reversed ? rax : rdx); |
| 1389 LOperand* right = UseFixed(instr->right(), reversed ? rdx : rax); |
| 1390 LCmpT* result = new LCmpT(left, right); |
| 1391 return MarkAsCall(DefineFixed(result, rax), instr); |
| 1392 } |
| 1393 |
| 1394 |
| 1395 LInstruction* LChunkBuilder::DoCompareIDAndBranch( |
| 1396 HCompareIDAndBranch* instr) { |
1473 Representation r = instr->GetInputRepresentation(); | 1397 Representation r = instr->GetInputRepresentation(); |
1474 if (r.IsInteger32()) { | 1398 if (r.IsInteger32()) { |
1475 ASSERT(instr->left()->representation().IsInteger32()); | 1399 ASSERT(instr->left()->representation().IsInteger32()); |
1476 ASSERT(instr->right()->representation().IsInteger32()); | 1400 ASSERT(instr->right()->representation().IsInteger32()); |
1477 LOperand* left = UseRegisterAtStart(instr->left()); | 1401 LOperand* left = UseRegisterAtStart(instr->left()); |
1478 LOperand* right = UseOrConstantAtStart(instr->right()); | 1402 LOperand* right = UseOrConstantAtStart(instr->right()); |
1479 return DefineAsRegister(new LCmpID(left, right)); | 1403 return new LCmpIDAndBranch(left, right); |
1480 } else if (r.IsDouble()) { | 1404 } else { |
| 1405 ASSERT(r.IsDouble()); |
1481 ASSERT(instr->left()->representation().IsDouble()); | 1406 ASSERT(instr->left()->representation().IsDouble()); |
1482 ASSERT(instr->right()->representation().IsDouble()); | 1407 ASSERT(instr->right()->representation().IsDouble()); |
1483 LOperand* left = UseRegisterAtStart(instr->left()); | 1408 LOperand* left = UseRegisterAtStart(instr->left()); |
1484 LOperand* right = UseRegisterAtStart(instr->right()); | 1409 LOperand* right = UseRegisterAtStart(instr->right()); |
1485 return DefineAsRegister(new LCmpID(left, right)); | 1410 return new LCmpIDAndBranch(left, right); |
1486 } else { | |
1487 ASSERT(instr->left()->representation().IsTagged()); | |
1488 ASSERT(instr->right()->representation().IsTagged()); | |
1489 bool reversed = (op == Token::GT || op == Token::LTE); | |
1490 LOperand* left = UseFixed(instr->left(), reversed ? rax : rdx); | |
1491 LOperand* right = UseFixed(instr->right(), reversed ? rdx : rax); | |
1492 LCmpT* result = new LCmpT(left, right); | |
1493 return MarkAsCall(DefineFixed(result, rax), instr); | |
1494 } | 1411 } |
1495 } | 1412 } |
1496 | 1413 |
1497 | 1414 |
1498 LInstruction* LChunkBuilder::DoCompareObjectEq(HCompareObjectEq* instr) { | 1415 LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch( |
| 1416 HCompareObjectEqAndBranch* instr) { |
1499 LOperand* left = UseRegisterAtStart(instr->left()); | 1417 LOperand* left = UseRegisterAtStart(instr->left()); |
1500 LOperand* right = UseRegisterAtStart(instr->right()); | 1418 LOperand* right = UseRegisterAtStart(instr->right()); |
1501 LCmpObjectEq* result = new LCmpObjectEq(left, right); | 1419 return new LCmpObjectEqAndBranch(left, right); |
1502 return DefineAsRegister(result); | |
1503 } | 1420 } |
1504 | 1421 |
1505 | 1422 |
1506 LInstruction* LChunkBuilder::DoCompareConstantEq( | 1423 LInstruction* LChunkBuilder::DoCompareConstantEqAndBranch( |
1507 HCompareConstantEq* instr) { | 1424 HCompareConstantEqAndBranch* instr) { |
1508 LOperand* left = UseRegisterAtStart(instr->value()); | 1425 return new LCmpConstantEqAndBranch(UseRegisterAtStart(instr->value())); |
1509 return DefineAsRegister(new LCmpConstantEq(left)); | |
1510 } | 1426 } |
1511 | 1427 |
1512 | 1428 |
1513 LInstruction* LChunkBuilder::DoIsNull(HIsNull* instr) { | 1429 LInstruction* LChunkBuilder::DoIsNullAndBranch(HIsNullAndBranch* instr) { |
1514 ASSERT(instr->value()->representation().IsTagged()); | 1430 ASSERT(instr->value()->representation().IsTagged()); |
1515 LOperand* value = UseRegisterAtStart(instr->value()); | 1431 LOperand* temp = instr->is_strict() ? NULL : TempRegister(); |
1516 | 1432 return new LIsNullAndBranch(UseRegisterAtStart(instr->value()), temp); |
1517 return DefineAsRegister(new LIsNull(value)); | |
1518 } | 1433 } |
1519 | 1434 |
1520 | 1435 |
1521 LInstruction* LChunkBuilder::DoIsObject(HIsObject* instr) { | 1436 LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) { |
1522 ASSERT(instr->value()->representation().IsTagged()); | 1437 ASSERT(instr->value()->representation().IsTagged()); |
1523 LOperand* value = UseRegister(instr->value()); | 1438 return new LIsObjectAndBranch(UseRegisterAtStart(instr->value())); |
1524 | |
1525 return DefineAsRegister(new LIsObject(value)); | |
1526 } | 1439 } |
1527 | 1440 |
1528 | 1441 |
1529 LInstruction* LChunkBuilder::DoIsSmi(HIsSmi* instr) { | 1442 LInstruction* LChunkBuilder::DoIsSmiAndBranch(HIsSmiAndBranch* instr) { |
1530 ASSERT(instr->value()->representation().IsTagged()); | 1443 ASSERT(instr->value()->representation().IsTagged()); |
1531 LOperand* value = UseAtStart(instr->value()); | 1444 return new LIsSmiAndBranch(Use(instr->value())); |
1532 | |
1533 return DefineAsRegister(new LIsSmi(value)); | |
1534 } | 1445 } |
1535 | 1446 |
1536 | 1447 |
1537 LInstruction* LChunkBuilder::DoIsUndetectable(HIsUndetectable* instr) { | 1448 LInstruction* LChunkBuilder::DoIsUndetectableAndBranch( |
| 1449 HIsUndetectableAndBranch* instr) { |
1538 ASSERT(instr->value()->representation().IsTagged()); | 1450 ASSERT(instr->value()->representation().IsTagged()); |
1539 LOperand* value = UseRegisterAtStart(instr->value()); | 1451 return new LIsUndetectableAndBranch(UseRegisterAtStart(instr->value()), |
1540 | 1452 TempRegister()); |
1541 return DefineAsRegister(new LIsUndetectable(value)); | |
1542 } | 1453 } |
1543 | 1454 |
1544 | 1455 |
1545 LInstruction* LChunkBuilder::DoHasInstanceType(HHasInstanceType* instr) { | 1456 LInstruction* LChunkBuilder::DoHasInstanceTypeAndBranch( |
| 1457 HHasInstanceTypeAndBranch* instr) { |
1546 ASSERT(instr->value()->representation().IsTagged()); | 1458 ASSERT(instr->value()->representation().IsTagged()); |
1547 LOperand* value = UseRegisterAtStart(instr->value()); | 1459 return new LHasInstanceTypeAndBranch(UseRegisterAtStart(instr->value())); |
1548 | |
1549 return DefineAsRegister(new LHasInstanceType(value)); | |
1550 } | 1460 } |
1551 | 1461 |
1552 | 1462 |
1553 LInstruction* LChunkBuilder::DoGetCachedArrayIndex( | 1463 LInstruction* LChunkBuilder::DoGetCachedArrayIndex( |
1554 HGetCachedArrayIndex* instr) { | 1464 HGetCachedArrayIndex* instr) { |
1555 ASSERT(instr->value()->representation().IsTagged()); | 1465 ASSERT(instr->value()->representation().IsTagged()); |
1556 LOperand* value = UseRegisterAtStart(instr->value()); | 1466 LOperand* value = UseRegisterAtStart(instr->value()); |
1557 | 1467 |
1558 return DefineAsRegister(new LGetCachedArrayIndex(value)); | 1468 return DefineAsRegister(new LGetCachedArrayIndex(value)); |
1559 } | 1469 } |
1560 | 1470 |
1561 | 1471 |
1562 LInstruction* LChunkBuilder::DoHasCachedArrayIndex( | 1472 LInstruction* LChunkBuilder::DoHasCachedArrayIndexAndBranch( |
1563 HHasCachedArrayIndex* instr) { | 1473 HHasCachedArrayIndexAndBranch* instr) { |
1564 ASSERT(instr->value()->representation().IsTagged()); | 1474 ASSERT(instr->value()->representation().IsTagged()); |
1565 LOperand* value = UseRegister(instr->value()); | 1475 return new LHasCachedArrayIndexAndBranch(UseRegisterAtStart(instr->value())); |
1566 return DefineAsRegister(new LHasCachedArrayIndex(value)); | |
1567 } | 1476 } |
1568 | 1477 |
1569 | 1478 |
1570 LInstruction* LChunkBuilder::DoClassOfTest(HClassOfTest* instr) { | 1479 LInstruction* LChunkBuilder::DoClassOfTestAndBranch( |
1571 Abort("Unimplemented: %s", "DoClassOfTest"); | 1480 HClassOfTestAndBranch* instr) { |
1572 return NULL; | 1481 return new LClassOfTestAndBranch(UseTempRegister(instr->value()), |
| 1482 TempRegister()); |
1573 } | 1483 } |
1574 | 1484 |
1575 | 1485 |
1576 LInstruction* LChunkBuilder::DoJSArrayLength(HJSArrayLength* instr) { | 1486 LInstruction* LChunkBuilder::DoJSArrayLength(HJSArrayLength* instr) { |
1577 LOperand* array = UseRegisterAtStart(instr->value()); | 1487 LOperand* array = UseRegisterAtStart(instr->value()); |
1578 return DefineAsRegister(new LJSArrayLength(array)); | 1488 return DefineAsRegister(new LJSArrayLength(array)); |
1579 } | 1489 } |
1580 | 1490 |
1581 | 1491 |
1582 LInstruction* LChunkBuilder::DoFixedArrayLength(HFixedArrayLength* instr) { | 1492 LInstruction* LChunkBuilder::DoFixedArrayLength(HFixedArrayLength* instr) { |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2145 return MarkAsCall(DefineFixed(result, rax), instr); | 2055 return MarkAsCall(DefineFixed(result, rax), instr); |
2146 } | 2056 } |
2147 | 2057 |
2148 | 2058 |
2149 LInstruction* LChunkBuilder::DoTypeof(HTypeof* instr) { | 2059 LInstruction* LChunkBuilder::DoTypeof(HTypeof* instr) { |
2150 LTypeof* result = new LTypeof(UseAtStart(instr->value())); | 2060 LTypeof* result = new LTypeof(UseAtStart(instr->value())); |
2151 return MarkAsCall(DefineFixed(result, rax), instr); | 2061 return MarkAsCall(DefineFixed(result, rax), instr); |
2152 } | 2062 } |
2153 | 2063 |
2154 | 2064 |
2155 LInstruction* LChunkBuilder::DoTypeofIs(HTypeofIs* instr) { | 2065 LInstruction* LChunkBuilder::DoTypeofIsAndBranch(HTypeofIsAndBranch* instr) { |
2156 return DefineSameAsFirst(new LTypeofIs(UseRegister(instr->value()))); | 2066 return new LTypeofIsAndBranch(UseTempRegister(instr->value())); |
2157 } | 2067 } |
2158 | 2068 |
2159 | 2069 |
2160 LInstruction* LChunkBuilder::DoIsConstructCall(HIsConstructCall* instr) { | 2070 LInstruction* LChunkBuilder::DoIsConstructCallAndBranch( |
2161 return DefineAsRegister(new LIsConstructCall); | 2071 HIsConstructCallAndBranch* instr) { |
| 2072 return new LIsConstructCallAndBranch(TempRegister()); |
2162 } | 2073 } |
2163 | 2074 |
2164 | 2075 |
2165 LInstruction* LChunkBuilder::DoSimulate(HSimulate* instr) { | 2076 LInstruction* LChunkBuilder::DoSimulate(HSimulate* instr) { |
2166 HEnvironment* env = current_block_->last_environment(); | 2077 HEnvironment* env = current_block_->last_environment(); |
2167 ASSERT(env != NULL); | 2078 ASSERT(env != NULL); |
2168 | 2079 |
2169 env->set_ast_id(instr->ast_id()); | 2080 env->set_ast_id(instr->ast_id()); |
2170 | 2081 |
2171 env->Drop(instr->pop_count()); | 2082 env->Drop(instr->pop_count()); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2227 LOperand* key = UseOrConstantAtStart(instr->key()); | 2138 LOperand* key = UseOrConstantAtStart(instr->key()); |
2228 LOperand* object = UseOrConstantAtStart(instr->object()); | 2139 LOperand* object = UseOrConstantAtStart(instr->object()); |
2229 LIn* result = new LIn(key, object); | 2140 LIn* result = new LIn(key, object); |
2230 return MarkAsCall(DefineFixed(result, rax), instr); | 2141 return MarkAsCall(DefineFixed(result, rax), instr); |
2231 } | 2142 } |
2232 | 2143 |
2233 | 2144 |
2234 } } // namespace v8::internal | 2145 } } // namespace v8::internal |
2235 | 2146 |
2236 #endif // V8_TARGET_ARCH_X64 | 2147 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |