OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/code-stubs.h" | 5 #include "src/code-stubs.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
10 #include "src/crankshaft/hydrogen.h" | 10 #include "src/crankshaft/hydrogen.h" |
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 elements); | 831 elements); |
832 | 832 |
833 return bound_function; | 833 return bound_function; |
834 } | 834 } |
835 | 835 |
836 Handle<Code> FastFunctionBindStub::GenerateCode() { | 836 Handle<Code> FastFunctionBindStub::GenerateCode() { |
837 return DoGenerateCode(this); | 837 return DoGenerateCode(this); |
838 } | 838 } |
839 | 839 |
840 template <> | 840 template <> |
841 HValue* CodeStubGraphBuilder<GrowArrayElementsStub>::BuildCodeStub() { | |
842 ElementsKind kind = casted_stub()->elements_kind(); | |
843 if (IsFastDoubleElementsKind(kind)) { | |
844 info()->MarkAsSavesCallerDoubles(); | |
845 } | |
846 | |
847 HValue* object = GetParameter(Descriptor::kObject); | |
848 HValue* key = GetParameter(Descriptor::kKey); | |
849 | |
850 HValue* elements = AddLoadElements(object); | |
851 HValue* current_capacity = Add<HLoadNamedField>( | |
852 elements, nullptr, HObjectAccess::ForFixedArrayLength()); | |
853 | |
854 HValue* length = | |
855 casted_stub()->is_js_array() | |
856 ? Add<HLoadNamedField>(object, static_cast<HValue*>(NULL), | |
857 HObjectAccess::ForArrayLength(kind)) | |
858 : current_capacity; | |
859 | |
860 return BuildCheckAndGrowElementsCapacity(object, elements, kind, length, | |
861 current_capacity, key); | |
862 } | |
863 | |
864 | |
865 Handle<Code> GrowArrayElementsStub::GenerateCode() { | |
866 return DoGenerateCode(this); | |
867 } | |
868 | |
869 | |
870 template <> | |
871 HValue* CodeStubGraphBuilder<LoadFastElementStub>::BuildCodeStub() { | 841 HValue* CodeStubGraphBuilder<LoadFastElementStub>::BuildCodeStub() { |
872 LoadKeyedHoleMode hole_mode = casted_stub()->convert_hole_to_undefined() | 842 LoadKeyedHoleMode hole_mode = casted_stub()->convert_hole_to_undefined() |
873 ? CONVERT_HOLE_TO_UNDEFINED | 843 ? CONVERT_HOLE_TO_UNDEFINED |
874 : NEVER_RETURN_HOLE; | 844 : NEVER_RETURN_HOLE; |
875 | 845 |
876 HInstruction* load = BuildUncheckedMonomorphicElementAccess( | 846 HInstruction* load = BuildUncheckedMonomorphicElementAccess( |
877 GetParameter(Descriptor::kReceiver), GetParameter(Descriptor::kName), | 847 GetParameter(Descriptor::kReceiver), GetParameter(Descriptor::kName), |
878 NULL, casted_stub()->is_js_array(), casted_stub()->elements_kind(), LOAD, | 848 NULL, casted_stub()->is_js_array(), casted_stub()->elements_kind(), LOAD, |
879 hole_mode, STANDARD_STORE); | 849 hole_mode, STANDARD_STORE); |
880 return load; | 850 return load; |
(...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1982 return Pop(); | 1952 return Pop(); |
1983 } | 1953 } |
1984 | 1954 |
1985 | 1955 |
1986 Handle<Code> KeyedLoadGenericStub::GenerateCode() { | 1956 Handle<Code> KeyedLoadGenericStub::GenerateCode() { |
1987 return DoGenerateCode(this); | 1957 return DoGenerateCode(this); |
1988 } | 1958 } |
1989 | 1959 |
1990 } // namespace internal | 1960 } // namespace internal |
1991 } // namespace v8 | 1961 } // namespace v8 |
OLD | NEW |