| Index: src/objects-inl.h
|
| diff --git a/src/objects-inl.h b/src/objects-inl.h
|
| index 89abe5043358c14642512f8d677104151b72a2d5..4ee437214b61ba630d6f87ac204fecda7e7ae01a 100644
|
| --- a/src/objects-inl.h
|
| +++ b/src/objects-inl.h
|
| @@ -1323,6 +1323,13 @@ bool JSObject::ShouldTrackAllocationInfo() {
|
| }
|
|
|
|
|
| +void AllocationSite::Initialize() {
|
| + SetElementsKind(GetInitialFastElementsKind());
|
| + set_dependent_code(DependentCode::cast(GetHeap()->empty_fixed_array()),
|
| + SKIP_WRITE_BARRIER);
|
| +}
|
| +
|
| +
|
| // Heuristic: We only need to create allocation site info if the boilerplate
|
| // elements kind is the initial elements kind.
|
| AllocationSiteMode AllocationSite::GetMode(
|
| @@ -1566,21 +1573,6 @@ MaybeObject* JSObject::AllocateStorageForMap(Map* map) {
|
| }
|
|
|
|
|
| -MaybeObject* JSObject::MigrateInstance() {
|
| - // Converting any field to the most specific type will cause the
|
| - // GeneralizeFieldRepresentation algorithm to create the most general existing
|
| - // transition that matches the object. This achieves what is needed.
|
| - Map* original_map = map();
|
| - MaybeObject* maybe_result = GeneralizeFieldRepresentation(
|
| - 0, Representation::None(), ALLOW_AS_CONSTANT);
|
| - JSObject* result;
|
| - if (FLAG_trace_migration && maybe_result->To(&result)) {
|
| - PrintInstanceMigration(stdout, original_map, result->map());
|
| - }
|
| - return maybe_result;
|
| -}
|
| -
|
| -
|
| MaybeObject* JSObject::TryMigrateInstance() {
|
| Map* new_map = map()->CurrentMapForDeprecated();
|
| if (new_map == NULL) return Smi::FromInt(0);
|
| @@ -4495,6 +4487,8 @@ ACCESSORS(SignatureInfo, args, Object, kArgsOffset)
|
| ACCESSORS(TypeSwitchInfo, types, Object, kTypesOffset)
|
|
|
| ACCESSORS(AllocationSite, transition_info, Object, kTransitionInfoOffset)
|
| +ACCESSORS(AllocationSite, dependent_code, DependentCode,
|
| + kDependentCodeOffset)
|
| ACCESSORS(AllocationSite, weak_next, Object, kWeakNextOffset)
|
| ACCESSORS(AllocationMemento, allocation_site, Object, kAllocationSiteOffset)
|
|
|
| @@ -5729,19 +5723,23 @@ Object* JSReceiver::GetConstructor() {
|
| }
|
|
|
|
|
| -bool JSReceiver::HasProperty(Name* name) {
|
| - if (IsJSProxy()) {
|
| - return JSProxy::cast(this)->HasPropertyWithHandler(name);
|
| +bool JSReceiver::HasProperty(Handle<JSReceiver> object,
|
| + Handle<Name> name) {
|
| + if (object->IsJSProxy()) {
|
| + Handle<JSProxy> proxy = Handle<JSProxy>::cast(object);
|
| + return JSProxy::HasPropertyWithHandler(proxy, name);
|
| }
|
| - return GetPropertyAttribute(name) != ABSENT;
|
| + return object->GetPropertyAttribute(*name) != ABSENT;
|
| }
|
|
|
|
|
| -bool JSReceiver::HasLocalProperty(Name* name) {
|
| - if (IsJSProxy()) {
|
| - return JSProxy::cast(this)->HasPropertyWithHandler(name);
|
| +bool JSReceiver::HasLocalProperty(Handle<JSReceiver> object,
|
| + Handle<Name> name) {
|
| + if (object->IsJSProxy()) {
|
| + Handle<JSProxy> proxy = Handle<JSProxy>::cast(object);
|
| + return JSProxy::HasPropertyWithHandler(proxy, name);
|
| }
|
| - return GetLocalPropertyAttribute(name) != ABSENT;
|
| + return object->GetLocalPropertyAttribute(*name) != ABSENT;
|
| }
|
|
|
|
|
| @@ -5783,21 +5781,23 @@ MaybeObject* JSReceiver::GetIdentityHash(CreationFlag flag) {
|
| }
|
|
|
|
|
| -bool JSReceiver::HasElement(uint32_t index) {
|
| - if (IsJSProxy()) {
|
| - return JSProxy::cast(this)->HasElementWithHandler(index);
|
| +bool JSReceiver::HasElement(Handle<JSReceiver> object, uint32_t index) {
|
| + if (object->IsJSProxy()) {
|
| + Handle<JSProxy> proxy = Handle<JSProxy>::cast(object);
|
| + return JSProxy::HasElementWithHandler(proxy, index);
|
| }
|
| - return JSObject::cast(this)->GetElementAttributeWithReceiver(
|
| - this, index, true) != ABSENT;
|
| + return Handle<JSObject>::cast(object)->GetElementAttributeWithReceiver(
|
| + *object, index, true) != ABSENT;
|
| }
|
|
|
|
|
| -bool JSReceiver::HasLocalElement(uint32_t index) {
|
| - if (IsJSProxy()) {
|
| - return JSProxy::cast(this)->HasElementWithHandler(index);
|
| +bool JSReceiver::HasLocalElement(Handle<JSReceiver> object, uint32_t index) {
|
| + if (object->IsJSProxy()) {
|
| + Handle<JSProxy> proxy = Handle<JSProxy>::cast(object);
|
| + return JSProxy::HasElementWithHandler(proxy, index);
|
| }
|
| - return JSObject::cast(this)->GetElementAttributeWithReceiver(
|
| - this, index, false) != ABSENT;
|
| + return Handle<JSObject>::cast(object)->GetElementAttributeWithReceiver(
|
| + *object, index, false) != ABSENT;
|
| }
|
|
|
|
|
|
|