Chromium Code Reviews| Index: src/code-stubs.h |
| diff --git a/src/code-stubs.h b/src/code-stubs.h |
| index 6b6ba79b44680eb3a2e5e1636053743845ff44a5..37700c747a01b6e643bfc4f70013e4d776ead920 100644 |
| --- a/src/code-stubs.h |
| +++ b/src/code-stubs.h |
| @@ -90,6 +90,7 @@ namespace internal { |
| V(ArrayConstructor) \ |
| V(InternalArrayConstructor) \ |
| V(ProfileEntryHook) \ |
| + V(StoreGlobal) \ |
| /* IC Handler stubs */ \ |
| V(LoadField) \ |
| V(KeyedLoadField) |
| @@ -140,6 +141,8 @@ class CodeStub BASE_EMBEDDED { |
| // Retrieve the code for the stub. Generate the code if needed. |
| Handle<Code> GetCode(Isolate* isolate); |
| + // Retrieve the code for the stub, make and return a copy of the code. |
| + Handle<Code> GetCodeCopyFromTemplate(Isolate* isolate); |
| static Major MajorKeyFromKey(uint32_t key) { |
| return static_cast<Major>(MajorKeyBits::decode(key)); |
| } |
| @@ -519,6 +522,53 @@ class FastNewBlockContextStub : public PlatformCodeStub { |
| int MinorKey() { return slots_; } |
| }; |
| +class StoreGlobalStub : public HydrogenCodeStub { |
| + public: |
| + explicit StoreGlobalStub(StrictModeFlag strict_mode, |
|
rossberg
2013/06/25 10:47:38
The 'explicit' is unnecessary here.
Also, paramet
danno
2013/06/28 13:56:05
Done.
|
| + bool is_constant) { |
| + bit_field_ = StrictModeBits::encode(strict_mode) | |
| + IsConstantBits::encode(is_constant); |
| + } |
| + |
| + virtual Handle<Code> GenerateCode(); |
| + |
| + virtual void InitializeInterfaceDescriptor( |
| + Isolate* isolate, |
| + CodeStubInterfaceDescriptor* descriptor); |
| + |
| + virtual Code::Kind GetCodeKind() const { return Code::STORE_IC; } |
| + virtual InlineCacheState GetICState() { return MONOMORPHIC; } |
| + virtual Code::ExtraICState GetExtraICState() { |
| + return bit_field_; |
|
rossberg
2013/06/25 10:47:38
Nit: I believe this fits on the prev line
danno
2013/06/28 13:56:05
Done.
|
| + } |
| + |
| + bool is_constant() { |
| + return IsConstantBits::decode(bit_field_); |
| + } |
| + void set_is_constant(bool value) { |
| + bit_field_ = IsConstantBits::update(bit_field_, value); |
| + } |
| + |
| + Representation representation() { |
| + return Representation::FromKind(RepresentationBits::decode(bit_field_)); |
| + } |
| + void set_representation(Representation r) { |
| + bit_field_ = RepresentationBits::update(bit_field_, r.kind()); |
| + } |
| + |
| + private: |
| + virtual int NotMissMinorKey() { return GetExtraICState(); } |
| + Major MajorKey() { return StoreGlobal; } |
| + |
| + class StrictModeBits: public BitField<StrictModeFlag, 0, 1> {}; |
| + class IsConstantBits: public BitField<bool, 1, 1> {}; |
| + class RepresentationBits: public BitField<Representation::Kind, 2, 8> {}; |
| + |
| + int bit_field_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(StoreGlobalStub); |
| +}; |
| + |
| class FastCloneShallowArrayStub : public HydrogenCodeStub { |
| public: |