Index: src/code-stubs.h |
diff --git a/src/code-stubs.h b/src/code-stubs.h |
index 78ff554fdb6d187b14ca4c3b5829b5ad2242f3d6..1fd36a7e15629c99ccfa3e9e6953733ba74d2fa3 100644 |
--- a/src/code-stubs.h |
+++ b/src/code-stubs.h |
@@ -1,4 +1,4 @@ |
-// Copyright 2011 the V8 project authors. All rights reserved. |
+// Copyright 2012 the V8 project authors. All rights reserved. |
// Redistribution and use in source and binary forms, with or without |
// modification, are permitted provided that the following conditions are |
// met: |
@@ -985,20 +985,29 @@ class KeyedLoadElementStub : public CodeStub { |
class KeyedStoreElementStub : public CodeStub { |
public: |
KeyedStoreElementStub(bool is_js_array, |
- ElementsKind elements_kind) |
- : is_js_array_(is_js_array), |
- elements_kind_(elements_kind) { } |
+ ElementsKind elements_kind, |
+ KeyedAccessGrowMode grow_mode) |
+ : is_js_array_(is_js_array), |
+ elements_kind_(elements_kind), |
+ grow_mode_(grow_mode) { } |
Major MajorKey() { return KeyedStoreElement; } |
int MinorKey() { |
- return (is_js_array_ ? 0 : kElementsKindCount) + elements_kind_; |
+ return ElementsKindBits::encode(elements_kind_) | |
+ IsJSArrayBits::encode(is_js_array_) | |
+ GrowModeBits::encode(grow_mode_); |
} |
void Generate(MacroAssembler* masm); |
private: |
+ class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; |
+ class GrowModeBits: public BitField<KeyedAccessGrowMode, 8, 1> {}; |
+ class IsJSArrayBits: public BitField<bool, 9, 1> {}; |
+ |
bool is_js_array_; |
ElementsKind elements_kind_; |
+ KeyedAccessGrowMode grow_mode_; |
DISALLOW_COPY_AND_ASSIGN(KeyedStoreElementStub); |
}; |
@@ -1076,24 +1085,28 @@ class ElementsTransitionAndStoreStub : public CodeStub { |
ElementsTransitionAndStoreStub(ElementsKind from, |
ElementsKind to, |
bool is_jsarray, |
- StrictModeFlag strict_mode) |
+ StrictModeFlag strict_mode, |
+ KeyedAccessGrowMode grow_mode) |
: from_(from), |
to_(to), |
is_jsarray_(is_jsarray), |
- strict_mode_(strict_mode) {} |
+ strict_mode_(strict_mode), |
+ grow_mode_(grow_mode) {} |
private: |
- class FromBits: public BitField<ElementsKind, 0, 8> {}; |
- class ToBits: public BitField<ElementsKind, 8, 8> {}; |
- class IsJSArrayBits: public BitField<bool, 16, 8> {}; |
- class StrictModeBits: public BitField<StrictModeFlag, 24, 8> {}; |
+ class FromBits: public BitField<ElementsKind, 0, 8> {}; |
+ class ToBits: public BitField<ElementsKind, 8, 8> {}; |
+ class IsJSArrayBits: public BitField<bool, 16, 1> {}; |
+ class StrictModeBits: public BitField<StrictModeFlag, 17, 1> {}; |
+ class GrowModeBits: public BitField<KeyedAccessGrowMode, 18, 1> {}; |
Major MajorKey() { return ElementsTransitionAndStore; } |
int MinorKey() { |
return FromBits::encode(from_) | |
ToBits::encode(to_) | |
IsJSArrayBits::encode(is_jsarray_) | |
- StrictModeBits::encode(strict_mode_); |
+ StrictModeBits::encode(strict_mode_) | |
+ GrowModeBits::encode(grow_mode_); |
} |
void Generate(MacroAssembler* masm); |
@@ -1102,6 +1115,7 @@ class ElementsTransitionAndStoreStub : public CodeStub { |
ElementsKind to_; |
bool is_jsarray_; |
StrictModeFlag strict_mode_; |
+ KeyedAccessGrowMode grow_mode_; |
DISALLOW_COPY_AND_ASSIGN(ElementsTransitionAndStoreStub); |
}; |