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 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
938 | 938 |
939 return new LClassOfTestAndBranch(UseTempRegister(compare->value()), | 939 return new LClassOfTestAndBranch(UseTempRegister(compare->value()), |
940 TempRegister(), | 940 TempRegister(), |
941 first_id, | 941 first_id, |
942 second_id); | 942 second_id); |
943 } else if (v->IsCompare()) { | 943 } else if (v->IsCompare()) { |
944 HCompare* compare = HCompare::cast(v); | 944 HCompare* compare = HCompare::cast(v); |
945 Token::Value op = compare->token(); | 945 Token::Value op = compare->token(); |
946 HValue* left = compare->left(); | 946 HValue* left = compare->left(); |
947 HValue* right = compare->right(); | 947 HValue* right = compare->right(); |
948 if (left->representation().IsInteger32()) { | 948 Representation r = compare->GetInputRepresentation(); |
| 949 if (r.IsInteger32()) { |
| 950 ASSERT(left->representation().IsInteger32()); |
949 ASSERT(right->representation().IsInteger32()); | 951 ASSERT(right->representation().IsInteger32()); |
950 return new LCmpIDAndBranch(op, | 952 return new LCmpIDAndBranch(UseRegisterAtStart(left), |
951 UseRegisterAtStart(left), | |
952 UseOrConstantAtStart(right), | 953 UseOrConstantAtStart(right), |
953 first_id, | 954 first_id, |
954 second_id, | 955 second_id); |
955 false); | 956 } else if (r.IsDouble()) { |
956 } else if (left->representation().IsDouble()) { | 957 ASSERT(left->representation().IsDouble()); |
957 ASSERT(right->representation().IsDouble()); | 958 ASSERT(right->representation().IsDouble()); |
958 return new LCmpIDAndBranch(op, | 959 return new LCmpIDAndBranch(UseRegisterAtStart(left), |
959 UseRegisterAtStart(left), | |
960 UseRegisterAtStart(right), | 960 UseRegisterAtStart(right), |
961 first_id, | 961 first_id, |
962 second_id, | 962 second_id); |
963 true); | |
964 } else { | 963 } else { |
965 ASSERT(left->representation().IsTagged()); | 964 ASSERT(left->representation().IsTagged()); |
966 ASSERT(right->representation().IsTagged()); | 965 ASSERT(right->representation().IsTagged()); |
967 bool reversed = op == Token::GT || op == Token::LTE; | 966 bool reversed = op == Token::GT || op == Token::LTE; |
968 LOperand* left_operand = UseFixed(left, reversed ? r0 : r1); | 967 LOperand* left_operand = UseFixed(left, reversed ? r0 : r1); |
969 LOperand* right_operand = UseFixed(right, reversed ? r1 : r0); | 968 LOperand* right_operand = UseFixed(right, reversed ? r1 : r0); |
970 LInstruction* result = new LCmpTAndBranch(left_operand, | 969 LInstruction* result = new LCmpTAndBranch(left_operand, |
971 right_operand, | 970 right_operand, |
972 first_id, | 971 first_id, |
973 second_id); | 972 second_id); |
(...skipping 17 matching lines...) Expand all Loading... |
991 HHasCachedArrayIndex* compare = HHasCachedArrayIndex::cast(v); | 990 HHasCachedArrayIndex* compare = HHasCachedArrayIndex::cast(v); |
992 ASSERT(compare->value()->representation().IsTagged()); | 991 ASSERT(compare->value()->representation().IsTagged()); |
993 | 992 |
994 return new LHasCachedArrayIndexAndBranch( | 993 return new LHasCachedArrayIndexAndBranch( |
995 UseRegisterAtStart(compare->value()), first_id, second_id); | 994 UseRegisterAtStart(compare->value()), first_id, second_id); |
996 } else if (v->IsIsNull()) { | 995 } else if (v->IsIsNull()) { |
997 HIsNull* compare = HIsNull::cast(v); | 996 HIsNull* compare = HIsNull::cast(v); |
998 ASSERT(compare->value()->representation().IsTagged()); | 997 ASSERT(compare->value()->representation().IsTagged()); |
999 | 998 |
1000 return new LIsNullAndBranch(UseRegisterAtStart(compare->value()), | 999 return new LIsNullAndBranch(UseRegisterAtStart(compare->value()), |
1001 compare->is_strict(), | |
1002 first_id, | 1000 first_id, |
1003 second_id); | 1001 second_id); |
1004 } else if (v->IsIsObject()) { | 1002 } else if (v->IsIsObject()) { |
1005 HIsObject* compare = HIsObject::cast(v); | 1003 HIsObject* compare = HIsObject::cast(v); |
1006 ASSERT(compare->value()->representation().IsTagged()); | 1004 ASSERT(compare->value()->representation().IsTagged()); |
1007 | 1005 |
1008 LOperand* temp1 = TempRegister(); | 1006 LOperand* temp1 = TempRegister(); |
1009 LOperand* temp2 = TempRegister(); | 1007 LOperand* temp2 = TempRegister(); |
1010 return new LIsObjectAndBranch(UseRegisterAtStart(compare->value()), | 1008 return new LIsObjectAndBranch(UseRegisterAtStart(compare->value()), |
1011 temp1, | 1009 temp1, |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1343 | 1341 |
1344 | 1342 |
1345 LInstruction* LChunkBuilder::DoPower(HPower* instr) { | 1343 LInstruction* LChunkBuilder::DoPower(HPower* instr) { |
1346 Abort("LPower instruction not implemented on ARM"); | 1344 Abort("LPower instruction not implemented on ARM"); |
1347 return NULL; | 1345 return NULL; |
1348 } | 1346 } |
1349 | 1347 |
1350 | 1348 |
1351 LInstruction* LChunkBuilder::DoCompare(HCompare* instr) { | 1349 LInstruction* LChunkBuilder::DoCompare(HCompare* instr) { |
1352 Token::Value op = instr->token(); | 1350 Token::Value op = instr->token(); |
1353 if (instr->left()->representation().IsInteger32()) { | 1351 Representation r = instr->GetInputRepresentation(); |
| 1352 if (r.IsInteger32()) { |
| 1353 ASSERT(instr->left()->representation().IsInteger32()); |
1354 ASSERT(instr->right()->representation().IsInteger32()); | 1354 ASSERT(instr->right()->representation().IsInteger32()); |
1355 LOperand* left = UseRegisterAtStart(instr->left()); | 1355 LOperand* left = UseRegisterAtStart(instr->left()); |
1356 LOperand* right = UseOrConstantAtStart(instr->right()); | 1356 LOperand* right = UseOrConstantAtStart(instr->right()); |
1357 return DefineAsRegister(new LCmpID(op, left, right, false)); | 1357 return DefineAsRegister(new LCmpID(left, right)); |
1358 } else if (instr->left()->representation().IsDouble()) { | 1358 } else if (r.IsDouble()) { |
| 1359 ASSERT(instr->left()->representation().IsDouble()); |
1359 ASSERT(instr->right()->representation().IsDouble()); | 1360 ASSERT(instr->right()->representation().IsDouble()); |
1360 LOperand* left = UseRegisterAtStart(instr->left()); | 1361 LOperand* left = UseRegisterAtStart(instr->left()); |
1361 LOperand* right = UseRegisterAtStart(instr->right()); | 1362 LOperand* right = UseRegisterAtStart(instr->right()); |
1362 return DefineAsRegister(new LCmpID(op, left, right, true)); | 1363 return DefineAsRegister(new LCmpID(left, right)); |
1363 } else { | 1364 } else { |
| 1365 ASSERT(instr->left()->representation().IsTagged()); |
| 1366 ASSERT(instr->right()->representation().IsTagged()); |
1364 bool reversed = (op == Token::GT || op == Token::LTE); | 1367 bool reversed = (op == Token::GT || op == Token::LTE); |
1365 LOperand* left = UseFixed(instr->left(), reversed ? r0 : r1); | 1368 LOperand* left = UseFixed(instr->left(), reversed ? r0 : r1); |
1366 LOperand* right = UseFixed(instr->right(), reversed ? r1 : r0); | 1369 LOperand* right = UseFixed(instr->right(), reversed ? r1 : r0); |
1367 LInstruction* result = new LCmpT(left, right); | 1370 LInstruction* result = new LCmpT(left, right); |
1368 return MarkAsCall(DefineFixed(result, r0), instr); | 1371 return MarkAsCall(DefineFixed(result, r0), instr); |
1369 } | 1372 } |
1370 } | 1373 } |
1371 | 1374 |
1372 | 1375 |
1373 LInstruction* LChunkBuilder::DoCompareJSObjectEq( | 1376 LInstruction* LChunkBuilder::DoCompareJSObjectEq( |
1374 HCompareJSObjectEq* instr) { | 1377 HCompareJSObjectEq* instr) { |
1375 LOperand* left = UseRegisterAtStart(instr->left()); | 1378 LOperand* left = UseRegisterAtStart(instr->left()); |
1376 LOperand* right = UseRegisterAtStart(instr->right()); | 1379 LOperand* right = UseRegisterAtStart(instr->right()); |
1377 LInstruction* result = new LCmpJSObjectEq(left, right); | 1380 LInstruction* result = new LCmpJSObjectEq(left, right); |
1378 return DefineAsRegister(result); | 1381 return DefineAsRegister(result); |
1379 } | 1382 } |
1380 | 1383 |
1381 | 1384 |
1382 LInstruction* LChunkBuilder::DoIsNull(HIsNull* instr) { | 1385 LInstruction* LChunkBuilder::DoIsNull(HIsNull* instr) { |
1383 ASSERT(instr->value()->representation().IsTagged()); | 1386 ASSERT(instr->value()->representation().IsTagged()); |
1384 LOperand* value = UseRegisterAtStart(instr->value()); | 1387 LOperand* value = UseRegisterAtStart(instr->value()); |
1385 | 1388 |
1386 return DefineAsRegister(new LIsNull(value, | 1389 return DefineAsRegister(new LIsNull(value)); |
1387 instr->is_strict())); | |
1388 } | 1390 } |
1389 | 1391 |
1390 | 1392 |
1391 LInstruction* LChunkBuilder::DoIsObject(HIsObject* instr) { | 1393 LInstruction* LChunkBuilder::DoIsObject(HIsObject* instr) { |
1392 ASSERT(instr->value()->representation().IsTagged()); | 1394 ASSERT(instr->value()->representation().IsTagged()); |
1393 LOperand* value = UseRegisterAtStart(instr->value()); | 1395 LOperand* value = UseRegisterAtStart(instr->value()); |
1394 | 1396 |
1395 return DefineAsRegister(new LIsObject(value, TempRegister())); | 1397 return DefineAsRegister(new LIsObject(value, TempRegister())); |
1396 } | 1398 } |
1397 | 1399 |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1830 | 1832 |
1831 | 1833 |
1832 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { | 1834 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { |
1833 HEnvironment* outer = current_block_->last_environment()->outer(); | 1835 HEnvironment* outer = current_block_->last_environment()->outer(); |
1834 current_block_->UpdateEnvironment(outer); | 1836 current_block_->UpdateEnvironment(outer); |
1835 return NULL; | 1837 return NULL; |
1836 } | 1838 } |
1837 | 1839 |
1838 | 1840 |
1839 } } // namespace v8::internal | 1841 } } // namespace v8::internal |
OLD | NEW |