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

Side by Side Diff: src/arm/lithium-arm.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: fixed bug in LBranch 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 void LClassOfTestAndBranch::PrintDataTo(StringStream* stream) { 258 void LClassOfTestAndBranch::PrintDataTo(StringStream* stream) {
259 stream->Add("if class_of_test("); 259 stream->Add("if class_of_test(");
260 InputAt(0)->PrintTo(stream); 260 InputAt(0)->PrintTo(stream);
261 stream->Add(", \"%o\") then B%d else B%d", 261 stream->Add(", \"%o\") then B%d else B%d",
262 *hydrogen()->class_name(), 262 *hydrogen()->class_name(),
263 true_block_id(), 263 true_block_id(),
264 false_block_id()); 264 false_block_id());
265 } 265 }
266 266
267 267
268 void LTypeofIs::PrintDataTo(StringStream* stream) {
269 InputAt(0)->PrintTo(stream);
270 stream->Add(" == \"%s\"", *hydrogen()->type_literal()->ToCString());
271 }
272
273
274 void LTypeofIsAndBranch::PrintDataTo(StringStream* stream) { 268 void LTypeofIsAndBranch::PrintDataTo(StringStream* stream) {
275 stream->Add("if typeof "); 269 stream->Add("if typeof ");
276 InputAt(0)->PrintTo(stream); 270 InputAt(0)->PrintTo(stream);
277 stream->Add(" == \"%s\" then B%d else B%d", 271 stream->Add(" == \"%s\" then B%d else B%d",
278 *hydrogen()->type_literal()->ToCString(), 272 *hydrogen()->type_literal()->ToCString(),
279 true_block_id(), false_block_id()); 273 true_block_id(), false_block_id());
280 } 274 }
281 275
282 276
283 void LCallConstantFunction::PrintDataTo(StringStream* stream) { 277 void LCallConstantFunction::PrintDataTo(StringStream* stream) {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 } 327 }
334 328
335 329
336 void LCallNew::PrintDataTo(StringStream* stream) { 330 void LCallNew::PrintDataTo(StringStream* stream) {
337 stream->Add("= "); 331 stream->Add("= ");
338 InputAt(0)->PrintTo(stream); 332 InputAt(0)->PrintTo(stream);
339 stream->Add(" #%d / ", arity()); 333 stream->Add(" #%d / ", arity());
340 } 334 }
341 335
342 336
343 void LClassOfTest::PrintDataTo(StringStream* stream) {
344 stream->Add("= class_of_test(");
345 InputAt(0)->PrintTo(stream);
346 stream->Add(", \"%o\")", *hydrogen()->class_name());
347 }
348
349
350 void LAccessArgumentsAt::PrintDataTo(StringStream* stream) { 337 void LAccessArgumentsAt::PrintDataTo(StringStream* stream) {
351 arguments()->PrintTo(stream); 338 arguments()->PrintTo(stream);
352 339
353 stream->Add(" length "); 340 stream->Add(" length ");
354 length()->PrintTo(stream); 341 length()->PrintTo(stream);
355 342
356 stream->Add(" index "); 343 stream->Add(" index ");
357 index()->PrintTo(stream); 344 index()->PrintTo(stream);
358 } 345 }
359 346
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
983 if (current->has_position()) position_ = current->position(); 970 if (current->has_position()) position_ = current->position();
984 LInstruction* instr = current->CompileToLithium(this); 971 LInstruction* instr = current->CompileToLithium(this);
985 972
986 if (instr != NULL) { 973 if (instr != NULL) {
987 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) { 974 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) {
988 instr = AssignPointerMap(instr); 975 instr = AssignPointerMap(instr);
989 } 976 }
990 if (FLAG_stress_environments && !instr->HasEnvironment()) { 977 if (FLAG_stress_environments && !instr->HasEnvironment()) {
991 instr = AssignEnvironment(instr); 978 instr = AssignEnvironment(instr);
992 } 979 }
993 if (current->IsTest() && !instr->IsGoto()) { 980 instr->set_hydrogen_value(current);
994 ASSERT(instr->IsControl());
995 HTest* test = HTest::cast(current);
996 instr->set_hydrogen_value(test->value());
997 HBasicBlock* first = test->FirstSuccessor();
998 HBasicBlock* second = test->SecondSuccessor();
999 ASSERT(first != NULL && second != NULL);
1000 instr->SetBranchTargets(first->block_id(), second->block_id());
1001 } else {
1002 instr->set_hydrogen_value(current);
1003 }
1004
1005 chunk_->AddInstruction(instr, current_block_); 981 chunk_->AddInstruction(instr, current_block_);
1006 } 982 }
1007 current_instruction_ = old_current; 983 current_instruction_ = old_current;
1008 } 984 }
1009 985
1010 986
1011 LEnvironment* LChunkBuilder::CreateEnvironment(HEnvironment* hydrogen_env) { 987 LEnvironment* LChunkBuilder::CreateEnvironment(HEnvironment* hydrogen_env) {
1012 if (hydrogen_env == NULL) return NULL; 988 if (hydrogen_env == NULL) return NULL;
1013 989
1014 LEnvironment* outer = CreateEnvironment(hydrogen_env->outer()); 990 LEnvironment* outer = CreateEnvironment(hydrogen_env->outer());
(...skipping 26 matching lines...) Expand all
1041 } 1017 }
1042 1018
1043 1019
1044 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) { 1020 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) {
1045 return new LGoto(instr->FirstSuccessor()->block_id()); 1021 return new LGoto(instr->FirstSuccessor()->block_id());
1046 } 1022 }
1047 1023
1048 1024
1049 LInstruction* LChunkBuilder::DoTest(HTest* instr) { 1025 LInstruction* LChunkBuilder::DoTest(HTest* instr) {
1050 HValue* v = instr->value(); 1026 HValue* v = instr->value();
1051 if (!v->EmitAtUses()) return new LBranch(UseRegisterAtStart(v)); 1027 if (v->EmitAtUses()) {
1052 ASSERT(!v->HasSideEffects());
1053 if (v->IsClassOfTest()) {
1054 HClassOfTest* compare = HClassOfTest::cast(v);
1055 ASSERT(compare->value()->representation().IsTagged());
1056 return new LClassOfTestAndBranch(UseTempRegister(compare->value()),
1057 TempRegister());
1058 } else if (v->IsCompare()) {
1059 HCompare* compare = HCompare::cast(v);
1060 HValue* left = compare->left();
1061 HValue* right = compare->right();
1062 Representation r = compare->GetInputRepresentation();
1063 if (r.IsInteger32()) {
1064 ASSERT(left->representation().IsInteger32());
1065 ASSERT(right->representation().IsInteger32());
1066 return new LCmpIDAndBranch(UseRegisterAtStart(left),
1067 UseRegisterAtStart(right));
1068 } else {
1069 ASSERT(r.IsDouble());
1070 ASSERT(left->representation().IsDouble());
1071 ASSERT(right->representation().IsDouble());
1072 return new LCmpIDAndBranch(UseRegisterAtStart(left),
1073 UseRegisterAtStart(right));
1074 }
1075 } else if (v->IsIsSmi()) {
1076 HIsSmi* compare = HIsSmi::cast(v);
1077 ASSERT(compare->value()->representation().IsTagged());
1078 return new LIsSmiAndBranch(Use(compare->value()));
1079 } else if (v->IsIsUndetectable()) {
1080 HIsUndetectable* compare = HIsUndetectable::cast(v);
1081 ASSERT(compare->value()->representation().IsTagged());
1082 return new LIsUndetectableAndBranch(UseRegisterAtStart(compare->value()),
1083 TempRegister());
1084 } else if (v->IsHasInstanceType()) {
1085 HHasInstanceType* compare = HHasInstanceType::cast(v);
1086 ASSERT(compare->value()->representation().IsTagged());
1087 return new LHasInstanceTypeAndBranch(UseRegisterAtStart(compare->value()));
1088 } else if (v->IsHasCachedArrayIndex()) {
1089 HHasCachedArrayIndex* compare = HHasCachedArrayIndex::cast(v);
1090 ASSERT(compare->value()->representation().IsTagged());
1091 return new LHasCachedArrayIndexAndBranch(
1092 UseRegisterAtStart(compare->value()));
1093 } else if (v->IsIsNull()) {
1094 HIsNull* compare = HIsNull::cast(v);
1095 ASSERT(compare->value()->representation().IsTagged());
1096 return new LIsNullAndBranch(UseRegisterAtStart(compare->value()));
1097 } else if (v->IsIsObject()) {
1098 HIsObject* compare = HIsObject::cast(v);
1099 ASSERT(compare->value()->representation().IsTagged());
1100 LOperand* temp = TempRegister();
1101 return new LIsObjectAndBranch(UseRegisterAtStart(compare->value()), temp);
1102 } else if (v->IsCompareObjectEq()) {
1103 HCompareObjectEq* compare = HCompareObjectEq::cast(v);
1104 return new LCmpObjectEqAndBranch(UseRegisterAtStart(compare->left()),
1105 UseRegisterAtStart(compare->right()));
1106 } else if (v->IsCompareConstantEq()) {
1107 HCompareConstantEq* compare = HCompareConstantEq::cast(v);
1108 return new LCmpConstantEqAndBranch(UseRegisterAtStart(compare->value()));
1109 } else if (v->IsTypeofIs()) {
1110 HTypeofIs* typeof_is = HTypeofIs::cast(v);
1111 return new LTypeofIsAndBranch(UseTempRegister(typeof_is->value()));
1112 } else if (v->IsIsConstructCall()) {
1113 return new LIsConstructCallAndBranch(TempRegister());
1114 } else if (v->IsConstant()) {
1115 HBasicBlock* successor = HConstant::cast(v)->ToBoolean() 1028 HBasicBlock* successor = HConstant::cast(v)->ToBoolean()
1116 ? instr->FirstSuccessor() 1029 ? instr->FirstSuccessor()
1117 : instr->SecondSuccessor(); 1030 : instr->SecondSuccessor();
1118 return new LGoto(successor->block_id()); 1031 return new LGoto(successor->block_id());
1119 } else {
1120 Abort("Undefined compare before branch");
1121 return NULL;
1122 } 1032 }
1033 return new LBranch(UseRegisterAtStart(v));
1123 } 1034 }
1124 1035
1125 1036
1126 1037
1127 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) { 1038 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) {
1128 ASSERT(instr->value()->representation().IsTagged()); 1039 ASSERT(instr->value()->representation().IsTagged());
1129 LOperand* value = UseRegisterAtStart(instr->value()); 1040 LOperand* value = UseRegisterAtStart(instr->value());
1130 LOperand* temp = TempRegister(); 1041 LOperand* temp = TempRegister();
1131 return new LCmpMapAndBranch(value, temp); 1042 return new LCmpMapAndBranch(value, temp);
1132 } 1043 }
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
1470 LOperand* right = exponent_type.IsDouble() ? 1381 LOperand* right = exponent_type.IsDouble() ?
1471 UseFixedDouble(instr->right(), d2) : 1382 UseFixedDouble(instr->right(), d2) :
1472 UseFixed(instr->right(), r0); 1383 UseFixed(instr->right(), r0);
1473 LPower* result = new LPower(left, right); 1384 LPower* result = new LPower(left, right);
1474 return MarkAsCall(DefineFixedDouble(result, d3), 1385 return MarkAsCall(DefineFixedDouble(result, d3),
1475 instr, 1386 instr,
1476 CAN_DEOPTIMIZE_EAGERLY); 1387 CAN_DEOPTIMIZE_EAGERLY);
1477 } 1388 }
1478 1389
1479 1390
1480 LInstruction* LChunkBuilder::DoCompare(HCompare* instr) { 1391 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) {
1481 Token::Value op = instr->token(); 1392 Token::Value op = instr->token();
1482 Representation r = instr->GetInputRepresentation(); 1393 Representation r = instr->GetInputRepresentation();
1394 ASSERT(instr->left()->representation().IsTagged());
1395 ASSERT(instr->right()->representation().IsTagged());
1396 bool reversed = (op == Token::GT || op == Token::LTE);
1397 LOperand* left = UseFixed(instr->left(), reversed ? r0 : r1);
1398 LOperand* right = UseFixed(instr->right(), reversed ? r1 : r0);
1399 LCmpT* result = new LCmpT(left, right);
1400 return MarkAsCall(DefineFixed(result, r0), instr);
1401 }
1402
1403
1404 LInstruction* LChunkBuilder::DoCompareIDAndBranch(
1405 HCompareIDAndBranch* instr) {
1406 HValue* left = instr->left();
1407 HValue* right = instr->right();
1408 Representation r = instr->GetInputRepresentation();
1483 if (r.IsInteger32()) { 1409 if (r.IsInteger32()) {
1484 ASSERT(instr->left()->representation().IsInteger32()); 1410 ASSERT(left->representation().IsInteger32());
1485 ASSERT(instr->right()->representation().IsInteger32()); 1411 ASSERT(right->representation().IsInteger32());
1486 LOperand* left = UseRegisterAtStart(instr->left()); 1412 return new LCmpIDAndBranch(UseRegisterAtStart(left),
Kevin Millikin (Chromium) 2011/06/30 10:52:03 I prefer to name the UseRegisterXXX subexpressions
fschneider 2011/06/30 13:13:36 I agree we should be consistent in this. It is a p
1487 LOperand* right = UseRegisterAtStart(instr->right()); 1413 UseRegisterAtStart(right));
1488 return DefineAsRegister(new LCmpID(left, right));
1489 } else if (r.IsDouble()) {
1490 ASSERT(instr->left()->representation().IsDouble());
1491 ASSERT(instr->right()->representation().IsDouble());
1492 LOperand* left = UseRegisterAtStart(instr->left());
1493 LOperand* right = UseRegisterAtStart(instr->right());
1494 return DefineAsRegister(new LCmpID(left, right));
1495 } else { 1414 } else {
1496 ASSERT(instr->left()->representation().IsTagged()); 1415 ASSERT(r.IsDouble());
1497 ASSERT(instr->right()->representation().IsTagged()); 1416 ASSERT(left->representation().IsDouble());
1498 bool reversed = (op == Token::GT || op == Token::LTE); 1417 ASSERT(right->representation().IsDouble());
1499 LOperand* left = UseFixed(instr->left(), reversed ? r0 : r1); 1418 return new LCmpIDAndBranch(UseRegisterAtStart(left),
1500 LOperand* right = UseFixed(instr->right(), reversed ? r1 : r0); 1419 UseRegisterAtStart(right));
1501 LCmpT* result = new LCmpT(left, right);
1502 return MarkAsCall(DefineFixed(result, r0), instr);
1503 } 1420 }
1504 } 1421 }
1505 1422
1506 1423
1507 LInstruction* LChunkBuilder::DoCompareObjectEq(HCompareObjectEq* instr) { 1424 LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch(
1508 LOperand* left = UseRegisterAtStart(instr->left()); 1425 HCompareObjectEqAndBranch* instr) {
1509 LOperand* right = UseRegisterAtStart(instr->right()); 1426 return new LCmpObjectEqAndBranch(UseRegisterAtStart(instr->left()),
1510 LCmpObjectEq* result = new LCmpObjectEq(left, right); 1427 UseRegisterAtStart(instr->right()));
1511 return DefineAsRegister(result);
1512 } 1428 }
1513 1429
1514 1430
1515 LInstruction* LChunkBuilder::DoCompareConstantEq( 1431 LInstruction* LChunkBuilder::DoCompareConstantEqAndBranch(
1516 HCompareConstantEq* instr) { 1432 HCompareConstantEqAndBranch* instr) {
1517 LOperand* left = UseRegisterAtStart(instr->value()); 1433 return new LCmpConstantEqAndBranch(UseRegisterAtStart(instr->value()));
1518 return DefineAsRegister(new LCmpConstantEq(left));
1519 } 1434 }
1520 1435
1521 1436
1522 LInstruction* LChunkBuilder::DoIsNull(HIsNull* instr) { 1437 LInstruction* LChunkBuilder::DoIsNullAndBranch(HIsNullAndBranch* instr) {
1523 ASSERT(instr->value()->representation().IsTagged()); 1438 ASSERT(instr->value()->representation().IsTagged());
1524 LOperand* value = UseRegisterAtStart(instr->value()); 1439 return new LIsNullAndBranch(UseRegisterAtStart(instr->value()));
1525
1526 return DefineAsRegister(new LIsNull(value));
1527 } 1440 }
1528 1441
1529 1442
1530 LInstruction* LChunkBuilder::DoIsObject(HIsObject* instr) { 1443 LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) {
1531 ASSERT(instr->value()->representation().IsTagged()); 1444 ASSERT(instr->value()->representation().IsTagged());
1532 LOperand* value = UseRegisterAtStart(instr->value()); 1445 LOperand* temp = TempRegister();
1533 1446 return new LIsObjectAndBranch(UseRegisterAtStart(instr->value()), temp);
1534 return DefineAsRegister(new LIsObject(value));
1535 } 1447 }
1536 1448
1537 1449
1538 LInstruction* LChunkBuilder::DoIsSmi(HIsSmi* instr) { 1450 LInstruction* LChunkBuilder::DoIsSmiAndBranch(HIsSmiAndBranch* instr) {
1539 ASSERT(instr->value()->representation().IsTagged()); 1451 ASSERT(instr->value()->representation().IsTagged());
1540 LOperand* value = UseAtStart(instr->value()); 1452 return new LIsSmiAndBranch(Use(instr->value()));
1541
1542 return DefineAsRegister(new LIsSmi(value));
1543 } 1453 }
1544 1454
1545 1455
1546 LInstruction* LChunkBuilder::DoIsUndetectable(HIsUndetectable* instr) { 1456 LInstruction* LChunkBuilder::DoIsUndetectableAndBranch(
1457 HIsUndetectableAndBranch* instr) {
1547 ASSERT(instr->value()->representation().IsTagged()); 1458 ASSERT(instr->value()->representation().IsTagged());
1548 LOperand* value = UseRegisterAtStart(instr->value()); 1459 return new LIsUndetectableAndBranch(UseRegisterAtStart(instr->value()),
1549 1460 TempRegister());
1550 return DefineAsRegister(new LIsUndetectable(value));
1551 } 1461 }
1552 1462
1553 1463
1554 LInstruction* LChunkBuilder::DoHasInstanceType(HHasInstanceType* instr) { 1464 LInstruction* LChunkBuilder::DoHasInstanceTypeAndBranch(
1465 HHasInstanceTypeAndBranch* instr) {
1555 ASSERT(instr->value()->representation().IsTagged()); 1466 ASSERT(instr->value()->representation().IsTagged());
1556 LOperand* value = UseRegisterAtStart(instr->value()); 1467 return new LHasInstanceTypeAndBranch(UseRegisterAtStart(instr->value()));
1557
1558 return DefineAsRegister(new LHasInstanceType(value));
1559 } 1468 }
1560 1469
1561 1470
1562 LInstruction* LChunkBuilder::DoGetCachedArrayIndex( 1471 LInstruction* LChunkBuilder::DoGetCachedArrayIndex(
1563 HGetCachedArrayIndex* instr) { 1472 HGetCachedArrayIndex* instr) {
1564 ASSERT(instr->value()->representation().IsTagged()); 1473 ASSERT(instr->value()->representation().IsTagged());
1565 LOperand* value = UseRegisterAtStart(instr->value()); 1474 LOperand* value = UseRegisterAtStart(instr->value());
1566 1475
1567 return DefineAsRegister(new LGetCachedArrayIndex(value)); 1476 return DefineAsRegister(new LGetCachedArrayIndex(value));
1568 } 1477 }
1569 1478
1570 1479
1571 LInstruction* LChunkBuilder::DoHasCachedArrayIndex( 1480 LInstruction* LChunkBuilder::DoHasCachedArrayIndexAndBranch(
1572 HHasCachedArrayIndex* instr) { 1481 HHasCachedArrayIndexAndBranch* instr) {
1573 ASSERT(instr->value()->representation().IsTagged()); 1482 ASSERT(instr->value()->representation().IsTagged());
1574 LOperand* value = UseRegister(instr->value()); 1483 return new LHasCachedArrayIndexAndBranch(
1575 1484 UseRegisterAtStart(instr->value()));
1576 return DefineAsRegister(new LHasCachedArrayIndex(value));
1577 } 1485 }
1578 1486
1579 1487
1580 LInstruction* LChunkBuilder::DoClassOfTest(HClassOfTest* instr) { 1488 LInstruction* LChunkBuilder::DoClassOfTestAndBranch(
1581 ASSERT(instr->value()->representation().IsTagged()); 1489 HClassOfTestAndBranch* instr) {
1582 LOperand* value = UseTempRegister(instr->value()); 1490 ASSERT(compare->value()->representation().IsTagged());
1583 return DefineSameAsFirst(new LClassOfTest(value)); 1491 return new LClassOfTestAndBranch(UseTempRegister(instr->value()),
1492 TempRegister());
1584 } 1493 }
1585 1494
1586 1495
1587 LInstruction* LChunkBuilder::DoJSArrayLength(HJSArrayLength* instr) { 1496 LInstruction* LChunkBuilder::DoJSArrayLength(HJSArrayLength* instr) {
1588 LOperand* array = UseRegisterAtStart(instr->value()); 1497 LOperand* array = UseRegisterAtStart(instr->value());
1589 return DefineAsRegister(new LJSArrayLength(array)); 1498 return DefineAsRegister(new LJSArrayLength(array));
1590 } 1499 }
1591 1500
1592 1501
1593 LInstruction* LChunkBuilder::DoExternalArrayLength( 1502 LInstruction* LChunkBuilder::DoExternalArrayLength(
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
2162 return MarkAsCall(DefineFixed(result, r0), instr); 2071 return MarkAsCall(DefineFixed(result, r0), instr);
2163 } 2072 }
2164 2073
2165 2074
2166 LInstruction* LChunkBuilder::DoTypeof(HTypeof* instr) { 2075 LInstruction* LChunkBuilder::DoTypeof(HTypeof* instr) {
2167 LTypeof* result = new LTypeof(UseFixed(instr->value(), r0)); 2076 LTypeof* result = new LTypeof(UseFixed(instr->value(), r0));
2168 return MarkAsCall(DefineFixed(result, r0), instr); 2077 return MarkAsCall(DefineFixed(result, r0), instr);
2169 } 2078 }
2170 2079
2171 2080
2172 LInstruction* LChunkBuilder::DoTypeofIs(HTypeofIs* instr) { 2081 LInstruction* LChunkBuilder::DoTypeofIsAndBranch(HTypeofIsAndBranch* instr) {
2173 return DefineSameAsFirst(new LTypeofIs(UseRegister(instr->value()))); 2082 return new LTypeofIsAndBranch(UseTempRegister(instr->value()));
2174 } 2083 }
2175 2084
2176 2085
2177 LInstruction* LChunkBuilder::DoIsConstructCall(HIsConstructCall* instr) { 2086 LInstruction* LChunkBuilder::DoIsConstructCallAndBranch(
2178 return DefineAsRegister(new LIsConstructCall()); 2087 HIsConstructCallAndBranch* instr) {
2088 return new LIsConstructCallAndBranch(TempRegister());
2179 } 2089 }
2180 2090
2181 2091
2182 LInstruction* LChunkBuilder::DoSimulate(HSimulate* instr) { 2092 LInstruction* LChunkBuilder::DoSimulate(HSimulate* instr) {
2183 HEnvironment* env = current_block_->last_environment(); 2093 HEnvironment* env = current_block_->last_environment();
2184 ASSERT(env != NULL); 2094 ASSERT(env != NULL);
2185 2095
2186 env->set_ast_id(instr->ast_id()); 2096 env->set_ast_id(instr->ast_id());
2187 2097
2188 env->Drop(instr->pop_count()); 2098 env->Drop(instr->pop_count());
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
2242 2152
2243 LInstruction* LChunkBuilder::DoIn(HIn* instr) { 2153 LInstruction* LChunkBuilder::DoIn(HIn* instr) {
2244 LOperand* key = UseRegisterAtStart(instr->key()); 2154 LOperand* key = UseRegisterAtStart(instr->key());
2245 LOperand* object = UseRegisterAtStart(instr->object()); 2155 LOperand* object = UseRegisterAtStart(instr->object());
2246 LIn* result = new LIn(key, object); 2156 LIn* result = new LIn(key, object);
2247 return MarkAsCall(DefineFixed(result, r0), instr); 2157 return MarkAsCall(DefineFixed(result, r0), instr);
2248 } 2158 }
2249 2159
2250 2160
2251 } } // namespace v8::internal 2161 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698