OLD | NEW |
1 // Copyright 2010 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 |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 } | 274 } |
275 | 275 |
276 | 276 |
277 void HValue::SetOperandAt(int index, HValue* value) { | 277 void HValue::SetOperandAt(int index, HValue* value) { |
278 ASSERT(value == NULL || !value->representation().IsNone()); | 278 ASSERT(value == NULL || !value->representation().IsNone()); |
279 RegisterUse(index, value); | 279 RegisterUse(index, value); |
280 InternalSetOperandAt(index, value); | 280 InternalSetOperandAt(index, value); |
281 } | 281 } |
282 | 282 |
283 | 283 |
| 284 void HLoadKeyedGeneric::InternalSetOperandAt(int index, HValue* value) { |
| 285 if (index < 2) { |
| 286 operands_[index] = value; |
| 287 } else { |
| 288 context_ = value; |
| 289 } |
| 290 } |
| 291 |
| 292 |
| 293 void HCallKeyed::InternalSetOperandAt(int index, HValue* value) { |
| 294 // The key and all the arguments are stored in the base class's arguments_ |
| 295 // vector. The context is in the object itself. Ugly. |
| 296 if (index <= argument_count()) { |
| 297 arguments_[index] = value; |
| 298 } else { |
| 299 context_ = value; |
| 300 } |
| 301 } |
| 302 |
| 303 |
| 304 void HCallNamed::InternalSetOperandAt(int index, HValue* value) { |
| 305 // The arguments are in the base class's arguments_ vector. The context |
| 306 // is in the object itself. |
| 307 if (index < argument_count()) { |
| 308 arguments_[index] = value; |
| 309 } else { |
| 310 context_ = value; |
| 311 } |
| 312 } |
| 313 |
| 314 |
| 315 void HCallFunction::InternalSetOperandAt(int index, HValue* value) { |
| 316 // The arguments are in the base class's arguments_ vector. The context |
| 317 // is in the object itself. |
| 318 if (index < argument_count()) { |
| 319 arguments_[index] = value; |
| 320 } else { |
| 321 context_ = value; |
| 322 } |
| 323 } |
| 324 |
| 325 |
| 326 void HCallGlobal::InternalSetOperandAt(int index, HValue* value) { |
| 327 // The arguments are in the base class's arguments_ vector. The context |
| 328 // is in the object itself. |
| 329 if (index < argument_count()) { |
| 330 arguments_[index] = value; |
| 331 } else { |
| 332 context_ = value; |
| 333 } |
| 334 } |
| 335 |
| 336 |
| 337 void HCallNew::InternalSetOperandAt(int index, HValue* value) { |
| 338 // The arguments are in the base class's arguments_ vector. The context |
| 339 // is in the object itself. |
| 340 if (index < argument_count()) { |
| 341 arguments_[index] = value; |
| 342 } else { |
| 343 context_ = value; |
| 344 } |
| 345 } |
| 346 |
| 347 |
| 348 void HStoreKeyedGeneric::InternalSetOperandAt(int index, HValue* value) { |
| 349 if (index < 3) { |
| 350 operands_[index] = value; |
| 351 } else { |
| 352 context_ = value; |
| 353 } |
| 354 } |
| 355 |
| 356 |
| 357 void HStoreNamedGeneric::InternalSetOperandAt(int index, HValue* value) { |
| 358 if (index < 2) { |
| 359 operands_[index] = value; |
| 360 } else { |
| 361 context_ = value; |
| 362 } |
| 363 } |
| 364 |
| 365 |
284 void HValue::ReplaceAndDelete(HValue* other) { | 366 void HValue::ReplaceAndDelete(HValue* other) { |
285 ReplaceValue(other); | 367 ReplaceValue(other); |
286 Delete(); | 368 Delete(); |
287 } | 369 } |
288 | 370 |
289 | 371 |
290 void HValue::ReplaceValue(HValue* other) { | 372 void HValue::ReplaceValue(HValue* other) { |
291 ZoneList<HValue*> start_uses(2); | 373 ZoneList<HValue*> start_uses(2); |
292 for (int i = 0; i < uses_.length(); ++i) { | 374 for (int i = 0; i < uses_.length(); ++i) { |
293 HValue* use = uses_.at(i); | 375 HValue* use = uses_.at(i); |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 HCall::PrintDataTo(stream); | 806 HCall::PrintDataTo(stream); |
725 } | 807 } |
726 | 808 |
727 | 809 |
728 void HCallRuntime::PrintDataTo(StringStream* stream) const { | 810 void HCallRuntime::PrintDataTo(StringStream* stream) const { |
729 SmartPointer<char> name_string = name()->ToCString(); | 811 SmartPointer<char> name_string = name()->ToCString(); |
730 stream->Add("%s ", *name_string); | 812 stream->Add("%s ", *name_string); |
731 HCall::PrintDataTo(stream); | 813 HCall::PrintDataTo(stream); |
732 } | 814 } |
733 | 815 |
| 816 |
734 void HCallStub::PrintDataTo(StringStream* stream) const { | 817 void HCallStub::PrintDataTo(StringStream* stream) const { |
735 stream->Add("%s(%d)", | 818 HUnaryOperation::PrintDataTo(stream); |
| 819 stream->Add(" %s(%d)", |
736 CodeStub::MajorName(major_key_, false), | 820 CodeStub::MajorName(major_key_, false), |
737 argument_count_); | 821 argument_count_); |
738 } | 822 } |
739 | 823 |
740 | 824 |
| 825 void HInstanceOf::PrintDataTo(StringStream* stream) const { |
| 826 left()->PrintNameTo(stream); |
| 827 stream->Add(" "); |
| 828 right()->PrintNameTo(stream); |
| 829 stream->Add(" "); |
| 830 context()->PrintNameTo(stream); |
| 831 } |
| 832 |
| 833 |
741 Range* HValue::InferRange() { | 834 Range* HValue::InferRange() { |
742 if (representation().IsTagged()) { | 835 if (representation().IsTagged()) { |
743 // Tagged values are always in int32 range when converted to integer, | 836 // Tagged values are always in int32 range when converted to integer, |
744 // but they can contain -0. | 837 // but they can contain -0. |
745 Range* result = new Range(); | 838 Range* result = new Range(); |
746 result->set_can_be_minus_zero(true); | 839 result->set_can_be_minus_zero(true); |
747 return result; | 840 return result; |
748 } else if (representation().IsNone()) { | 841 } else if (representation().IsNone()) { |
749 return NULL; | 842 return NULL; |
750 } else { | 843 } else { |
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1457 | 1550 |
1458 | 1551 |
1459 void HCheckPrototypeMaps::Verify() { | 1552 void HCheckPrototypeMaps::Verify() { |
1460 HInstruction::Verify(); | 1553 HInstruction::Verify(); |
1461 ASSERT(HasNoUses()); | 1554 ASSERT(HasNoUses()); |
1462 } | 1555 } |
1463 | 1556 |
1464 #endif | 1557 #endif |
1465 | 1558 |
1466 } } // namespace v8::internal | 1559 } } // namespace v8::internal |
OLD | NEW |