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

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

Issue 925373002: Test StringLengthStub generation via TurboFan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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
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 855 matching lines...) Expand 10 before | Expand all | Expand 10 after
866 return GetParameter(StoreTransitionDescriptor::kValueIndex); 866 return GetParameter(StoreTransitionDescriptor::kValueIndex);
867 } 867 }
868 868
869 869
870 Handle<Code> StoreTransitionStub::GenerateCode() { 870 Handle<Code> StoreTransitionStub::GenerateCode() {
871 return DoGenerateCode(this); 871 return DoGenerateCode(this);
872 } 872 }
873 873
874 874
875 template <> 875 template <>
876 HValue* CodeStubGraphBuilder<StringLengthStub>::BuildCodeStub() {
877 HValue* string = BuildLoadNamedField(GetParameter(0),
878 FieldIndex::ForInObjectOffset(JSValue::kValueOffset));
879 return BuildLoadNamedField(string,
880 FieldIndex::ForInObjectOffset(String::kLengthOffset));
881 }
882
883
884 Handle<Code> StringLengthStub::GenerateCode() {
885 return DoGenerateCode(this);
886 }
887
888
889 template <>
890 HValue* CodeStubGraphBuilder<StoreFastElementStub>::BuildCodeStub() { 876 HValue* CodeStubGraphBuilder<StoreFastElementStub>::BuildCodeStub() {
891 BuildUncheckedMonomorphicElementAccess( 877 BuildUncheckedMonomorphicElementAccess(
892 GetParameter(StoreDescriptor::kReceiverIndex), 878 GetParameter(StoreDescriptor::kReceiverIndex),
893 GetParameter(StoreDescriptor::kNameIndex), 879 GetParameter(StoreDescriptor::kNameIndex),
894 GetParameter(StoreDescriptor::kValueIndex), casted_stub()->is_js_array(), 880 GetParameter(StoreDescriptor::kValueIndex), casted_stub()->is_js_array(),
895 casted_stub()->elements_kind(), STORE, NEVER_RETURN_HOLE, 881 casted_stub()->elements_kind(), STORE, NEVER_RETURN_HOLE,
896 casted_stub()->store_mode()); 882 casted_stub()->store_mode());
897 883
898 return GetParameter(2); 884 return GetParameter(2);
899 } 885 }
(...skipping 1348 matching lines...) Expand 10 before | Expand all | Expand 10 after
2248 // megamorphic case is handled as part of the default stub. 2234 // megamorphic case is handled as part of the default stub.
2249 DCHECK(!FLAG_vector_ics); 2235 DCHECK(!FLAG_vector_ics);
2250 2236
2251 // Probe the stub cache. 2237 // Probe the stub cache.
2252 Add<HTailCallThroughMegamorphicCache>(receiver, name); 2238 Add<HTailCallThroughMegamorphicCache>(receiver, name);
2253 2239
2254 // We never continue. 2240 // We never continue.
2255 return graph()->GetConstant0(); 2241 return graph()->GetConstant0();
2256 } 2242 }
2257 } } // namespace v8::internal 2243 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698