OLD | NEW |
---|---|
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 26 matching lines...) Expand all Loading... | |
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(BinaryOpIC) \ | 44 V(BinaryOpIC) \ |
45 V(BinaryOpICWithAllocationSite) \ | 45 V(BinaryOpICWithAllocationSite) \ |
46 V(BinaryOpWithAllocationSite) \ | 46 V(BinaryOpWithAllocationSite) \ |
47 V(StringAdd) \ | |
48 V(NewStringAdd) \ | 47 V(NewStringAdd) \ |
Hannes Payer (out of office)
2014/01/22 13:05:57
StringAdd?
Benedikt Meurer
2014/01/22 13:16:02
Done.
| |
49 V(SubString) \ | 48 V(SubString) \ |
50 V(StringCompare) \ | 49 V(StringCompare) \ |
51 V(Compare) \ | 50 V(Compare) \ |
52 V(CompareIC) \ | 51 V(CompareIC) \ |
53 V(CompareNilIC) \ | 52 V(CompareNilIC) \ |
54 V(MathPow) \ | 53 V(MathPow) \ |
55 V(StringLength) \ | 54 V(StringLength) \ |
56 V(FunctionPrototype) \ | 55 V(FunctionPrototype) \ |
57 V(StoreArrayLength) \ | 56 V(StoreArrayLength) \ |
58 V(RecordWrite) \ | 57 V(RecordWrite) \ |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
440 virtual void AfterCall(MacroAssembler* masm) const = 0; | 439 virtual void AfterCall(MacroAssembler* masm) const = 0; |
441 | 440 |
442 protected: | 441 protected: |
443 RuntimeCallHelper() {} | 442 RuntimeCallHelper() {} |
444 | 443 |
445 private: | 444 private: |
446 DISALLOW_COPY_AND_ASSIGN(RuntimeCallHelper); | 445 DISALLOW_COPY_AND_ASSIGN(RuntimeCallHelper); |
447 }; | 446 }; |
448 | 447 |
449 | 448 |
450 // TODO(bmeurer): Move to the StringAddStub declaration once we're | |
451 // done with the translation to a hydrogen code stub. | |
452 enum StringAddFlags { | |
453 // Omit both parameter checks. | |
454 STRING_ADD_CHECK_NONE = 0, | |
455 // Check left parameter. | |
456 STRING_ADD_CHECK_LEFT = 1 << 0, | |
457 // Check right parameter. | |
458 STRING_ADD_CHECK_RIGHT = 1 << 1, | |
459 // Check both parameters. | |
460 STRING_ADD_CHECK_BOTH = STRING_ADD_CHECK_LEFT | STRING_ADD_CHECK_RIGHT | |
461 }; | |
462 | |
463 } } // namespace v8::internal | 449 } } // namespace v8::internal |
464 | 450 |
465 #if V8_TARGET_ARCH_IA32 | 451 #if V8_TARGET_ARCH_IA32 |
466 #include "ia32/code-stubs-ia32.h" | 452 #include "ia32/code-stubs-ia32.h" |
467 #elif V8_TARGET_ARCH_X64 | 453 #elif V8_TARGET_ARCH_X64 |
468 #include "x64/code-stubs-x64.h" | 454 #include "x64/code-stubs-x64.h" |
469 #elif V8_TARGET_ARCH_ARM | 455 #elif V8_TARGET_ARCH_ARM |
470 #include "arm/code-stubs-arm.h" | 456 #include "arm/code-stubs-arm.h" |
471 #elif V8_TARGET_ARCH_MIPS | 457 #elif V8_TARGET_ARCH_MIPS |
472 #include "mips/code-stubs-mips.h" | 458 #include "mips/code-stubs-mips.h" |
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1249 return BinaryOpWithAllocationSite; | 1235 return BinaryOpWithAllocationSite; |
1250 } | 1236 } |
1251 | 1237 |
1252 // Parameters accessed via CodeStubGraphBuilder::GetParameter() | 1238 // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
1253 static const int kAllocationSite = 0; | 1239 static const int kAllocationSite = 0; |
1254 static const int kLeft = 1; | 1240 static const int kLeft = 1; |
1255 static const int kRight = 2; | 1241 static const int kRight = 2; |
1256 }; | 1242 }; |
1257 | 1243 |
1258 | 1244 |
1259 // TODO(bmeurer): Rename to StringAddStub once we dropped the old StringAddStub. | 1245 enum StringAddFlags { |
1260 class NewStringAddStub V8_FINAL : public HydrogenCodeStub { | 1246 // Omit both parameter checks. |
1247 STRING_ADD_CHECK_NONE = 0, | |
1248 // Check left parameter. | |
1249 STRING_ADD_CHECK_LEFT = 1 << 0, | |
1250 // Check right parameter. | |
1251 STRING_ADD_CHECK_RIGHT = 1 << 1, | |
1252 // Check both parameters. | |
1253 STRING_ADD_CHECK_BOTH = STRING_ADD_CHECK_LEFT | STRING_ADD_CHECK_RIGHT | |
1254 }; | |
1255 | |
1256 | |
1257 class StringAddStub V8_FINAL : public HydrogenCodeStub { | |
1261 public: | 1258 public: |
1262 NewStringAddStub(StringAddFlags flags, PretenureFlag pretenure_flag) | 1259 StringAddStub(StringAddFlags flags, PretenureFlag pretenure_flag) |
1263 : bit_field_(StringAddFlagsBits::encode(flags) | | 1260 : bit_field_(StringAddFlagsBits::encode(flags) | |
1264 PretenureFlagBits::encode(pretenure_flag)) {} | 1261 PretenureFlagBits::encode(pretenure_flag)) {} |
1265 | 1262 |
1266 StringAddFlags flags() const { | 1263 StringAddFlags flags() const { |
1267 return StringAddFlagsBits::decode(bit_field_); | 1264 return StringAddFlagsBits::decode(bit_field_); |
1268 } | 1265 } |
1269 | 1266 |
1270 PretenureFlag pretenure_flag() const { | 1267 PretenureFlag pretenure_flag() const { |
1271 return PretenureFlagBits::decode(bit_field_); | 1268 return PretenureFlagBits::decode(bit_field_); |
1272 } | 1269 } |
(...skipping 17 matching lines...) Expand all Loading... | |
1290 private: | 1287 private: |
1291 class StringAddFlagsBits: public BitField<StringAddFlags, 0, 2> {}; | 1288 class StringAddFlagsBits: public BitField<StringAddFlags, 0, 2> {}; |
1292 class PretenureFlagBits: public BitField<PretenureFlag, 2, 1> {}; | 1289 class PretenureFlagBits: public BitField<PretenureFlag, 2, 1> {}; |
1293 uint32_t bit_field_; | 1290 uint32_t bit_field_; |
1294 | 1291 |
1295 virtual Major MajorKey() V8_OVERRIDE { return NewStringAdd; } | 1292 virtual Major MajorKey() V8_OVERRIDE { return NewStringAdd; } |
1296 virtual int NotMissMinorKey() V8_OVERRIDE { return bit_field_; } | 1293 virtual int NotMissMinorKey() V8_OVERRIDE { return bit_field_; } |
1297 | 1294 |
1298 virtual void PrintBaseName(StringStream* stream) V8_OVERRIDE; | 1295 virtual void PrintBaseName(StringStream* stream) V8_OVERRIDE; |
1299 | 1296 |
1300 DISALLOW_COPY_AND_ASSIGN(NewStringAddStub); | 1297 DISALLOW_COPY_AND_ASSIGN(StringAddStub); |
1301 }; | 1298 }; |
1302 | 1299 |
1303 | 1300 |
1304 class ICCompareStub: public PlatformCodeStub { | 1301 class ICCompareStub: public PlatformCodeStub { |
1305 public: | 1302 public: |
1306 ICCompareStub(Token::Value op, | 1303 ICCompareStub(Token::Value op, |
1307 CompareIC::State left, | 1304 CompareIC::State left, |
1308 CompareIC::State right, | 1305 CompareIC::State right, |
1309 CompareIC::State handler) | 1306 CompareIC::State handler) |
1310 : op_(op), | 1307 : op_(op), |
(...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2491 | 2488 |
2492 | 2489 |
2493 class CallDescriptors { | 2490 class CallDescriptors { |
2494 public: | 2491 public: |
2495 static void InitializeForIsolate(Isolate* isolate); | 2492 static void InitializeForIsolate(Isolate* isolate); |
2496 }; | 2493 }; |
2497 | 2494 |
2498 } } // namespace v8::internal | 2495 } } // namespace v8::internal |
2499 | 2496 |
2500 #endif // V8_CODE_STUBS_H_ | 2497 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |