Commit fbcc4a40 authored by erik.corry@gmail.com's avatar erik.corry@gmail.com

Add the VFP-ness to the minor number of the keyed store elements

IC so that the version from the snapshot is not used if we have
a more capable CPU at runtime.
Review URL: https://chromiumcodereview.appspot.com/10984065

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12624 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent dc57f545
...@@ -7262,6 +7262,7 @@ static const AheadOfTimeWriteBarrierStubList kAheadOfTime[] = { ...@@ -7262,6 +7262,7 @@ static const AheadOfTimeWriteBarrierStubList kAheadOfTime[] = {
#undef REG #undef REG
bool RecordWriteStub::IsPregenerated() { bool RecordWriteStub::IsPregenerated() {
for (const AheadOfTimeWriteBarrierStubList* entry = kAheadOfTime; for (const AheadOfTimeWriteBarrierStubList* entry = kAheadOfTime;
!entry->object.is(no_reg); !entry->object.is(no_reg);
...@@ -7303,6 +7304,11 @@ void RecordWriteStub::GenerateFixedRegStubsAheadOfTime() { ...@@ -7303,6 +7304,11 @@ void RecordWriteStub::GenerateFixedRegStubsAheadOfTime() {
} }
bool CodeStub::CanUseFPRegisters() {
return CpuFeatures::IsSupported(VFP2);
}
// Takes the input in 3 registers: address_ value_ and object_. A pointer to // Takes the input in 3 registers: address_ value_ and object_. A pointer to
// the value has just been written into the object, now this stub makes sure // the value has just been written into the object, now this stub makes sure
// we keep the GC informed. The word in the object where the value has been // we keep the GC informed. The word in the object where the value has been
......
...@@ -162,6 +162,9 @@ class CodeStub BASE_EMBEDDED { ...@@ -162,6 +162,9 @@ class CodeStub BASE_EMBEDDED {
// Lookup the code in the (possibly custom) cache. // Lookup the code in the (possibly custom) cache.
bool FindCodeInCache(Code** code_out); bool FindCodeInCache(Code** code_out);
protected:
static bool CanUseFPRegisters();
private: private:
// Nonvirtual wrapper around the stub-specific Generate function. Call // Nonvirtual wrapper around the stub-specific Generate function. Call
// this function to set up the macro assembler and generate the code. // this function to set up the macro assembler and generate the code.
...@@ -998,13 +1001,15 @@ class KeyedStoreElementStub : public CodeStub { ...@@ -998,13 +1001,15 @@ class KeyedStoreElementStub : public CodeStub {
KeyedAccessGrowMode grow_mode) KeyedAccessGrowMode grow_mode)
: is_js_array_(is_js_array), : is_js_array_(is_js_array),
elements_kind_(elements_kind), elements_kind_(elements_kind),
grow_mode_(grow_mode) { } grow_mode_(grow_mode),
fp_registers_(CanUseFPRegisters()) { }
Major MajorKey() { return KeyedStoreElement; } Major MajorKey() { return KeyedStoreElement; }
int MinorKey() { int MinorKey() {
return ElementsKindBits::encode(elements_kind_) | return ElementsKindBits::encode(elements_kind_) |
IsJSArrayBits::encode(is_js_array_) | IsJSArrayBits::encode(is_js_array_) |
GrowModeBits::encode(grow_mode_); GrowModeBits::encode(grow_mode_) |
FPRegisters::encode(fp_registers_);
} }
void Generate(MacroAssembler* masm); void Generate(MacroAssembler* masm);
...@@ -1013,10 +1018,12 @@ class KeyedStoreElementStub : public CodeStub { ...@@ -1013,10 +1018,12 @@ class KeyedStoreElementStub : public CodeStub {
class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; class ElementsKindBits: public BitField<ElementsKind, 0, 8> {};
class GrowModeBits: public BitField<KeyedAccessGrowMode, 8, 1> {}; class GrowModeBits: public BitField<KeyedAccessGrowMode, 8, 1> {};
class IsJSArrayBits: public BitField<bool, 9, 1> {}; class IsJSArrayBits: public BitField<bool, 9, 1> {};
class FPRegisters: public BitField<bool, 10, 1> {};
bool is_js_array_; bool is_js_array_;
ElementsKind elements_kind_; ElementsKind elements_kind_;
KeyedAccessGrowMode grow_mode_; KeyedAccessGrowMode grow_mode_;
bool fp_registers_;
DISALLOW_COPY_AND_ASSIGN(KeyedStoreElementStub); DISALLOW_COPY_AND_ASSIGN(KeyedStoreElementStub);
}; };
...@@ -1132,14 +1139,19 @@ class ElementsTransitionAndStoreStub : public CodeStub { ...@@ -1132,14 +1139,19 @@ class ElementsTransitionAndStoreStub : public CodeStub {
class StoreArrayLiteralElementStub : public CodeStub { class StoreArrayLiteralElementStub : public CodeStub {
public: public:
explicit StoreArrayLiteralElementStub() {} StoreArrayLiteralElementStub()
: fp_registers_(CanUseFPRegisters()) { }
private: private:
class FPRegisters: public BitField<bool, 0, 1> {};
Major MajorKey() { return StoreArrayLiteralElement; } Major MajorKey() { return StoreArrayLiteralElement; }
int MinorKey() { return 0; } int MinorKey() { return FPRegisters::encode(fp_registers_); }
void Generate(MacroAssembler* masm); void Generate(MacroAssembler* masm);
bool fp_registers_;
DISALLOW_COPY_AND_ASSIGN(StoreArrayLiteralElementStub); DISALLOW_COPY_AND_ASSIGN(StoreArrayLiteralElementStub);
}; };
......
...@@ -7206,6 +7206,11 @@ void RecordWriteStub::GenerateFixedRegStubsAheadOfTime() { ...@@ -7206,6 +7206,11 @@ void RecordWriteStub::GenerateFixedRegStubsAheadOfTime() {
} }
bool CodeStub::CanUseFPRegisters() {
return CpuFeatures::IsSupported(SSE2);
}
// Takes the input in 3 registers: address_ value_ and object_. A pointer to // Takes the input in 3 registers: address_ value_ and object_. A pointer to
// the value has just been written into the object, now this stub makes sure // the value has just been written into the object, now this stub makes sure
// we keep the GC informed. The word in the object where the value has been // we keep the GC informed. The word in the object where the value has been
......
...@@ -650,7 +650,7 @@ class KeyedStoreIC: public KeyedIC { ...@@ -650,7 +650,7 @@ class KeyedStoreIC: public KeyedIC {
} }
MUST_USE_RESULT MaybeObject* Store(State state, MUST_USE_RESULT MaybeObject* Store(State state,
StrictModeFlag strict_mode, StrictModeFlag strict_mode,
Handle<Object> object, Handle<Object> object,
Handle<Object> name, Handle<Object> name,
Handle<Object> value, Handle<Object> value,
......
...@@ -7512,6 +7512,11 @@ void RecordWriteStub::GenerateFixedRegStubsAheadOfTime() { ...@@ -7512,6 +7512,11 @@ void RecordWriteStub::GenerateFixedRegStubsAheadOfTime() {
} }
bool CodeStub::CanUseFPRegisters() {
return CpuFeatures::IsSupported(FPU);
}
// Takes the input in 3 registers: address_ value_ and object_. A pointer to // Takes the input in 3 registers: address_ value_ and object_. A pointer to
// the value has just been written into the object, now this stub makes sure // the value has just been written into the object, now this stub makes sure
// we keep the GC informed. The word in the object where the value has been // we keep the GC informed. The word in the object where the value has been
......
...@@ -6144,6 +6144,11 @@ void RecordWriteStub::GenerateFixedRegStubsAheadOfTime() { ...@@ -6144,6 +6144,11 @@ void RecordWriteStub::GenerateFixedRegStubsAheadOfTime() {
} }
bool CodeStub::CanUseFPRegisters() {
return true; // Always have SSE2 on x64.
}
// Takes the input in 3 registers: address_ value_ and object_. A pointer to // Takes the input in 3 registers: address_ value_ and object_. A pointer to
// the value has just been written into the object, now this stub makes sure // the value has just been written into the object, now this stub makes sure
// we keep the GC informed. The word in the object where the value has been // we keep the GC informed. The word in the object where the value has been
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment