Index: src/code-stubs.h |
=================================================================== |
--- src/code-stubs.h (revision 9957) |
+++ src/code-stubs.h (working copy) |
@@ -116,7 +116,7 @@ |
}; |
// Retrieve the code for the stub. Generate the code if needed. |
- Handle<Code> GetCode(); |
+ Handle<Code> GetCode(bool use_special_cache = false); |
static Major MajorKeyFromKey(uint32_t key) { |
return static_cast<Major>(MajorKeyBits::decode(key)); |
@@ -193,6 +193,14 @@ |
return UNINITIALIZED; |
} |
+ // Add the code to a specialized cache, specific to an individual |
+ // stub type. Please note, this method must add the code object to a |
+ // roots object, otherwise we will remove the code during GC. |
+ virtual bool AddToSpecialCache(Handle<Code> new_object) { return false; } |
+ |
+ // Find code in a specialized cache, work is delegated to the specific stub. |
+ virtual bool FindCodeInSpecialCache(Code** code_out) { return false; } |
+ |
// Returns a name for logging/debugging purposes. |
SmartArrayPointer<const char> GetName(); |
virtual void PrintName(StringStream* stream); |
@@ -436,7 +444,10 @@ |
} |
virtual void Generate(MacroAssembler* masm); |
+ static void GenerateKnownObjects(MacroAssembler* masm, Map* map); |
Kevin Millikin (Chromium)
2011/11/10 19:08:42
Put this down in the private section with the othe
Rico
2011/11/11 08:49:11
Done.
|
+ void set_known_map(Map* map) { known_map_ = map; } |
Kevin Millikin (Chromium)
2011/11/10 19:08:42
Make map a Handle<Map>. There's a risk that a GC
Rico
2011/11/11 08:49:11
OK, will do, but maps don't move right, and we alr
|
+ |
private: |
class OpField: public BitField<int, 0, 3> { }; |
class StateField: public BitField<int, 3, 5> { }; |
@@ -457,9 +468,12 @@ |
bool strict() const { return op_ == Token::EQ_STRICT; } |
Condition GetCondition() const { return CompareIC::ComputeCondition(op_); } |
+ bool AddToSpecialCache(Handle<Code> new_object); |
+ bool FindCodeInSpecialCache(Code** code_out); |
Token::Value op_; |
CompareIC::State state_; |
+ Map* known_map_; |
Kevin Millikin (Chromium)
2011/11/10 19:08:42
Handle<Map>.
Rico
2011/11/11 08:49:11
Done.
|
}; |