private object GetPropertySlow(int index, ref DictionaryCacheSlot cacheSlot) { if (_store != null) return _value.GetPropertySlow(index, ref cacheSlot); #if TRACE_SPECULATION if (_store == null) Trace.WriteLine("Dictionary cache miss"); #endif return _value.GetProperty(index); }
private object GetPropertySlow(JintRuntime runtime, int index, ref DictionaryCacheSlot cacheSlot) { if (_store != null) { return ((JsObject)_value).GetPropertySlow(index, ref cacheSlot); } #if TRACE_SPECULATION Trace.WriteLine("Dictionary cache miss"); #endif return runtime.GetMemberByIndex(_value, index); }
public object GetProperty(int index, ref DictionaryCacheSlot cacheSlot) { if (_store != null && cacheSlot.Schema == _store.Schema) { #if TRACE_SPECULATION // Trace.WriteLine("Dictionary cache hit"); #endif return _store.GetOwnPropertyRawUnchecked(cacheSlot.Index); } return GetPropertySlow(index, ref cacheSlot); }
public void SetProperty(int index, object value, ref DictionaryCacheSlot cacheSlot) { if (_store != null && cacheSlot.Schema == _store.Schema) { #if TRACE_SPECULATION // Trace.WriteLine("Dictionary cache hit"); #endif _store.SetPropertyValueUnchecked(cacheSlot.Index, value); } else { SetPropertySlow(index, value, ref cacheSlot); } }
private void SetPropertySlow(int index, object value, ref DictionaryCacheSlot cacheSlot) { if (_store != null) { _value.SetPropertySlow(index, value, ref cacheSlot); } else { #if TRACE_SPECULATION if (_store == null) Trace.WriteLine("Dictionary cache miss"); #endif _value.SetProperty(index, value); } }
private void SetPropertySlow(int index, object value, ref DictionaryCacheSlot cacheSlot) { if (_store != null) { if (cacheSlot.Schema == _store.Schema) { #if TRACE_SPECULATION // Trace.WriteLine("Dictionary cache hit"); #endif _store.SetPropertyValueUnchecked(cacheSlot.Index, value); } else { ((JsObject)_value).SetPropertySlow(index, value, ref cacheSlot); } } else { #if TRACE_SPECULATION Trace.WriteLine("Dictionary cache miss"); #endif JintRuntime.SetMemberByIndex(_value, index, value); } }
private object GetPropertyRaw(int index, ref DictionaryCacheSlot cacheSlot) { if (index == Id.prototype) { object value = GetOwnPropertyRaw(index); if (value != null) return value; if (IsPrototypeNull) return JsNull.Instance; return Prototype; } if (index == Id.__proto__) { if (IsPrototypeNull) return JsNull.Instance; return Prototype; } if (PropertyStore != null) { if (_dictionaryPropertyStore != null) { object result = _dictionaryPropertyStore.GetOwnPropertyRaw(index, ref cacheSlot); if (result != null) return result; } else { object result = PropertyStore.GetOwnPropertyRaw(index); if (result != null) return result; } } var @object = Prototype; while ([email protected]) { object result = @object.GetOwnPropertyRaw(index); if (result != null) return result; @object = @object.Prototype; } return null; }
internal void SetPropertySlow(int index, object value, ref DictionaryCacheSlot cacheSlot) { // CLR objects have their own rules concerning how and when a // property is set. if (IsClr && _dictionaryPropertyStore == null) { PropertyStore.SetPropertyValue(index, value); return; } // If we have this property, either set it through the accessor // or directly on the property store. object currentValue = null; if (PropertyStore != null) { if (_dictionaryPropertyStore != null) currentValue = _dictionaryPropertyStore.GetOwnPropertyRaw(index, ref cacheSlot); else currentValue = PropertyStore.GetOwnPropertyRaw(index); } if (currentValue != null) { var accessor = currentValue as PropertyAccessor; if (accessor != null) { // Cache slots are disabled for accessors. The thinking here // is that accessors are rare, and this prevents us from // having to do a get in the fast path. cacheSlot = new DictionaryCacheSlot(); accessor.SetValue(this, value); } else { PropertyStore.SetPropertyValue(index, value); } return; } // Check whether the prototype has an accessor. if (!IsPrototypeNull) { currentValue = Prototype.GetPropertyRaw(index); var accessor = currentValue as PropertyAccessor; if (accessor != null) { accessor.SetValue(this, value); return; } } // Otherwise, we're setting a new property. DefineProperty(index, value, PropertyAttributes.None); }
internal object GetPropertySlow(int index, ref DictionaryCacheSlot cacheSlot) { object value = GetPropertyRaw(index, ref cacheSlot); if (value == null) return ResolveUndefined(index); return ResolvePropertyValue(value); }
public void SetProperty(int index, object value, ref DictionaryCacheSlot cacheSlot) { if (cacheSlot.Schema != null && _dictionaryPropertyStore.Schema == cacheSlot.Schema) _dictionaryPropertyStore.SetPropertyValueUnchecked(cacheSlot.Index, value); else SetPropertySlow(index, value, ref cacheSlot); }
public object GetProperty(int index, ref DictionaryCacheSlot cacheSlot) { if (cacheSlot.Schema != null && _dictionaryPropertyStore.Schema == cacheSlot.Schema) return _dictionaryPropertyStore.GetOwnPropertyRawUnchecked(cacheSlot.Index); return GetPropertySlow(index, ref cacheSlot); }
public object GetOwnPropertyRaw(int index, ref DictionaryCacheSlot cacheSlot) { int offset = Schema.GetOffset(index); if (offset < 0) return null; cacheSlot = new DictionaryCacheSlot(Schema, offset); return _values[offset]; }