| 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 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 | 563 |
| 564 | 564 |
| 565 bool ToBooleanStub::Types::CanBeUndetectable() const { | 565 bool ToBooleanStub::Types::CanBeUndetectable() const { |
| 566 return Contains(ToBooleanStub::SPEC_OBJECT) | 566 return Contains(ToBooleanStub::SPEC_OBJECT) |
| 567 || Contains(ToBooleanStub::STRING); | 567 || Contains(ToBooleanStub::STRING); |
| 568 } | 568 } |
| 569 | 569 |
| 570 | 570 |
| 571 void ElementsTransitionAndStoreStub::Generate(MacroAssembler* masm) { | 571 void ElementsTransitionAndStoreStub::Generate(MacroAssembler* masm) { |
| 572 Label fail; | 572 Label fail; |
| 573 AllocationSiteMode mode = AllocationSiteInfo::GetMode(from_, to_); |
| 573 ASSERT(!IsFastHoleyElementsKind(from_) || IsFastHoleyElementsKind(to_)); | 574 ASSERT(!IsFastHoleyElementsKind(from_) || IsFastHoleyElementsKind(to_)); |
| 574 if (!FLAG_trace_elements_transitions) { | 575 if (!FLAG_trace_elements_transitions) { |
| 575 if (IsFastSmiOrObjectElementsKind(to_)) { | 576 if (IsFastSmiOrObjectElementsKind(to_)) { |
| 576 if (IsFastSmiOrObjectElementsKind(from_)) { | 577 if (IsFastSmiOrObjectElementsKind(from_)) { |
| 577 ElementsTransitionGenerator:: | 578 ElementsTransitionGenerator:: |
| 578 GenerateMapChangeElementsTransition(masm); | 579 GenerateMapChangeElementsTransition(masm, mode, &fail); |
| 579 } else if (IsFastDoubleElementsKind(from_)) { | 580 } else if (IsFastDoubleElementsKind(from_)) { |
| 580 ASSERT(!IsFastSmiElementsKind(to_)); | 581 ASSERT(!IsFastSmiElementsKind(to_)); |
| 581 ElementsTransitionGenerator::GenerateDoubleToObject(masm, &fail); | 582 ElementsTransitionGenerator::GenerateDoubleToObject(masm, mode, &fail); |
| 582 } else { | 583 } else { |
| 583 UNREACHABLE(); | 584 UNREACHABLE(); |
| 584 } | 585 } |
| 585 KeyedStoreStubCompiler::GenerateStoreFastElement(masm, | 586 KeyedStoreStubCompiler::GenerateStoreFastElement(masm, |
| 586 is_jsarray_, | 587 is_jsarray_, |
| 587 to_, | 588 to_, |
| 588 grow_mode_); | 589 grow_mode_); |
| 589 } else if (IsFastSmiElementsKind(from_) && | 590 } else if (IsFastSmiElementsKind(from_) && |
| 590 IsFastDoubleElementsKind(to_)) { | 591 IsFastDoubleElementsKind(to_)) { |
| 591 ElementsTransitionGenerator::GenerateSmiToDouble(masm, &fail); | 592 ElementsTransitionGenerator::GenerateSmiToDouble(masm, mode, &fail); |
| 592 KeyedStoreStubCompiler::GenerateStoreFastDoubleElement(masm, | 593 KeyedStoreStubCompiler::GenerateStoreFastDoubleElement(masm, |
| 593 is_jsarray_, | 594 is_jsarray_, |
| 594 grow_mode_); | 595 grow_mode_); |
| 595 } else if (IsFastDoubleElementsKind(from_)) { | 596 } else if (IsFastDoubleElementsKind(from_)) { |
| 596 ASSERT(to_ == FAST_HOLEY_DOUBLE_ELEMENTS); | 597 ASSERT(to_ == FAST_HOLEY_DOUBLE_ELEMENTS); |
| 597 ElementsTransitionGenerator:: | 598 ElementsTransitionGenerator:: |
| 598 GenerateMapChangeElementsTransition(masm); | 599 GenerateMapChangeElementsTransition(masm, mode, &fail); |
| 599 } else { | 600 } else { |
| 600 UNREACHABLE(); | 601 UNREACHABLE(); |
| 601 } | 602 } |
| 602 } | 603 } |
| 603 masm->bind(&fail); | 604 masm->bind(&fail); |
| 604 KeyedStoreIC::GenerateRuntimeSetProperty(masm, strict_mode_); | 605 KeyedStoreIC::GenerateRuntimeSetProperty(masm, strict_mode_); |
| 605 } | 606 } |
| 606 | 607 |
| 607 | 608 |
| 608 FunctionEntryHook ProfileEntryHookStub::entry_hook_ = NULL; | 609 FunctionEntryHook ProfileEntryHookStub::entry_hook_ = NULL; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 620 // already active, as the hooks won't stack. | 621 // already active, as the hooks won't stack. |
| 621 if (entry_hook != 0 && entry_hook_ != 0) | 622 if (entry_hook != 0 && entry_hook_ != 0) |
| 622 return false; | 623 return false; |
| 623 | 624 |
| 624 entry_hook_ = entry_hook; | 625 entry_hook_ = entry_hook; |
| 625 return true; | 626 return true; |
| 626 } | 627 } |
| 627 | 628 |
| 628 | 629 |
| 629 } } // namespace v8::internal | 630 } } // namespace v8::internal |
| OLD | NEW |