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

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

Issue 61893009: Add initial hydrogenized NewStringAddStub. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add test case for --new-string-add. Created 7 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
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/code-stubs.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 25 matching lines...) Expand all
36 36
37 namespace v8 { 37 namespace v8 {
38 namespace internal { 38 namespace internal {
39 39
40 // List of code stubs used on all platforms. 40 // List of code stubs used on all platforms.
41 #define CODE_STUB_LIST_ALL_PLATFORMS(V) \ 41 #define CODE_STUB_LIST_ALL_PLATFORMS(V) \
42 V(CallFunction) \ 42 V(CallFunction) \
43 V(CallConstruct) \ 43 V(CallConstruct) \
44 V(BinaryOp) \ 44 V(BinaryOp) \
45 V(StringAdd) \ 45 V(StringAdd) \
46 V(NewStringAdd) \
46 V(SubString) \ 47 V(SubString) \
47 V(StringCompare) \ 48 V(StringCompare) \
48 V(Compare) \ 49 V(Compare) \
49 V(CompareIC) \ 50 V(CompareIC) \
50 V(CompareNilIC) \ 51 V(CompareNilIC) \
51 V(MathPow) \ 52 V(MathPow) \
52 V(StringLength) \ 53 V(StringLength) \
53 V(FunctionPrototype) \ 54 V(FunctionPrototype) \
54 V(StoreArrayLength) \ 55 V(StoreArrayLength) \
55 V(RecordWrite) \ 56 V(RecordWrite) \
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1172 Token::Value op_; 1173 Token::Value op_;
1173 OverwriteMode mode_; 1174 OverwriteMode mode_;
1174 1175
1175 Maybe<int> fixed_right_arg_; 1176 Maybe<int> fixed_right_arg_;
1176 State left_state_; 1177 State left_state_;
1177 State right_state_; 1178 State right_state_;
1178 State result_state_; 1179 State result_state_;
1179 }; 1180 };
1180 1181
1181 1182
1183 // TODO(bmeurer): Rename to StringAddStub once we dropped the old StringAddStub.
1184 class NewStringAddStub V8_FINAL : public HydrogenCodeStub {
1185 public:
1186 NewStringAddStub(StringAddFlags flags, PretenureFlag pretenure_flag)
1187 : bit_field_(StringAddFlagsBits::encode(flags) |
1188 PretenureFlagBits::encode(pretenure_flag)) {}
1189
1190 StringAddFlags flags() const {
1191 return StringAddFlagsBits::decode(bit_field_);
1192 }
1193
1194 PretenureFlag pretenure_flag() const {
1195 return PretenureFlagBits::decode(bit_field_);
1196 }
1197
1198 virtual Handle<Code> GenerateCode(Isolate* isolate) V8_OVERRIDE;
1199
1200 virtual void InitializeInterfaceDescriptor(
1201 Isolate* isolate,
1202 CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
1203
1204 static void InstallDescriptors(Isolate* isolate);
1205
1206 // Parameters accessed via CodeStubGraphBuilder::GetParameter()
1207 static const int kLeft = 0;
1208 static const int kRight = 1;
1209
1210 private:
1211 class StringAddFlagsBits: public BitField<StringAddFlags, 0, 2> {};
1212 class PretenureFlagBits: public BitField<PretenureFlag, 2, 1> {};
1213 uint32_t bit_field_;
1214
1215 virtual Major MajorKey() V8_OVERRIDE { return NewStringAdd; }
1216 virtual int NotMissMinorKey() V8_OVERRIDE { return bit_field_; }
1217
1218 virtual void PrintBaseName(StringStream* stream) V8_OVERRIDE;
1219
1220 DISALLOW_COPY_AND_ASSIGN(NewStringAddStub);
1221 };
1222
1223
1182 class ICCompareStub: public PlatformCodeStub { 1224 class ICCompareStub: public PlatformCodeStub {
1183 public: 1225 public:
1184 ICCompareStub(Token::Value op, 1226 ICCompareStub(Token::Value op,
1185 CompareIC::State left, 1227 CompareIC::State left,
1186 CompareIC::State right, 1228 CompareIC::State right,
1187 CompareIC::State handler) 1229 CompareIC::State handler)
1188 : op_(op), 1230 : op_(op),
1189 left_(left), 1231 left_(left),
1190 right_(right), 1232 right_(right),
1191 state_(handler) { 1233 state_(handler) {
(...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after
2364 int MinorKey() { return 0; } 2406 int MinorKey() { return 0; }
2365 2407
2366 void Generate(MacroAssembler* masm); 2408 void Generate(MacroAssembler* masm);
2367 2409
2368 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); 2410 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub);
2369 }; 2411 };
2370 2412
2371 } } // namespace v8::internal 2413 } } // namespace v8::internal
2372 2414
2373 #endif // V8_CODE_STUBS_H_ 2415 #endif // V8_CODE_STUBS_H_
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698