Chromium Code Reviews| 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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 411 Handle<Code> FastCloneShallowObjectStub::GenerateCode() { | 411 Handle<Code> FastCloneShallowObjectStub::GenerateCode() { |
| 412 return DoGenerateCode(this); | 412 return DoGenerateCode(this); |
| 413 } | 413 } |
| 414 | 414 |
| 415 | 415 |
| 416 template <> | 416 template <> |
| 417 HValue* CodeStubGraphBuilder<KeyedLoadFastElementStub>::BuildCodeStub() { | 417 HValue* CodeStubGraphBuilder<KeyedLoadFastElementStub>::BuildCodeStub() { |
| 418 HInstruction* load = BuildUncheckedMonomorphicElementAccess( | 418 HInstruction* load = BuildUncheckedMonomorphicElementAccess( |
| 419 GetParameter(0), GetParameter(1), NULL, NULL, | 419 GetParameter(0), GetParameter(1), NULL, NULL, |
| 420 casted_stub()->is_js_array(), casted_stub()->elements_kind(), | 420 casted_stub()->is_js_array(), casted_stub()->elements_kind(), |
| 421 false, NEVER_RETURN_HOLE, STANDARD_STORE, Representation::Tagged()); | 421 false, NEVER_RETURN_HOLE, STANDARD_STORE, Representation::Smi()); |
| 422 return load; | 422 return load; |
| 423 } | 423 } |
| 424 | 424 |
| 425 | 425 |
| 426 Handle<Code> KeyedLoadFastElementStub::GenerateCode() { | 426 Handle<Code> KeyedLoadFastElementStub::GenerateCode() { |
| 427 return DoGenerateCode(this); | 427 return DoGenerateCode(this); |
| 428 } | 428 } |
| 429 | 429 |
| 430 | 430 |
| 431 template<> | 431 template<> |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 457 return DoGenerateCode(this); | 457 return DoGenerateCode(this); |
| 458 } | 458 } |
| 459 | 459 |
| 460 | 460 |
| 461 template <> | 461 template <> |
| 462 HValue* CodeStubGraphBuilder<KeyedStoreFastElementStub>::BuildCodeStub() { | 462 HValue* CodeStubGraphBuilder<KeyedStoreFastElementStub>::BuildCodeStub() { |
| 463 BuildUncheckedMonomorphicElementAccess( | 463 BuildUncheckedMonomorphicElementAccess( |
| 464 GetParameter(0), GetParameter(1), GetParameter(2), NULL, | 464 GetParameter(0), GetParameter(1), GetParameter(2), NULL, |
| 465 casted_stub()->is_js_array(), casted_stub()->elements_kind(), | 465 casted_stub()->is_js_array(), casted_stub()->elements_kind(), |
| 466 true, NEVER_RETURN_HOLE, casted_stub()->store_mode(), | 466 true, NEVER_RETURN_HOLE, casted_stub()->store_mode(), |
| 467 Representation::Tagged()); | 467 Representation::Smi()); |
| 468 | 468 |
| 469 return GetParameter(2); | 469 return GetParameter(2); |
| 470 } | 470 } |
| 471 | 471 |
| 472 | 472 |
| 473 Handle<Code> KeyedStoreFastElementStub::GenerateCode() { | 473 Handle<Code> KeyedStoreFastElementStub::GenerateCode() { |
| 474 return DoGenerateCode(this); | 474 return DoGenerateCode(this); |
| 475 } | 475 } |
| 476 | 476 |
| 477 | 477 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 581 | 581 |
| 582 HConstant* max_alloc_length = | 582 HConstant* max_alloc_length = |
| 583 new(zone()) HConstant(JSObject::kInitialMaxFastElementArray, | 583 new(zone()) HConstant(JSObject::kInitialMaxFastElementArray, |
| 584 Representation::Tagged()); | 584 Representation::Tagged()); |
| 585 AddInstruction(max_alloc_length); | 585 AddInstruction(max_alloc_length); |
| 586 const int initial_capacity = JSArray::kPreallocatedArrayElements; | 586 const int initial_capacity = JSArray::kPreallocatedArrayElements; |
| 587 HConstant* initial_capacity_node = | 587 HConstant* initial_capacity_node = |
| 588 new(zone()) HConstant(initial_capacity, Representation::Tagged()); | 588 new(zone()) HConstant(initial_capacity, Representation::Tagged()); |
| 589 AddInstruction(initial_capacity_node); | 589 AddInstruction(initial_capacity_node); |
| 590 | 590 |
| 591 // Since we're forcing Integer32 representation for this HBoundsCheck, | 591 // Since we're forcing Integer32 representation for this HBoundsCheck, |
|
Jakob Kummerow
2013/05/24 08:41:16
This comment seems outdated. I think you can just
| |
| 592 // there's no need to Smi-check the index. | 592 // there's no need to Smi-check the index. |
| 593 HBoundsCheck* checked_arg = AddBoundsCheck(argument, max_alloc_length, | 593 HBoundsCheck* checked_arg = AddBoundsCheck(argument, max_alloc_length, |
| 594 ALLOW_SMI_KEY, | 594 ALLOW_SMI_KEY, |
| 595 Representation::Tagged()); | 595 Representation::Smi()); |
| 596 IfBuilder if_builder(this); | 596 IfBuilder if_builder(this); |
| 597 if_builder.IfCompare(checked_arg, constant_zero, Token::EQ); | 597 if_builder.IfCompare(checked_arg, constant_zero, Token::EQ); |
| 598 if_builder.Then(); | 598 if_builder.Then(); |
| 599 Push(initial_capacity_node); // capacity | 599 Push(initial_capacity_node); // capacity |
| 600 Push(constant_zero); // length | 600 Push(constant_zero); // length |
| 601 if_builder.Else(); | 601 if_builder.Else(); |
| 602 Push(checked_arg); // capacity | 602 Push(checked_arg); // capacity |
| 603 Push(checked_arg); // length | 603 Push(checked_arg); // length |
| 604 if_builder.End(); | 604 if_builder.End(); |
| 605 | 605 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 694 ? graph()->GetConstantSmi1() | 694 ? graph()->GetConstantSmi1() |
| 695 : graph()->GetConstantUndefined(); | 695 : graph()->GetConstantUndefined(); |
| 696 } | 696 } |
| 697 | 697 |
| 698 | 698 |
| 699 Handle<Code> CompareNilICStub::GenerateCode() { | 699 Handle<Code> CompareNilICStub::GenerateCode() { |
| 700 return DoGenerateCode(this); | 700 return DoGenerateCode(this); |
| 701 } | 701 } |
| 702 | 702 |
| 703 } } // namespace v8::internal | 703 } } // namespace v8::internal |
| OLD | NEW |