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

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

Issue 703473004: [turbofan] Add AllocateHeapNumberStub to avoid runtime call. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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
OLDNEW
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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/bailout-reason.h" 7 #include "src/bailout-reason.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/field-index.h" 9 #include "src/field-index.h"
10 #include "src/hydrogen.h" 10 #include "src/hydrogen.h"
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 casted_stub()->is_js_array()); 876 casted_stub()->is_js_array());
877 877
878 return GetParameter(0); 878 return GetParameter(0);
879 } 879 }
880 880
881 881
882 Handle<Code> TransitionElementsKindStub::GenerateCode() { 882 Handle<Code> TransitionElementsKindStub::GenerateCode() {
883 return DoGenerateCode(this); 883 return DoGenerateCode(this);
884 } 884 }
885 885
886
887 template <>
888 HValue* CodeStubGraphBuilder<AllocateHeapNumberStub>::BuildCodeStub() {
889 HValue* result =
890 Add<HAllocate>(Add<HConstant>(HeapNumber::kSize), HType::HeapNumber(),
891 NOT_TENURED, HEAP_NUMBER_TYPE);
892 AddStoreMapConstant(result, isolate()->factory()->heap_number_map());
893 return result;
894 }
895
896
897 Handle<Code> AllocateHeapNumberStub::GenerateCode() {
898 return DoGenerateCode(this);
899 }
900
901
886 HValue* CodeStubGraphBuilderBase::BuildArrayConstructor( 902 HValue* CodeStubGraphBuilderBase::BuildArrayConstructor(
887 ElementsKind kind, 903 ElementsKind kind,
888 AllocationSiteOverrideMode override_mode, 904 AllocationSiteOverrideMode override_mode,
889 ArgumentClass argument_class) { 905 ArgumentClass argument_class) {
890 HValue* constructor = GetParameter(ArrayConstructorStubBase::kConstructor); 906 HValue* constructor = GetParameter(ArrayConstructorStubBase::kConstructor);
891 HValue* alloc_site = GetParameter(ArrayConstructorStubBase::kAllocationSite); 907 HValue* alloc_site = GetParameter(ArrayConstructorStubBase::kAllocationSite);
892 JSArrayBuilder array_builder(this, kind, alloc_site, constructor, 908 JSArrayBuilder array_builder(this, kind, alloc_site, constructor,
893 override_mode); 909 override_mode);
894 HValue* result = NULL; 910 HValue* result = NULL;
895 switch (argument_class) { 911 switch (argument_class) {
(...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after
2019 2035
2020 // Probe the stub cache. 2036 // Probe the stub cache.
2021 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( 2037 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags(
2022 Code::ComputeHandlerFlags(Code::LOAD_IC)); 2038 Code::ComputeHandlerFlags(Code::LOAD_IC));
2023 Add<HTailCallThroughMegamorphicCache>(receiver, name, flags); 2039 Add<HTailCallThroughMegamorphicCache>(receiver, name, flags);
2024 2040
2025 // We never continue. 2041 // We never continue.
2026 return graph()->GetConstant0(); 2042 return graph()->GetConstant0();
2027 } 2043 }
2028 } } // namespace v8::internal 2044 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698