| 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 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 virtual int MinorKey() { return exponent_type_; } | 541 virtual int MinorKey() { return exponent_type_; } |
| 542 | 542 |
| 543 ExponentType exponent_type_; | 543 ExponentType exponent_type_; |
| 544 }; | 544 }; |
| 545 | 545 |
| 546 | 546 |
| 547 class ICStub: public PlatformCodeStub { | 547 class ICStub: public PlatformCodeStub { |
| 548 public: | 548 public: |
| 549 explicit ICStub(Code::Kind kind) : kind_(kind) { } | 549 explicit ICStub(Code::Kind kind) : kind_(kind) { } |
| 550 virtual int GetCodeKind() { return kind_; } | 550 virtual int GetCodeKind() { return kind_; } |
| 551 virtual InlineCacheState GetICState() { return MONOMORPHIC; } | 551 // Currently all IC stubs do not collect explicit type feedback but rather |
| 552 // check the instance type. |
| 553 // TODO(verwaest): These stubs should collect proper type feedback, and should |
| 554 // not check the instance type explicitly (perhaps unless more than |
| 555 // kMaxPolymorphism maps are recorded). |
| 556 virtual InlineCacheState GetICState() { return MEGAMORPHIC; } |
| 552 | 557 |
| 553 bool Describes(Code* code) { | 558 bool Describes(Code* code) { |
| 554 return GetMajorKey(code) == MajorKey() && code->stub_info() == MinorKey(); | 559 return GetMajorKey(code) == MajorKey() && code->stub_info() == MinorKey(); |
| 555 } | 560 } |
| 556 | 561 |
| 557 protected: | 562 protected: |
| 558 class KindBits: public BitField<Code::Kind, 0, 4> {}; | 563 class KindBits: public BitField<Code::Kind, 0, 4> {}; |
| 559 virtual void FinishCode(Handle<Code> code) { | 564 virtual void FinishCode(Handle<Code> code) { |
| 560 code->set_stub_info(MinorKey()); | 565 code->set_stub_info(MinorKey()); |
| 561 } | 566 } |
| (...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1425 | 1430 |
| 1426 // The current function entry hook. | 1431 // The current function entry hook. |
| 1427 static FunctionEntryHook entry_hook_; | 1432 static FunctionEntryHook entry_hook_; |
| 1428 | 1433 |
| 1429 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); | 1434 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); |
| 1430 }; | 1435 }; |
| 1431 | 1436 |
| 1432 } } // namespace v8::internal | 1437 } } // namespace v8::internal |
| 1433 | 1438 |
| 1434 #endif // V8_CODE_STUBS_H_ | 1439 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |