| 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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 stream->Add(" = "); | 295 stream->Add(" = "); |
| 296 function()->PrintTo(stream); | 296 function()->PrintTo(stream); |
| 297 stream->Add(".code_entry = "); | 297 stream->Add(".code_entry = "); |
| 298 code_object()->PrintTo(stream); | 298 code_object()->PrintTo(stream); |
| 299 } | 299 } |
| 300 | 300 |
| 301 | 301 |
| 302 void LInnerAllocatedObject::PrintDataTo(StringStream* stream) { | 302 void LInnerAllocatedObject::PrintDataTo(StringStream* stream) { |
| 303 stream->Add(" = "); | 303 stream->Add(" = "); |
| 304 base_object()->PrintTo(stream); | 304 base_object()->PrintTo(stream); |
| 305 stream->Add(" + %d", offset()); | 305 stream->Add(" + "); |
| 306 offset()->PrintTo(stream); |
| 306 } | 307 } |
| 307 | 308 |
| 308 | 309 |
| 309 void LCallConstantFunction::PrintDataTo(StringStream* stream) { | 310 void LCallConstantFunction::PrintDataTo(StringStream* stream) { |
| 310 stream->Add("#%d / ", arity()); | 311 stream->Add("#%d / ", arity()); |
| 311 } | 312 } |
| 312 | 313 |
| 313 | 314 |
| 314 void LLoadContextSlot::PrintDataTo(StringStream* stream) { | 315 void LLoadContextSlot::PrintDataTo(StringStream* stream) { |
| 315 context()->PrintTo(stream); | 316 context()->PrintTo(stream); |
| (...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1194 | 1195 |
| 1195 LInstruction* LChunkBuilder::DoStoreCodeEntry( | 1196 LInstruction* LChunkBuilder::DoStoreCodeEntry( |
| 1196 HStoreCodeEntry* store_code_entry) { | 1197 HStoreCodeEntry* store_code_entry) { |
| 1197 LOperand* function = UseRegister(store_code_entry->function()); | 1198 LOperand* function = UseRegister(store_code_entry->function()); |
| 1198 LOperand* code_object = UseTempRegister(store_code_entry->code_object()); | 1199 LOperand* code_object = UseTempRegister(store_code_entry->code_object()); |
| 1199 return new(zone()) LStoreCodeEntry(function, code_object); | 1200 return new(zone()) LStoreCodeEntry(function, code_object); |
| 1200 } | 1201 } |
| 1201 | 1202 |
| 1202 | 1203 |
| 1203 LInstruction* LChunkBuilder::DoInnerAllocatedObject( | 1204 LInstruction* LChunkBuilder::DoInnerAllocatedObject( |
| 1204 HInnerAllocatedObject* inner_object) { | 1205 HInnerAllocatedObject* instr) { |
| 1205 LOperand* base_object = UseRegisterAtStart(inner_object->base_object()); | 1206 LOperand* base_object = UseRegisterAtStart(instr->base_object()); |
| 1206 LInnerAllocatedObject* result = | 1207 LOperand* offset = UseRegisterOrConstantAtStart(instr->offset()); |
| 1207 new(zone()) LInnerAllocatedObject(base_object); | 1208 return DefineAsRegister( |
| 1208 return DefineAsRegister(result); | 1209 new(zone()) LInnerAllocatedObject(base_object, offset)); |
| 1209 } | 1210 } |
| 1210 | 1211 |
| 1211 | 1212 |
| 1212 LInstruction* LChunkBuilder::DoThisFunction(HThisFunction* instr) { | 1213 LInstruction* LChunkBuilder::DoThisFunction(HThisFunction* instr) { |
| 1213 return instr->HasNoUses() | 1214 return instr->HasNoUses() |
| 1214 ? NULL | 1215 ? NULL |
| 1215 : DefineAsRegister(new(zone()) LThisFunction); | 1216 : DefineAsRegister(new(zone()) LThisFunction); |
| 1216 } | 1217 } |
| 1217 | 1218 |
| 1218 | 1219 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1264 return MarkAsCall(DefineFixed(result, eax), instr, CANNOT_DEOPTIMIZE_EAGERLY); | 1265 return MarkAsCall(DefineFixed(result, eax), instr, CANNOT_DEOPTIMIZE_EAGERLY); |
| 1265 } | 1266 } |
| 1266 | 1267 |
| 1267 | 1268 |
| 1268 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { | 1269 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { |
| 1269 switch (instr->op()) { | 1270 switch (instr->op()) { |
| 1270 case kMathFloor: return DoMathFloor(instr); | 1271 case kMathFloor: return DoMathFloor(instr); |
| 1271 case kMathRound: return DoMathRound(instr); | 1272 case kMathRound: return DoMathRound(instr); |
| 1272 case kMathAbs: return DoMathAbs(instr); | 1273 case kMathAbs: return DoMathAbs(instr); |
| 1273 case kMathLog: return DoMathLog(instr); | 1274 case kMathLog: return DoMathLog(instr); |
| 1274 case kMathSin: return DoMathSin(instr); | |
| 1275 case kMathCos: return DoMathCos(instr); | |
| 1276 case kMathTan: return DoMathTan(instr); | |
| 1277 case kMathExp: return DoMathExp(instr); | 1275 case kMathExp: return DoMathExp(instr); |
| 1278 case kMathSqrt: return DoMathSqrt(instr); | 1276 case kMathSqrt: return DoMathSqrt(instr); |
| 1279 case kMathPowHalf: return DoMathPowHalf(instr); | 1277 case kMathPowHalf: return DoMathPowHalf(instr); |
| 1280 default: | 1278 default: |
| 1281 UNREACHABLE(); | 1279 UNREACHABLE(); |
| 1282 return NULL; | 1280 return NULL; |
| 1283 } | 1281 } |
| 1284 } | 1282 } |
| 1285 | 1283 |
| 1286 | 1284 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1309 | 1307 |
| 1310 LInstruction* LChunkBuilder::DoMathLog(HUnaryMathOperation* instr) { | 1308 LInstruction* LChunkBuilder::DoMathLog(HUnaryMathOperation* instr) { |
| 1311 ASSERT(instr->representation().IsDouble()); | 1309 ASSERT(instr->representation().IsDouble()); |
| 1312 ASSERT(instr->value()->representation().IsDouble()); | 1310 ASSERT(instr->value()->representation().IsDouble()); |
| 1313 LOperand* input = UseRegisterAtStart(instr->value()); | 1311 LOperand* input = UseRegisterAtStart(instr->value()); |
| 1314 LMathLog* result = new(zone()) LMathLog(input); | 1312 LMathLog* result = new(zone()) LMathLog(input); |
| 1315 return DefineSameAsFirst(result); | 1313 return DefineSameAsFirst(result); |
| 1316 } | 1314 } |
| 1317 | 1315 |
| 1318 | 1316 |
| 1319 LInstruction* LChunkBuilder::DoMathSin(HUnaryMathOperation* instr) { | |
| 1320 LOperand* input = UseFixedDouble(instr->value(), xmm1); | |
| 1321 LMathSin* result = new(zone()) LMathSin(input); | |
| 1322 return MarkAsCall(DefineFixedDouble(result, xmm1), instr); | |
| 1323 } | |
| 1324 | |
| 1325 | |
| 1326 LInstruction* LChunkBuilder::DoMathCos(HUnaryMathOperation* instr) { | |
| 1327 LOperand* input = UseFixedDouble(instr->value(), xmm1); | |
| 1328 LMathCos* result = new(zone()) LMathCos(input); | |
| 1329 return MarkAsCall(DefineFixedDouble(result, xmm1), instr); | |
| 1330 } | |
| 1331 | |
| 1332 | |
| 1333 LInstruction* LChunkBuilder::DoMathTan(HUnaryMathOperation* instr) { | |
| 1334 LOperand* input = UseFixedDouble(instr->value(), xmm1); | |
| 1335 LMathTan* result = new(zone()) LMathTan(input); | |
| 1336 return MarkAsCall(DefineFixedDouble(result, xmm1), instr); | |
| 1337 } | |
| 1338 | |
| 1339 | |
| 1340 LInstruction* LChunkBuilder::DoMathExp(HUnaryMathOperation* instr) { | 1317 LInstruction* LChunkBuilder::DoMathExp(HUnaryMathOperation* instr) { |
| 1341 ASSERT(instr->representation().IsDouble()); | 1318 ASSERT(instr->representation().IsDouble()); |
| 1342 ASSERT(instr->value()->representation().IsDouble()); | 1319 ASSERT(instr->value()->representation().IsDouble()); |
| 1343 LOperand* value = UseTempRegister(instr->value()); | 1320 LOperand* value = UseTempRegister(instr->value()); |
| 1344 LOperand* temp1 = TempRegister(); | 1321 LOperand* temp1 = TempRegister(); |
| 1345 LOperand* temp2 = TempRegister(); | 1322 LOperand* temp2 = TempRegister(); |
| 1346 LMathExp* result = new(zone()) LMathExp(value, temp1, temp2); | 1323 LMathExp* result = new(zone()) LMathExp(value, temp1, temp2); |
| 1347 return DefineAsRegister(result); | 1324 return DefineAsRegister(result); |
| 1348 } | 1325 } |
| 1349 | 1326 |
| (...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2413 LOperand* object = UseRegister(instr->object()); | 2390 LOperand* object = UseRegister(instr->object()); |
| 2414 if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { | 2391 if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { |
| 2415 LOperand* object = UseRegister(instr->object()); | 2392 LOperand* object = UseRegister(instr->object()); |
| 2416 LOperand* new_map_reg = TempRegister(); | 2393 LOperand* new_map_reg = TempRegister(); |
| 2417 LOperand* temp_reg = TempRegister(); | 2394 LOperand* temp_reg = TempRegister(); |
| 2418 LTransitionElementsKind* result = | 2395 LTransitionElementsKind* result = |
| 2419 new(zone()) LTransitionElementsKind(object, NULL, | 2396 new(zone()) LTransitionElementsKind(object, NULL, |
| 2420 new_map_reg, temp_reg); | 2397 new_map_reg, temp_reg); |
| 2421 return result; | 2398 return result; |
| 2422 } else { | 2399 } else { |
| 2423 LOperand* context = UseRegister(instr->context()); | 2400 LOperand* context = UseFixed(instr->context(), esi); |
| 2424 LTransitionElementsKind* result = | 2401 LTransitionElementsKind* result = |
| 2425 new(zone()) LTransitionElementsKind(object, context, NULL, NULL); | 2402 new(zone()) LTransitionElementsKind(object, context, NULL, NULL); |
| 2426 return AssignPointerMap(result); | 2403 return AssignPointerMap(result); |
| 2427 } | 2404 } |
| 2428 } | 2405 } |
| 2429 | 2406 |
| 2430 | 2407 |
| 2431 LInstruction* LChunkBuilder::DoTrapAllocationMemento( | 2408 LInstruction* LChunkBuilder::DoTrapAllocationMemento( |
| 2432 HTrapAllocationMemento* instr) { | 2409 HTrapAllocationMemento* instr) { |
| 2433 LOperand* object = UseRegister(instr->object()); | 2410 LOperand* object = UseRegister(instr->object()); |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2788 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2765 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2789 LOperand* object = UseRegister(instr->object()); | 2766 LOperand* object = UseRegister(instr->object()); |
| 2790 LOperand* index = UseTempRegister(instr->index()); | 2767 LOperand* index = UseTempRegister(instr->index()); |
| 2791 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2768 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
| 2792 } | 2769 } |
| 2793 | 2770 |
| 2794 | 2771 |
| 2795 } } // namespace v8::internal | 2772 } } // namespace v8::internal |
| 2796 | 2773 |
| 2797 #endif // V8_TARGET_ARCH_IA32 | 2774 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |