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

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

Issue 6324011: Implement x64 lithium instructions DoGlobalObject and DoSub (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 11 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 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after
1047 } 1047 }
1048 1048
1049 1049
1050 LInstruction* LChunkBuilder::DoPushArgument(HPushArgument* instr) { 1050 LInstruction* LChunkBuilder::DoPushArgument(HPushArgument* instr) {
1051 Abort("Unimplemented: %s", "DoPushArgument"); 1051 Abort("Unimplemented: %s", "DoPushArgument");
1052 return NULL; 1052 return NULL;
1053 } 1053 }
1054 1054
1055 1055
1056 LInstruction* LChunkBuilder::DoGlobalObject(HGlobalObject* instr) { 1056 LInstruction* LChunkBuilder::DoGlobalObject(HGlobalObject* instr) {
1057 Abort("Unimplemented: %s", "DoGlobalObject"); 1057 return DefineAsRegister(new LGlobalObject);
1058 return NULL;
1059 } 1058 }
1060 1059
1061 1060
1062 LInstruction* LChunkBuilder::DoGlobalReceiver(HGlobalReceiver* instr) { 1061 LInstruction* LChunkBuilder::DoGlobalReceiver(HGlobalReceiver* instr) {
1063 Abort("Unimplemented: %s", "DoGlobalReceiver"); 1062 Abort("Unimplemented: %s", "DoGlobalReceiver");
1064 return NULL; 1063 return NULL;
1065 } 1064 }
1066 1065
1067 1066
1068 LInstruction* LChunkBuilder::DoCallConstantFunction( 1067 LInstruction* LChunkBuilder::DoCallConstantFunction(
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
1174 } 1173 }
1175 1174
1176 1175
1177 LInstruction* LChunkBuilder::DoMul(HMul* instr) { 1176 LInstruction* LChunkBuilder::DoMul(HMul* instr) {
1178 Abort("Unimplemented: %s", "DoMul"); 1177 Abort("Unimplemented: %s", "DoMul");
1179 return NULL; 1178 return NULL;
1180 } 1179 }
1181 1180
1182 1181
1183 LInstruction* LChunkBuilder::DoSub(HSub* instr) { 1182 LInstruction* LChunkBuilder::DoSub(HSub* instr) {
1184 Abort("Unimplemented: %s", "DoSub"); 1183 if (instr->representation().IsInteger32()) {
1185 return NULL; 1184 ASSERT(instr->left()->representation().IsInteger32());
1185 ASSERT(instr->right()->representation().IsInteger32());
1186 LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand());
1187 LOperand* right = UseOrConstantAtStart(instr->MostConstantOperand());
1188 LSubI* sub = new LSubI(left, right);
1189 LInstruction* result = DefineSameAsFirst(sub);
William Hesse 2011/01/25 11:12:20 Subtraction is not commutative. I don't think you
1190 if (instr->CheckFlag(HValue::kCanOverflow)) {
1191 result = AssignEnvironment(result);
1192 }
1193 return result;
1194 } else if (instr->representation().IsDouble()) {
1195 return DoArithmeticD(Token::SUB, instr);
1196 } else {
1197 ASSERT(instr->representation().IsTagged());
1198 return DoArithmeticT(Token::SUB, instr);
1199 }
1186 } 1200 }
1187 1201
1188 1202
1189 LInstruction* LChunkBuilder::DoAdd(HAdd* instr) { 1203 LInstruction* LChunkBuilder::DoAdd(HAdd* instr) {
1190 if (instr->representation().IsInteger32()) { 1204 if (instr->representation().IsInteger32()) {
1191 ASSERT(instr->left()->representation().IsInteger32()); 1205 ASSERT(instr->left()->representation().IsInteger32());
1192 ASSERT(instr->right()->representation().IsInteger32()); 1206 ASSERT(instr->right()->representation().IsInteger32());
1193 LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand()); 1207 LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand());
1194 LOperand* right = UseOrConstantAtStart(instr->MostConstantOperand()); 1208 LOperand* right = UseOrConstantAtStart(instr->MostConstantOperand());
1195 LAddI* add = new LAddI(left, right); 1209 LAddI* add = new LAddI(left, right);
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
1594 1608
1595 1609
1596 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { 1610 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) {
1597 Abort("Unimplemented: %s", "DoLeaveInlined"); 1611 Abort("Unimplemented: %s", "DoLeaveInlined");
1598 return NULL; 1612 return NULL;
1599 } 1613 }
1600 1614
1601 } } // namespace v8::internal 1615 } } // namespace v8::internal
1602 1616
1603 #endif // V8_TARGET_ARCH_X64 1617 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/x64/lithium-codegen-x64.cc ('K') | « src/x64/lithium-codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698