Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(414)

Side by Side Diff: src/code-stubs.cc

Issue 18881004: Turn ElementsTransitionAndStore stub into a HydrogenCodeStub. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/code-stubs.h ('k') | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 || Contains(ToBooleanStub::HEAP_NUMBER); 804 || Contains(ToBooleanStub::HEAP_NUMBER);
805 } 805 }
806 806
807 807
808 bool ToBooleanStub::Types::CanBeUndetectable() const { 808 bool ToBooleanStub::Types::CanBeUndetectable() const {
809 return Contains(ToBooleanStub::SPEC_OBJECT) 809 return Contains(ToBooleanStub::SPEC_OBJECT)
810 || Contains(ToBooleanStub::STRING); 810 || Contains(ToBooleanStub::STRING);
811 } 811 }
812 812
813 813
814 void ElementsTransitionAndStoreStub::Generate(MacroAssembler* masm) {
815 Label fail;
816 AllocationSiteMode mode = AllocationSite::GetMode(from_, to_);
817 ASSERT(!IsFastHoleyElementsKind(from_) || IsFastHoleyElementsKind(to_));
818 if (!FLAG_trace_elements_transitions) {
819 if (IsFastSmiOrObjectElementsKind(to_)) {
820 if (IsFastSmiOrObjectElementsKind(from_)) {
821 ElementsTransitionGenerator::
822 GenerateMapChangeElementsTransition(masm, mode, &fail);
823 } else if (IsFastDoubleElementsKind(from_)) {
824 ASSERT(!IsFastSmiElementsKind(to_));
825 ElementsTransitionGenerator::GenerateDoubleToObject(masm, mode, &fail);
826 } else {
827 UNREACHABLE();
828 }
829 KeyedStoreStubCompiler::GenerateStoreFastElement(masm,
830 is_jsarray_,
831 to_,
832 store_mode_);
833 } else if (IsFastSmiElementsKind(from_) &&
834 IsFastDoubleElementsKind(to_)) {
835 ElementsTransitionGenerator::GenerateSmiToDouble(masm, mode, &fail);
836 KeyedStoreStubCompiler::GenerateStoreFastDoubleElement(masm,
837 is_jsarray_,
838 store_mode_);
839 } else if (IsFastDoubleElementsKind(from_)) {
840 ASSERT(to_ == FAST_HOLEY_DOUBLE_ELEMENTS);
841 ElementsTransitionGenerator::
842 GenerateMapChangeElementsTransition(masm, mode, &fail);
843 } else {
844 UNREACHABLE();
845 }
846 }
847 masm->bind(&fail);
848 KeyedStoreIC::GenerateRuntimeSetProperty(masm, strict_mode_);
849 }
850
851
852 void StubFailureTrampolineStub::GenerateAheadOfTime(Isolate* isolate) { 814 void StubFailureTrampolineStub::GenerateAheadOfTime(Isolate* isolate) {
853 StubFailureTrampolineStub stub1(NOT_JS_FUNCTION_STUB_MODE); 815 StubFailureTrampolineStub stub1(NOT_JS_FUNCTION_STUB_MODE);
854 StubFailureTrampolineStub stub2(JS_FUNCTION_STUB_MODE); 816 StubFailureTrampolineStub stub2(JS_FUNCTION_STUB_MODE);
855 stub1.GetCode(isolate)->set_is_pregenerated(true); 817 stub1.GetCode(isolate)->set_is_pregenerated(true);
856 stub2.GetCode(isolate)->set_is_pregenerated(true); 818 stub2.GetCode(isolate)->set_is_pregenerated(true);
857 } 819 }
858 820
859 821
860 void ProfileEntryHookStub::EntryHookTrampoline(intptr_t function, 822 void ProfileEntryHookStub::EntryHookTrampoline(intptr_t function,
861 intptr_t stack_pointer) { 823 intptr_t stack_pointer) {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
915 InstallDescriptor(isolate, &stub3); 877 InstallDescriptor(isolate, &stub3);
916 } 878 }
917 879
918 InternalArrayConstructorStub::InternalArrayConstructorStub( 880 InternalArrayConstructorStub::InternalArrayConstructorStub(
919 Isolate* isolate) { 881 Isolate* isolate) {
920 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); 882 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate);
921 } 883 }
922 884
923 885
924 } } // namespace v8::internal 886 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/code-stubs.h ('k') | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698