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

Side by Side Diff: src/objects.cc

Issue 10440045: Enable map transitions for accessor properties. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/flag-definitions.h ('k') | src/regexp.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 4438 matching lines...) Expand 10 before | Expand all | Expand 10 after
4449 4449
4450 4450
4451 MaybeObject* JSObject::DefinePropertyAccessor(String* name, 4451 MaybeObject* JSObject::DefinePropertyAccessor(String* name,
4452 Object* getter, 4452 Object* getter,
4453 Object* setter, 4453 Object* setter,
4454 PropertyAttributes attributes) { 4454 PropertyAttributes attributes) {
4455 // We could assert that the property is configurable here, but we would need 4455 // We could assert that the property is configurable here, but we would need
4456 // to do a lookup, which seems to be a bit of overkill. 4456 // to do a lookup, which seems to be a bit of overkill.
4457 Heap* heap = GetHeap(); 4457 Heap* heap = GetHeap();
4458 bool only_attribute_changes = getter->IsNull() && setter->IsNull(); 4458 bool only_attribute_changes = getter->IsNull() && setter->IsNull();
4459 if (FLAG_fast_accessor_properties && 4459 if (HasFastProperties() && !only_attribute_changes) {
4460 HasFastProperties() && !only_attribute_changes) {
4461 MaybeObject* getterOk = heap->undefined_value(); 4460 MaybeObject* getterOk = heap->undefined_value();
4462 if (!getter->IsNull()) { 4461 if (!getter->IsNull()) {
4463 getterOk = DefineFastAccessor(name, ACCESSOR_GETTER, getter, attributes); 4462 getterOk = DefineFastAccessor(name, ACCESSOR_GETTER, getter, attributes);
4464 if (getterOk->IsFailure()) return getterOk; 4463 if (getterOk->IsFailure()) return getterOk;
4465 } 4464 }
4466 4465
4467 MaybeObject* setterOk = heap->undefined_value(); 4466 MaybeObject* setterOk = heap->undefined_value();
4468 if (getterOk != heap->null_value() && !setter->IsNull()) { 4467 if (getterOk != heap->null_value() && !setter->IsNull()) {
4469 setterOk = DefineFastAccessor(name, ACCESSOR_SETTER, setter, attributes); 4468 setterOk = DefineFastAccessor(name, ACCESSOR_SETTER, setter, attributes);
4470 if (setterOk->IsFailure()) return setterOk; 4469 if (setterOk->IsFailure()) return setterOk;
(...skipping 8725 matching lines...) Expand 10 before | Expand all | Expand 10 after
13196 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 13195 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
13197 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 13196 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
13198 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 13197 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
13199 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 13198 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
13200 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 13199 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
13201 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 13200 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
13202 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 13201 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
13203 } 13202 }
13204 13203
13205 } } // namespace v8::internal 13204 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | src/regexp.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698