| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 stream->Add(" = "); | 268 stream->Add(" = "); |
| 269 function()->PrintTo(stream); | 269 function()->PrintTo(stream); |
| 270 stream->Add(".code_entry = "); | 270 stream->Add(".code_entry = "); |
| 271 code_object()->PrintTo(stream); | 271 code_object()->PrintTo(stream); |
| 272 } | 272 } |
| 273 | 273 |
| 274 | 274 |
| 275 void LInnerAllocatedObject::PrintDataTo(StringStream* stream) { | 275 void LInnerAllocatedObject::PrintDataTo(StringStream* stream) { |
| 276 stream->Add(" = "); | 276 stream->Add(" = "); |
| 277 base_object()->PrintTo(stream); | 277 base_object()->PrintTo(stream); |
| 278 stream->Add(" + %d", offset()); | 278 stream->Add(" + "); |
| 279 offset()->PrintTo(stream); |
| 279 } | 280 } |
| 280 | 281 |
| 281 | 282 |
| 282 void LCallConstantFunction::PrintDataTo(StringStream* stream) { | 283 void LCallConstantFunction::PrintDataTo(StringStream* stream) { |
| 283 stream->Add("#%d / ", arity()); | 284 stream->Add("#%d / ", arity()); |
| 284 } | 285 } |
| 285 | 286 |
| 286 | 287 |
| 287 void LLoadContextSlot::PrintDataTo(StringStream* stream) { | 288 void LLoadContextSlot::PrintDataTo(StringStream* stream) { |
| 288 context()->PrintTo(stream); | 289 context()->PrintTo(stream); |
| (...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1109 | 1110 |
| 1110 LInstruction* LChunkBuilder::DoStoreCodeEntry( | 1111 LInstruction* LChunkBuilder::DoStoreCodeEntry( |
| 1111 HStoreCodeEntry* store_code_entry) { | 1112 HStoreCodeEntry* store_code_entry) { |
| 1112 LOperand* function = UseRegister(store_code_entry->function()); | 1113 LOperand* function = UseRegister(store_code_entry->function()); |
| 1113 LOperand* code_object = UseTempRegister(store_code_entry->code_object()); | 1114 LOperand* code_object = UseTempRegister(store_code_entry->code_object()); |
| 1114 return new(zone()) LStoreCodeEntry(function, code_object); | 1115 return new(zone()) LStoreCodeEntry(function, code_object); |
| 1115 } | 1116 } |
| 1116 | 1117 |
| 1117 | 1118 |
| 1118 LInstruction* LChunkBuilder::DoInnerAllocatedObject( | 1119 LInstruction* LChunkBuilder::DoInnerAllocatedObject( |
| 1119 HInnerAllocatedObject* inner_object) { | 1120 HInnerAllocatedObject* instr) { |
| 1120 LOperand* base_object = UseRegisterAtStart(inner_object->base_object()); | 1121 LOperand* base_object = UseRegisterAtStart(instr->base_object()); |
| 1121 LInnerAllocatedObject* result = | 1122 LOperand* offset = UseRegisterOrConstantAtStart(instr->offset()); |
| 1122 new(zone()) LInnerAllocatedObject(base_object); | 1123 return DefineAsRegister( |
| 1123 return DefineAsRegister(result); | 1124 new(zone()) LInnerAllocatedObject(base_object, offset)); |
| 1124 } | 1125 } |
| 1125 | 1126 |
| 1126 | 1127 |
| 1127 LInstruction* LChunkBuilder::DoThisFunction(HThisFunction* instr) { | 1128 LInstruction* LChunkBuilder::DoThisFunction(HThisFunction* instr) { |
| 1128 return instr->HasNoUses() | 1129 return instr->HasNoUses() |
| 1129 ? NULL | 1130 ? NULL |
| 1130 : DefineAsRegister(new(zone()) LThisFunction); | 1131 : DefineAsRegister(new(zone()) LThisFunction); |
| 1131 } | 1132 } |
| 1132 | 1133 |
| 1133 | 1134 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1179 return MarkAsCall(DefineFixed(result, rax), instr, CANNOT_DEOPTIMIZE_EAGERLY); | 1180 return MarkAsCall(DefineFixed(result, rax), instr, CANNOT_DEOPTIMIZE_EAGERLY); |
| 1180 } | 1181 } |
| 1181 | 1182 |
| 1182 | 1183 |
| 1183 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { | 1184 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { |
| 1184 switch (instr->op()) { | 1185 switch (instr->op()) { |
| 1185 case kMathFloor: return DoMathFloor(instr); | 1186 case kMathFloor: return DoMathFloor(instr); |
| 1186 case kMathRound: return DoMathRound(instr); | 1187 case kMathRound: return DoMathRound(instr); |
| 1187 case kMathAbs: return DoMathAbs(instr); | 1188 case kMathAbs: return DoMathAbs(instr); |
| 1188 case kMathLog: return DoMathLog(instr); | 1189 case kMathLog: return DoMathLog(instr); |
| 1189 case kMathSin: return DoMathSin(instr); | |
| 1190 case kMathCos: return DoMathCos(instr); | |
| 1191 case kMathTan: return DoMathTan(instr); | |
| 1192 case kMathExp: return DoMathExp(instr); | 1190 case kMathExp: return DoMathExp(instr); |
| 1193 case kMathSqrt: return DoMathSqrt(instr); | 1191 case kMathSqrt: return DoMathSqrt(instr); |
| 1194 case kMathPowHalf: return DoMathPowHalf(instr); | 1192 case kMathPowHalf: return DoMathPowHalf(instr); |
| 1195 default: | 1193 default: |
| 1196 UNREACHABLE(); | 1194 UNREACHABLE(); |
| 1197 return NULL; | 1195 return NULL; |
| 1198 } | 1196 } |
| 1199 } | 1197 } |
| 1200 | 1198 |
| 1201 | 1199 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1223 | 1221 |
| 1224 LInstruction* LChunkBuilder::DoMathLog(HUnaryMathOperation* instr) { | 1222 LInstruction* LChunkBuilder::DoMathLog(HUnaryMathOperation* instr) { |
| 1225 ASSERT(instr->representation().IsDouble()); | 1223 ASSERT(instr->representation().IsDouble()); |
| 1226 ASSERT(instr->value()->representation().IsDouble()); | 1224 ASSERT(instr->value()->representation().IsDouble()); |
| 1227 LOperand* input = UseRegisterAtStart(instr->value()); | 1225 LOperand* input = UseRegisterAtStart(instr->value()); |
| 1228 LMathLog* result = new(zone()) LMathLog(input); | 1226 LMathLog* result = new(zone()) LMathLog(input); |
| 1229 return DefineSameAsFirst(result); | 1227 return DefineSameAsFirst(result); |
| 1230 } | 1228 } |
| 1231 | 1229 |
| 1232 | 1230 |
| 1233 LInstruction* LChunkBuilder::DoMathSin(HUnaryMathOperation* instr) { | |
| 1234 LOperand* input = UseFixedDouble(instr->value(), xmm1); | |
| 1235 LMathSin* result = new(zone()) LMathSin(input); | |
| 1236 return MarkAsCall(DefineFixedDouble(result, xmm1), instr); | |
| 1237 } | |
| 1238 | |
| 1239 | |
| 1240 LInstruction* LChunkBuilder::DoMathCos(HUnaryMathOperation* instr) { | |
| 1241 LOperand* input = UseFixedDouble(instr->value(), xmm1); | |
| 1242 LMathCos* result = new(zone()) LMathCos(input); | |
| 1243 return MarkAsCall(DefineFixedDouble(result, xmm1), instr); | |
| 1244 } | |
| 1245 | |
| 1246 | |
| 1247 LInstruction* LChunkBuilder::DoMathTan(HUnaryMathOperation* instr) { | |
| 1248 LOperand* input = UseFixedDouble(instr->value(), xmm1); | |
| 1249 LMathTan* result = new(zone()) LMathTan(input); | |
| 1250 return MarkAsCall(DefineFixedDouble(result, xmm1), instr); | |
| 1251 } | |
| 1252 | |
| 1253 | |
| 1254 LInstruction* LChunkBuilder::DoMathExp(HUnaryMathOperation* instr) { | 1231 LInstruction* LChunkBuilder::DoMathExp(HUnaryMathOperation* instr) { |
| 1255 ASSERT(instr->representation().IsDouble()); | 1232 ASSERT(instr->representation().IsDouble()); |
| 1256 ASSERT(instr->value()->representation().IsDouble()); | 1233 ASSERT(instr->value()->representation().IsDouble()); |
| 1257 LOperand* value = UseTempRegister(instr->value()); | 1234 LOperand* value = UseTempRegister(instr->value()); |
| 1258 LOperand* temp1 = TempRegister(); | 1235 LOperand* temp1 = TempRegister(); |
| 1259 LOperand* temp2 = TempRegister(); | 1236 LOperand* temp2 = TempRegister(); |
| 1260 LMathExp* result = new(zone()) LMathExp(value, temp1, temp2); | 1237 LMathExp* result = new(zone()) LMathExp(value, temp1, temp2); |
| 1261 return DefineAsRegister(result); | 1238 return DefineAsRegister(result); |
| 1262 } | 1239 } |
| 1263 | 1240 |
| (...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2259 HTransitionElementsKind* instr) { | 2236 HTransitionElementsKind* instr) { |
| 2260 LOperand* object = UseRegister(instr->object()); | 2237 LOperand* object = UseRegister(instr->object()); |
| 2261 if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { | 2238 if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { |
| 2262 LOperand* object = UseRegister(instr->object()); | 2239 LOperand* object = UseRegister(instr->object()); |
| 2263 LOperand* new_map_reg = TempRegister(); | 2240 LOperand* new_map_reg = TempRegister(); |
| 2264 LOperand* temp_reg = TempRegister(); | 2241 LOperand* temp_reg = TempRegister(); |
| 2265 LTransitionElementsKind* result = new(zone()) LTransitionElementsKind( | 2242 LTransitionElementsKind* result = new(zone()) LTransitionElementsKind( |
| 2266 object, NULL, new_map_reg, temp_reg); | 2243 object, NULL, new_map_reg, temp_reg); |
| 2267 return result; | 2244 return result; |
| 2268 } else { | 2245 } else { |
| 2269 LOperand* context = UseAny(instr->context()); | 2246 LOperand* context = UseFixed(instr->context(), rsi); |
| 2270 LTransitionElementsKind* result = | 2247 LTransitionElementsKind* result = |
| 2271 new(zone()) LTransitionElementsKind(object, context, NULL, NULL); | 2248 new(zone()) LTransitionElementsKind(object, context, NULL, NULL); |
| 2272 return AssignPointerMap(result); | 2249 return AssignPointerMap(result); |
| 2273 } | 2250 } |
| 2274 } | 2251 } |
| 2275 | 2252 |
| 2276 | 2253 |
| 2277 LInstruction* LChunkBuilder::DoTrapAllocationMemento( | 2254 LInstruction* LChunkBuilder::DoTrapAllocationMemento( |
| 2278 HTrapAllocationMemento* instr) { | 2255 HTrapAllocationMemento* instr) { |
| 2279 LOperand* object = UseRegister(instr->object()); | 2256 LOperand* object = UseRegister(instr->object()); |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2623 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2600 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2624 LOperand* object = UseRegister(instr->object()); | 2601 LOperand* object = UseRegister(instr->object()); |
| 2625 LOperand* index = UseTempRegister(instr->index()); | 2602 LOperand* index = UseTempRegister(instr->index()); |
| 2626 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2603 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
| 2627 } | 2604 } |
| 2628 | 2605 |
| 2629 | 2606 |
| 2630 } } // namespace v8::internal | 2607 } } // namespace v8::internal |
| 2631 | 2608 |
| 2632 #endif // V8_TARGET_ARCH_X64 | 2609 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |