Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1647)

Side by Side Diff: src/ia32/lithium-ia32.cc

Issue 7237024: Refactor handling of test expressions in the graph builder. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 } 331 }
338 332
339 333
340 void LCallNew::PrintDataTo(StringStream* stream) { 334 void LCallNew::PrintDataTo(StringStream* stream) {
341 stream->Add("= "); 335 stream->Add("= ");
342 InputAt(0)->PrintTo(stream); 336 InputAt(0)->PrintTo(stream);
343 stream->Add(" #%d / ", arity()); 337 stream->Add(" #%d / ", arity());
344 } 338 }
345 339
346 340
347 void LClassOfTest::PrintDataTo(StringStream* stream) {
348 stream->Add("= class_of_test(");
349 InputAt(0)->PrintTo(stream);
350 stream->Add(", \"%o\")", *hydrogen()->class_name());
351 }
352
353
354 void LAccessArgumentsAt::PrintDataTo(StringStream* stream) { 341 void LAccessArgumentsAt::PrintDataTo(StringStream* stream) {
355 arguments()->PrintTo(stream); 342 arguments()->PrintTo(stream);
356 343
357 stream->Add(" length "); 344 stream->Add(" length ");
358 length()->PrintTo(stream); 345 length()->PrintTo(stream);
359 346
360 stream->Add(" index "); 347 stream->Add(" index ");
361 index()->PrintTo(stream); 348 index()->PrintTo(stream);
362 } 349 }
363 350
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 TempRegister());
1054 } else if (v->IsCompare()) {
1055 HCompare* compare = HCompare::cast(v);
1056 HValue* left = compare->left();
1057 HValue* right = compare->right();
1058 Representation r = compare->GetInputRepresentation();
1059 if (r.IsInteger32()) {
1060 ASSERT(left->representation().IsInteger32());
1061 ASSERT(right->representation().IsInteger32());
1062 return new LCmpIDAndBranch(UseRegisterAtStart(left),
1063 UseOrConstantAtStart(right));
1064 } else {
1065 ASSERT(r.IsDouble());
1066 ASSERT(left->representation().IsDouble());
1067 ASSERT(right->representation().IsDouble());
1068 return new LCmpIDAndBranch(UseRegisterAtStart(left),
1069 UseRegisterAtStart(right));
1070 }
1071 } else if (v->IsIsSmi()) {
1072 HIsSmi* compare = HIsSmi::cast(v);
1073 ASSERT(compare->value()->representation().IsTagged());
1074 return new LIsSmiAndBranch(Use(compare->value()));
1075 } else if (v->IsIsUndetectable()) {
1076 HIsUndetectable* compare = HIsUndetectable::cast(v);
1077 ASSERT(compare->value()->representation().IsTagged());
1078 return new LIsUndetectableAndBranch(UseRegisterAtStart(compare->value()),
1079 TempRegister());
1080 } else if (v->IsHasInstanceType()) {
1081 HHasInstanceType* compare = HHasInstanceType::cast(v);
1082 ASSERT(compare->value()->representation().IsTagged());
1083 return new LHasInstanceTypeAndBranch(UseRegisterAtStart(compare->value()),
1084 TempRegister());
1085 } else if (v->IsHasCachedArrayIndex()) {
1086 HHasCachedArrayIndex* compare = HHasCachedArrayIndex::cast(v);
1087 ASSERT(compare->value()->representation().IsTagged());
1088 return new LHasCachedArrayIndexAndBranch(
1089 UseRegisterAtStart(compare->value()));
1090 } else if (v->IsIsNull()) {
1091 HIsNull* compare = HIsNull::cast(v);
1092 ASSERT(compare->value()->representation().IsTagged());
1093 // We only need a temp register for non-strict compare.
1094 LOperand* temp = compare->is_strict() ? NULL : TempRegister();
1095 return new LIsNullAndBranch(UseRegisterAtStart(compare->value()), temp);
1096 } else if (v->IsIsObject()) {
1097 HIsObject* compare = HIsObject::cast(v);
1098 ASSERT(compare->value()->representation().IsTagged());
1099 LOperand* temp = TempRegister();
1100 return new LIsObjectAndBranch(UseRegister(compare->value()), temp);
1101 } else if (v->IsCompareObjectEq()) {
1102 HCompareObjectEq* compare = HCompareObjectEq::cast(v);
1103 return new LCmpObjectEqAndBranch(UseRegisterAtStart(compare->left()),
1104 UseRegisterAtStart(compare->right()));
1105 } else if (v->IsCompareConstantEq()) {
1106 HCompareConstantEq* compare = HCompareConstantEq::cast(v);
1107 return new LCmpConstantEqAndBranch(UseRegisterAtStart(compare->value()));
1108 } else if (v->IsTypeofIs()) {
1109 HTypeofIs* typeof_is = HTypeofIs::cast(v);
1110 return new LTypeofIsAndBranch(UseTempRegister(typeof_is->value()));
1111 } else if (v->IsIsConstructCall()) {
1112 return new LIsConstructCallAndBranch(TempRegister());
1113 } else if (v->IsConstant()) {
1114 HBasicBlock* successor = HConstant::cast(v)->ToBoolean() 1025 HBasicBlock* successor = HConstant::cast(v)->ToBoolean()
1115 ? instr->FirstSuccessor() 1026 ? instr->FirstSuccessor()
1116 : instr->SecondSuccessor(); 1027 : instr->SecondSuccessor();
1117 return new LGoto(successor->block_id()); 1028 return new LGoto(successor->block_id());
1118 } else {
1119 Abort("Undefined compare before branch");
1120 return NULL;
1121 } 1029 }
1030 return new LBranch(UseRegisterAtStart(v));
1122 } 1031 }
1123 1032
1124 1033
1125 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) { 1034 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) {
1126 ASSERT(instr->value()->representation().IsTagged()); 1035 ASSERT(instr->value()->representation().IsTagged());
1127 LOperand* value = UseRegisterAtStart(instr->value()); 1036 LOperand* value = UseRegisterAtStart(instr->value());
1128 return new LCmpMapAndBranch(value); 1037 return new LCmpMapAndBranch(value);
1129 } 1038 }
1130 1039
1131 1040
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
1482 LOperand* left = UseFixedDouble(instr->left(), xmm1); 1391 LOperand* left = UseFixedDouble(instr->left(), xmm1);
1483 LOperand* right = exponent_type.IsDouble() ? 1392 LOperand* right = exponent_type.IsDouble() ?
1484 UseFixedDouble(instr->right(), xmm2) : 1393 UseFixedDouble(instr->right(), xmm2) :
1485 UseFixed(instr->right(), eax); 1394 UseFixed(instr->right(), eax);
1486 LPower* result = new LPower(left, right); 1395 LPower* result = new LPower(left, right);
1487 return MarkAsCall(DefineFixedDouble(result, xmm3), instr, 1396 return MarkAsCall(DefineFixedDouble(result, xmm3), instr,
1488 CAN_DEOPTIMIZE_EAGERLY); 1397 CAN_DEOPTIMIZE_EAGERLY);
1489 } 1398 }
1490 1399
1491 1400
1492 LInstruction* LChunkBuilder::DoCompare(HCompare* instr) { 1401 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) {
1493 Token::Value op = instr->token(); 1402 Token::Value op = instr->token();
1403 ASSERT(instr->left()->representation().IsTagged());
1404 ASSERT(instr->right()->representation().IsTagged());
1405 bool reversed = (op == Token::GT || op == Token::LTE);
1406 LOperand* left = UseFixed(instr->left(), reversed ? eax : edx);
1407 LOperand* right = UseFixed(instr->right(), reversed ? edx : eax);
1408 LCmpT* result = new LCmpT(left, right);
1409 return MarkAsCall(DefineFixed(result, eax), instr);
1410 }
1411
1412
1413 LInstruction* LChunkBuilder::DoCompareIDAndBranch(
1414 HCompareIDAndBranch* instr) {
1494 Representation r = instr->GetInputRepresentation(); 1415 Representation r = instr->GetInputRepresentation();
1495 if (r.IsInteger32()) { 1416 if (r.IsInteger32()) {
1496 ASSERT(instr->left()->representation().IsInteger32()); 1417 ASSERT(instr->left()->representation().IsInteger32());
1497 ASSERT(instr->right()->representation().IsInteger32()); 1418 ASSERT(instr->right()->representation().IsInteger32());
1498 LOperand* left = UseRegisterAtStart(instr->left()); 1419 LOperand* left = UseRegisterAtStart(instr->left());
1499 LOperand* right = UseOrConstantAtStart(instr->right()); 1420 LOperand* right = UseOrConstantAtStart(instr->right());
1500 return DefineAsRegister(new LCmpID(left, right)); 1421 return new LCmpIDAndBranch(left, right);
1501 } else if (r.IsDouble()) { 1422 } else {
1423 ASSERT(r.IsDouble());
1502 ASSERT(instr->left()->representation().IsDouble()); 1424 ASSERT(instr->left()->representation().IsDouble());
1503 ASSERT(instr->right()->representation().IsDouble()); 1425 ASSERT(instr->right()->representation().IsDouble());
1504 LOperand* left = UseRegisterAtStart(instr->left()); 1426 LOperand* left = UseRegisterAtStart(instr->left());
1505 LOperand* right = UseRegisterAtStart(instr->right()); 1427 LOperand* right = UseRegisterAtStart(instr->right());
1506 return DefineAsRegister(new LCmpID(left, right)); 1428 return new LCmpIDAndBranch(left, right);
1507 } else {
1508 ASSERT(instr->left()->representation().IsTagged());
1509 ASSERT(instr->right()->representation().IsTagged());
1510 bool reversed = (op == Token::GT || op == Token::LTE);
1511 LOperand* left = UseFixed(instr->left(), reversed ? eax : edx);
1512 LOperand* right = UseFixed(instr->right(), reversed ? edx : eax);
1513 LCmpT* result = new LCmpT(left, right);
1514 return MarkAsCall(DefineFixed(result, eax), instr);
1515 } 1429 }
1516 } 1430 }
1517 1431
1518 1432
1519 LInstruction* LChunkBuilder::DoCompareObjectEq(HCompareObjectEq* instr) { 1433 LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch(
1434 HCompareObjectEqAndBranch* instr) {
1520 LOperand* left = UseRegisterAtStart(instr->left()); 1435 LOperand* left = UseRegisterAtStart(instr->left());
1521 LOperand* right = UseRegisterAtStart(instr->right()); 1436 LOperand* right = UseRegisterAtStart(instr->right());
1522 LCmpObjectEq* result = new LCmpObjectEq(left, right); 1437 return new LCmpObjectEqAndBranch(left, right);
1523 return DefineAsRegister(result);
1524 } 1438 }
1525 1439
1526 1440
1527 LInstruction* LChunkBuilder::DoCompareConstantEq( 1441 LInstruction* LChunkBuilder::DoCompareConstantEqAndBranch(
1528 HCompareConstantEq* instr) { 1442 HCompareConstantEqAndBranch* instr) {
1529 LOperand* left = UseRegisterAtStart(instr->value()); 1443 return new LCmpConstantEqAndBranch(UseRegisterAtStart(instr->value()));
1530 return DefineAsRegister(new LCmpConstantEq(left));
1531 } 1444 }
1532 1445
1533 1446
1534 LInstruction* LChunkBuilder::DoIsNull(HIsNull* instr) { 1447 LInstruction* LChunkBuilder::DoIsNullAndBranch(HIsNullAndBranch* instr) {
1535 ASSERT(instr->value()->representation().IsTagged()); 1448 // We only need a temp register for non-strict compare.
1536 LOperand* value = UseRegisterAtStart(instr->value()); 1449 LOperand* temp = instr->is_strict() ? NULL : TempRegister();
1537 1450 return new LIsNullAndBranch(UseRegisterAtStart(instr->value()), temp);
1538 return DefineAsRegister(new LIsNull(value));
1539 } 1451 }
1540 1452
1541 1453
1542 LInstruction* LChunkBuilder::DoIsObject(HIsObject* instr) { 1454 LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) {
1543 ASSERT(instr->value()->representation().IsTagged()); 1455 ASSERT(instr->value()->representation().IsTagged());
1544 LOperand* value = UseRegister(instr->value()); 1456 LOperand* temp = TempRegister();
1545 1457 return new LIsObjectAndBranch(UseRegister(instr->value()), temp);
1546 return DefineAsRegister(new LIsObject(value));
1547 } 1458 }
1548 1459
1549 1460
1550 LInstruction* LChunkBuilder::DoIsSmi(HIsSmi* instr) { 1461 LInstruction* LChunkBuilder::DoIsSmiAndBranch(HIsSmiAndBranch* instr) {
1551 ASSERT(instr->value()->representation().IsTagged()); 1462 ASSERT(instr->value()->representation().IsTagged());
1552 LOperand* value = UseAtStart(instr->value()); 1463 return new LIsSmiAndBranch(Use(instr->value()));
1553
1554 return DefineAsRegister(new LIsSmi(value));
1555 } 1464 }
1556 1465
1557 1466
1558 LInstruction* LChunkBuilder::DoIsUndetectable(HIsUndetectable* instr) { 1467 LInstruction* LChunkBuilder::DoIsUndetectableAndBranch(
1559 ASSERT(instr->value()->representation().IsTagged()); 1468 HIsUndetectableAndBranch* instr) {
1560 LOperand* value = UseRegisterAtStart(instr->value()); 1469 ASSERT(instr ->value()->representation().IsTagged());
1561 1470 return new LIsUndetectableAndBranch(UseRegisterAtStart(instr->value()),
1562 return DefineAsRegister(new LIsUndetectable(value)); 1471 TempRegister());
1563 } 1472 }
1564 1473
1565 1474
1566 LInstruction* LChunkBuilder::DoHasInstanceType(HHasInstanceType* instr) { 1475 LInstruction* LChunkBuilder::DoHasInstanceTypeAndBranch(
1476 HHasInstanceTypeAndBranch* instr) {
1567 ASSERT(instr->value()->representation().IsTagged()); 1477 ASSERT(instr->value()->representation().IsTagged());
1568 LOperand* value = UseRegisterAtStart(instr->value()); 1478 return new LHasInstanceTypeAndBranch(UseRegisterAtStart(instr->value()),
1569 1479 TempRegister());
1570 return DefineAsRegister(new LHasInstanceType(value));
1571 } 1480 }
1572 1481
1573 1482
1574 LInstruction* LChunkBuilder::DoGetCachedArrayIndex( 1483 LInstruction* LChunkBuilder::DoGetCachedArrayIndex(
1575 HGetCachedArrayIndex* instr) { 1484 HGetCachedArrayIndex* instr) {
1576 ASSERT(instr->value()->representation().IsTagged()); 1485 ASSERT(instr->value()->representation().IsTagged());
1577 LOperand* value = UseRegisterAtStart(instr->value()); 1486 LOperand* value = UseRegisterAtStart(instr->value());
1578 1487
1579 return DefineAsRegister(new LGetCachedArrayIndex(value)); 1488 return DefineAsRegister(new LGetCachedArrayIndex(value));
1580 } 1489 }
1581 1490
1582 1491
1583 LInstruction* LChunkBuilder::DoHasCachedArrayIndex( 1492 LInstruction* LChunkBuilder::DoHasCachedArrayIndexAndBranch(
1584 HHasCachedArrayIndex* instr) { 1493 HHasCachedArrayIndexAndBranch* instr) {
1585 ASSERT(instr->value()->representation().IsTagged()); 1494 ASSERT(instr->value()->representation().IsTagged());
1586 LOperand* value = UseRegister(instr->value()); 1495 return new LHasCachedArrayIndexAndBranch(
1587 1496 UseRegisterAtStart(instr->value()));
1588 return DefineAsRegister(new LHasCachedArrayIndex(value));
1589 } 1497 }
1590 1498
1591 1499
1592 LInstruction* LChunkBuilder::DoClassOfTest(HClassOfTest* instr) { 1500 LInstruction* LChunkBuilder::DoClassOfTestAndBranch(
1501 HClassOfTestAndBranch* instr) {
1593 ASSERT(instr->value()->representation().IsTagged()); 1502 ASSERT(instr->value()->representation().IsTagged());
1594 LOperand* value = UseTempRegister(instr->value()); 1503 return new LClassOfTestAndBranch(UseTempRegister(instr->value()),
1595 1504 TempRegister(),
1596 return DefineSameAsFirst(new LClassOfTest(value, TempRegister())); 1505 TempRegister());
1597 } 1506 }
1598 1507
1599 1508
1600 LInstruction* LChunkBuilder::DoJSArrayLength(HJSArrayLength* instr) { 1509 LInstruction* LChunkBuilder::DoJSArrayLength(HJSArrayLength* instr) {
1601 LOperand* array = UseRegisterAtStart(instr->value()); 1510 LOperand* array = UseRegisterAtStart(instr->value());
1602 return DefineAsRegister(new LJSArrayLength(array)); 1511 return DefineAsRegister(new LJSArrayLength(array));
1603 } 1512 }
1604 1513
1605 1514
1606 LInstruction* LChunkBuilder::DoFixedArrayLength(HFixedArrayLength* instr) { 1515 LInstruction* LChunkBuilder::DoFixedArrayLength(HFixedArrayLength* instr) {
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
2200 return MarkAsCall(DefineFixed(result, eax), instr); 2109 return MarkAsCall(DefineFixed(result, eax), instr);
2201 } 2110 }
2202 2111
2203 2112
2204 LInstruction* LChunkBuilder::DoTypeof(HTypeof* instr) { 2113 LInstruction* LChunkBuilder::DoTypeof(HTypeof* instr) {
2205 LTypeof* result = new LTypeof(UseAtStart(instr->value())); 2114 LTypeof* result = new LTypeof(UseAtStart(instr->value()));
2206 return MarkAsCall(DefineFixed(result, eax), instr); 2115 return MarkAsCall(DefineFixed(result, eax), instr);
2207 } 2116 }
2208 2117
2209 2118
2210 LInstruction* LChunkBuilder::DoTypeofIs(HTypeofIs* instr) { 2119 LInstruction* LChunkBuilder::DoTypeofIsAndBranch(HTypeofIsAndBranch* instr) {
2211 return DefineSameAsFirst(new LTypeofIs(UseRegister(instr->value()))); 2120 return new LTypeofIsAndBranch(UseTempRegister(instr->value()));
2212 } 2121 }
2213 2122
2214 2123
2215 LInstruction* LChunkBuilder::DoIsConstructCall(HIsConstructCall* instr) { 2124 LInstruction* LChunkBuilder::DoIsConstructCallAndBranch(
2216 return DefineAsRegister(new LIsConstructCall); 2125 HIsConstructCallAndBranch* instr) {
2126 return new LIsConstructCallAndBranch(TempRegister());
2217 } 2127 }
2218 2128
2219 2129
2220 LInstruction* LChunkBuilder::DoSimulate(HSimulate* instr) { 2130 LInstruction* LChunkBuilder::DoSimulate(HSimulate* instr) {
2221 HEnvironment* env = current_block_->last_environment(); 2131 HEnvironment* env = current_block_->last_environment();
2222 ASSERT(env != NULL); 2132 ASSERT(env != NULL);
2223 2133
2224 env->set_ast_id(instr->ast_id()); 2134 env->set_ast_id(instr->ast_id());
2225 2135
2226 env->Drop(instr->pop_count()); 2136 env->Drop(instr->pop_count());
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
2283 LOperand* key = UseOrConstantAtStart(instr->key()); 2193 LOperand* key = UseOrConstantAtStart(instr->key());
2284 LOperand* object = UseOrConstantAtStart(instr->object()); 2194 LOperand* object = UseOrConstantAtStart(instr->object());
2285 LIn* result = new LIn(key, object); 2195 LIn* result = new LIn(key, object);
2286 return MarkAsCall(DefineFixed(result, eax), instr); 2196 return MarkAsCall(DefineFixed(result, eax), instr);
2287 } 2197 }
2288 2198
2289 2199
2290 } } // namespace v8::internal 2200 } } // namespace v8::internal
2291 2201
2292 #endif // V8_TARGET_ARCH_IA32 2202 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« src/hydrogen.cc ('K') | « src/ia32/lithium-ia32.h ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698