Chromium Code Reviews| 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 29 matching lines...) Expand all Loading... | |
| 40 V(CallFunction) \ | 40 V(CallFunction) \ |
| 41 V(CallConstruct) \ | 41 V(CallConstruct) \ |
| 42 V(UnaryOp) \ | 42 V(UnaryOp) \ |
| 43 V(BinaryOp) \ | 43 V(BinaryOp) \ |
| 44 V(StringAdd) \ | 44 V(StringAdd) \ |
| 45 V(SubString) \ | 45 V(SubString) \ |
| 46 V(StringCompare) \ | 46 V(StringCompare) \ |
| 47 V(Compare) \ | 47 V(Compare) \ |
| 48 V(CompareIC) \ | 48 V(CompareIC) \ |
| 49 V(MathPow) \ | 49 V(MathPow) \ |
| 50 V(StringLength) \ | |
| 50 V(RecordWrite) \ | 51 V(RecordWrite) \ |
| 51 V(StoreBufferOverflow) \ | 52 V(StoreBufferOverflow) \ |
| 52 V(RegExpExec) \ | 53 V(RegExpExec) \ |
| 53 V(TranscendentalCache) \ | 54 V(TranscendentalCache) \ |
| 54 V(Instanceof) \ | 55 V(Instanceof) \ |
| 55 V(ConvertToDouble) \ | 56 V(ConvertToDouble) \ |
| 56 V(WriteInt32ToHeapNumber) \ | 57 V(WriteInt32ToHeapNumber) \ |
| 57 V(StackCheck) \ | 58 V(StackCheck) \ |
| 58 V(Interrupt) \ | 59 V(Interrupt) \ |
| 59 V(FastNewClosure) \ | 60 V(FastNewClosure) \ |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 532 virtual void Generate(MacroAssembler* masm); | 533 virtual void Generate(MacroAssembler* masm); |
| 533 | 534 |
| 534 private: | 535 private: |
| 535 virtual CodeStub::Major MajorKey() { return MathPow; } | 536 virtual CodeStub::Major MajorKey() { return MathPow; } |
| 536 virtual int MinorKey() { return exponent_type_; } | 537 virtual int MinorKey() { return exponent_type_; } |
| 537 | 538 |
| 538 ExponentType exponent_type_; | 539 ExponentType exponent_type_; |
| 539 }; | 540 }; |
| 540 | 541 |
| 541 | 542 |
| 543 class ICStub: public PlatformCodeStub { | |
| 544 public: | |
| 545 explicit ICStub(Code::Kind kind) : kind_(kind) { } | |
| 546 virtual int GetCodeKind() { return kind_; } | |
| 547 virtual InlineCacheState GetICState() { return MONOMORPHIC; } | |
| 548 | |
| 549 bool Describes(Code* code) { | |
| 550 return GetMajorKey(code) == MajorKey() && code->stub_info() == MinorKey(); | |
| 551 } | |
| 552 | |
| 553 protected: | |
| 554 class KindBits: public BitField<Code::Kind, 0, 4> {}; | |
| 555 virtual void FinishCode(Handle<Code> code) { | |
| 556 code->set_stub_info(MinorKey()); | |
| 557 } | |
| 558 | |
| 559 Code::Kind kind_; | |
|
Jakob Kummerow
2013/01/21 14:41:39
protected data members are frowned upon. Please ma
Toon Verwaest
2013/01/21 14:51:17
Done.
| |
| 560 }; | |
| 561 | |
| 562 | |
| 563 class StringLengthStub: public ICStub { | |
| 564 public: | |
| 565 StringLengthStub(Code::Kind kind, bool support_wrapper) | |
| 566 : ICStub(kind), support_wrapper_(support_wrapper) { } | |
| 567 virtual void Generate(MacroAssembler* masm); | |
| 568 | |
| 569 private: | |
| 570 class WrapperModeBits: public BitField<bool, 4, 1> {}; | |
| 571 virtual CodeStub::Major MajorKey() { return StringLength; } | |
| 572 virtual int MinorKey() { | |
| 573 return KindBits::encode(kind_) | WrapperModeBits::encode(support_wrapper_); | |
| 574 } | |
| 575 | |
| 576 bool support_wrapper_; | |
| 577 }; | |
| 578 | |
| 579 | |
| 542 class BinaryOpStub: public PlatformCodeStub { | 580 class BinaryOpStub: public PlatformCodeStub { |
| 543 public: | 581 public: |
| 544 BinaryOpStub(Token::Value op, OverwriteMode mode) | 582 BinaryOpStub(Token::Value op, OverwriteMode mode) |
| 545 : op_(op), | 583 : op_(op), |
| 546 mode_(mode), | 584 mode_(mode), |
| 547 platform_specific_bit_(false), | 585 platform_specific_bit_(false), |
| 548 left_type_(BinaryOpIC::UNINITIALIZED), | 586 left_type_(BinaryOpIC::UNINITIALIZED), |
| 549 right_type_(BinaryOpIC::UNINITIALIZED), | 587 right_type_(BinaryOpIC::UNINITIALIZED), |
| 550 result_type_(BinaryOpIC::UNINITIALIZED) { | 588 result_type_(BinaryOpIC::UNINITIALIZED) { |
| 551 Initialize(); | 589 Initialize(); |
| (...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1312 | 1350 |
| 1313 // The current function entry hook. | 1351 // The current function entry hook. |
| 1314 static FunctionEntryHook entry_hook_; | 1352 static FunctionEntryHook entry_hook_; |
| 1315 | 1353 |
| 1316 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); | 1354 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); |
| 1317 }; | 1355 }; |
| 1318 | 1356 |
| 1319 } } // namespace v8::internal | 1357 } } // namespace v8::internal |
| 1320 | 1358 |
| 1321 #endif // V8_CODE_STUBS_H_ | 1359 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |