Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: src/objects-inl.h

Issue 24205004: Rollback trunk to 3.21.16.2 (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects-debug.cc ('k') | src/optimizing-compiler-thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 56fde30433158490204a50da96438175c046862b..89abe5043358c14642512f8d677104151b72a2d5 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -1566,6 +1566,21 @@ 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);
@@ -5714,23 +5729,19 @@ Object* JSReceiver::GetConstructor() {
}
-bool JSReceiver::HasProperty(Handle<JSReceiver> object,
- Handle<Name> name) {
- if (object->IsJSProxy()) {
- Handle<JSProxy> proxy = Handle<JSProxy>::cast(object);
- return JSProxy::HasPropertyWithHandler(proxy, name);
+bool JSReceiver::HasProperty(Name* name) {
+ if (IsJSProxy()) {
+ return JSProxy::cast(this)->HasPropertyWithHandler(name);
}
- return object->GetPropertyAttribute(*name) != ABSENT;
+ return GetPropertyAttribute(name) != ABSENT;
}
-bool JSReceiver::HasLocalProperty(Handle<JSReceiver> object,
- Handle<Name> name) {
- if (object->IsJSProxy()) {
- Handle<JSProxy> proxy = Handle<JSProxy>::cast(object);
- return JSProxy::HasPropertyWithHandler(proxy, name);
+bool JSReceiver::HasLocalProperty(Name* name) {
+ if (IsJSProxy()) {
+ return JSProxy::cast(this)->HasPropertyWithHandler(name);
}
- return object->GetLocalPropertyAttribute(*name) != ABSENT;
+ return GetLocalPropertyAttribute(name) != ABSENT;
}
@@ -5772,23 +5783,21 @@ MaybeObject* JSReceiver::GetIdentityHash(CreationFlag flag) {
}
-bool JSReceiver::HasElement(Handle<JSReceiver> object, uint32_t index) {
- if (object->IsJSProxy()) {
- Handle<JSProxy> proxy = Handle<JSProxy>::cast(object);
- return JSProxy::HasElementWithHandler(proxy, index);
+bool JSReceiver::HasElement(uint32_t index) {
+ if (IsJSProxy()) {
+ return JSProxy::cast(this)->HasElementWithHandler(index);
}
- return Handle<JSObject>::cast(object)->GetElementAttributeWithReceiver(
- *object, index, true) != ABSENT;
+ return JSObject::cast(this)->GetElementAttributeWithReceiver(
+ this, index, true) != ABSENT;
}
-bool JSReceiver::HasLocalElement(Handle<JSReceiver> object, uint32_t index) {
- if (object->IsJSProxy()) {
- Handle<JSProxy> proxy = Handle<JSProxy>::cast(object);
- return JSProxy::HasElementWithHandler(proxy, index);
+bool JSReceiver::HasLocalElement(uint32_t index) {
+ if (IsJSProxy()) {
+ return JSProxy::cast(this)->HasElementWithHandler(index);
}
- return Handle<JSObject>::cast(object)->GetElementAttributeWithReceiver(
- *object, index, false) != ABSENT;
+ return JSObject::cast(this)->GetElementAttributeWithReceiver(
+ this, index, false) != ABSENT;
}
« no previous file with comments | « src/objects-debug.cc ('k') | src/optimizing-compiler-thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698