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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 static_cast<HValue*>(NULL), | 345 static_cast<HValue*>(NULL), |
346 FAST_ELEMENTS); | 346 FAST_ELEMENTS); |
347 IfBuilder checker(this); | 347 IfBuilder checker(this); |
348 checker.IfNot<HCompareObjectEqAndBranch, HValue*>(allocation_site, | 348 checker.IfNot<HCompareObjectEqAndBranch, HValue*>(allocation_site, |
349 undefined); | 349 undefined); |
350 checker.Then(); | 350 checker.Then(); |
351 | 351 |
352 HObjectAccess access = HObjectAccess::ForAllocationSiteTransitionInfo(); | 352 HObjectAccess access = HObjectAccess::ForAllocationSiteTransitionInfo(); |
353 HInstruction* boilerplate = Add<HLoadNamedField>(allocation_site, access); | 353 HInstruction* boilerplate = Add<HLoadNamedField>(allocation_site, access); |
354 if (mode == FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS) { | 354 if (mode == FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS) { |
355 HValue* elements = AddLoadElements(boilerplate, NULL); | 355 HValue* elements = AddLoadElements(boilerplate); |
356 | 356 |
357 IfBuilder if_fixed_cow(this); | 357 IfBuilder if_fixed_cow(this); |
358 if_fixed_cow.If<HCompareMap>(elements, factory->fixed_cow_array_map()); | 358 if_fixed_cow.If<HCompareMap>(elements, factory->fixed_cow_array_map()); |
359 if_fixed_cow.Then(); | 359 if_fixed_cow.Then(); |
360 environment()->Push(BuildCloneShallowArray(boilerplate, | 360 environment()->Push(BuildCloneShallowArray(boilerplate, |
361 allocation_site, | 361 allocation_site, |
362 alloc_site_mode, | 362 alloc_site_mode, |
363 FAST_ELEMENTS, | 363 FAST_ELEMENTS, |
364 0/*copy-on-write*/)); | 364 0/*copy-on-write*/)); |
365 if_fixed_cow.Else(); | 365 if_fixed_cow.Else(); |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 return DoGenerateCode(this); | 506 return DoGenerateCode(this); |
507 } | 507 } |
508 | 508 |
509 | 509 |
510 template<> | 510 template<> |
511 HValue* CodeStubGraphBuilder<LoadFieldStub>::BuildCodeStub() { | 511 HValue* CodeStubGraphBuilder<LoadFieldStub>::BuildCodeStub() { |
512 Representation rep = casted_stub()->representation(); | 512 Representation rep = casted_stub()->representation(); |
513 HObjectAccess access = casted_stub()->is_inobject() ? | 513 HObjectAccess access = casted_stub()->is_inobject() ? |
514 HObjectAccess::ForJSObjectOffset(casted_stub()->offset(), rep) : | 514 HObjectAccess::ForJSObjectOffset(casted_stub()->offset(), rep) : |
515 HObjectAccess::ForBackingStoreOffset(casted_stub()->offset(), rep); | 515 HObjectAccess::ForBackingStoreOffset(casted_stub()->offset(), rep); |
516 return AddInstruction(BuildLoadNamedField(GetParameter(0), access, NULL)); | 516 return AddInstruction(BuildLoadNamedField(GetParameter(0), access)); |
517 } | 517 } |
518 | 518 |
519 | 519 |
520 Handle<Code> LoadFieldStub::GenerateCode() { | 520 Handle<Code> LoadFieldStub::GenerateCode() { |
521 return DoGenerateCode(this); | 521 return DoGenerateCode(this); |
522 } | 522 } |
523 | 523 |
524 | 524 |
525 template<> | 525 template<> |
526 HValue* CodeStubGraphBuilder<KeyedLoadFieldStub>::BuildCodeStub() { | 526 HValue* CodeStubGraphBuilder<KeyedLoadFieldStub>::BuildCodeStub() { |
527 Representation rep = casted_stub()->representation(); | 527 Representation rep = casted_stub()->representation(); |
528 HObjectAccess access = casted_stub()->is_inobject() ? | 528 HObjectAccess access = casted_stub()->is_inobject() ? |
529 HObjectAccess::ForJSObjectOffset(casted_stub()->offset(), rep) : | 529 HObjectAccess::ForJSObjectOffset(casted_stub()->offset(), rep) : |
530 HObjectAccess::ForBackingStoreOffset(casted_stub()->offset(), rep); | 530 HObjectAccess::ForBackingStoreOffset(casted_stub()->offset(), rep); |
531 return AddInstruction(BuildLoadNamedField(GetParameter(0), access, NULL)); | 531 return AddInstruction(BuildLoadNamedField(GetParameter(0), access)); |
532 } | 532 } |
533 | 533 |
534 | 534 |
535 Handle<Code> KeyedLoadFieldStub::GenerateCode() { | 535 Handle<Code> KeyedLoadFieldStub::GenerateCode() { |
536 return DoGenerateCode(this); | 536 return DoGenerateCode(this); |
537 } | 537 } |
538 | 538 |
539 | 539 |
540 template <> | 540 template <> |
541 HValue* CodeStubGraphBuilder<KeyedStoreFastElementStub>::BuildCodeStub() { | 541 HValue* CodeStubGraphBuilder<KeyedStoreFastElementStub>::BuildCodeStub() { |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
898 return value; | 898 return value; |
899 } | 899 } |
900 | 900 |
901 | 901 |
902 Handle<Code> ElementsTransitionAndStoreStub::GenerateCode() { | 902 Handle<Code> ElementsTransitionAndStoreStub::GenerateCode() { |
903 return DoGenerateCode(this); | 903 return DoGenerateCode(this); |
904 } | 904 } |
905 | 905 |
906 | 906 |
907 } } // namespace v8::internal | 907 } } // namespace v8::internal |
OLD | NEW |