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

Side by Side Diff: src/objects-inl.h

Issue 18089024: Handlify JSObject::SetPrototype method. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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
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 4267 matching lines...) Expand 10 before | Expand all | Expand 10 after
4278 if (!transitions()->HasPrototypeTransitions()) { 4278 if (!transitions()->HasPrototypeTransitions()) {
4279 return GetHeap()->empty_fixed_array(); 4279 return GetHeap()->empty_fixed_array();
4280 } 4280 }
4281 return transitions()->GetPrototypeTransitions(); 4281 return transitions()->GetPrototypeTransitions();
4282 } 4282 }
4283 4283
4284 4284
4285 MaybeObject* Map::SetPrototypeTransitions(FixedArray* proto_transitions) { 4285 MaybeObject* Map::SetPrototypeTransitions(FixedArray* proto_transitions) {
4286 MaybeObject* allow_prototype = EnsureHasTransitionArray(this); 4286 MaybeObject* allow_prototype = EnsureHasTransitionArray(this);
4287 if (allow_prototype->IsFailure()) return allow_prototype; 4287 if (allow_prototype->IsFailure()) return allow_prototype;
4288 int old_number_of_transitions = NumberOfProtoTransitions();
4288 #ifdef DEBUG 4289 #ifdef DEBUG
4289 if (HasPrototypeTransitions()) { 4290 if (HasPrototypeTransitions()) {
4290 ASSERT(GetPrototypeTransitions() != proto_transitions); 4291 ASSERT(GetPrototypeTransitions() != proto_transitions);
4291 ZapPrototypeTransitions(); 4292 ZapPrototypeTransitions();
4292 } 4293 }
4293 #endif 4294 #endif
4294 transitions()->SetPrototypeTransitions(proto_transitions); 4295 transitions()->SetPrototypeTransitions(proto_transitions);
4296 SetNumberOfProtoTransitions(old_number_of_transitions);
4295 return this; 4297 return this;
4296 } 4298 }
4297 4299
4298 4300
4299 bool Map::HasPrototypeTransitions() { 4301 bool Map::HasPrototypeTransitions() {
4300 return HasTransitionArray() && transitions()->HasPrototypeTransitions(); 4302 return HasTransitionArray() && transitions()->HasPrototypeTransitions();
4301 } 4303 }
4302 4304
4303 4305
4304 TransitionArray* Map::transitions() { 4306 TransitionArray* Map::transitions() {
(...skipping 1873 matching lines...) Expand 10 before | Expand all | Expand 10 after
6178 #undef WRITE_UINT32_FIELD 6180 #undef WRITE_UINT32_FIELD
6179 #undef READ_SHORT_FIELD 6181 #undef READ_SHORT_FIELD
6180 #undef WRITE_SHORT_FIELD 6182 #undef WRITE_SHORT_FIELD
6181 #undef READ_BYTE_FIELD 6183 #undef READ_BYTE_FIELD
6182 #undef WRITE_BYTE_FIELD 6184 #undef WRITE_BYTE_FIELD
6183 6185
6184 6186
6185 } } // namespace v8::internal 6187 } } // namespace v8::internal
6186 6188
6187 #endif // V8_OBJECTS_INL_H_ 6189 #endif // V8_OBJECTS_INL_H_
OLDNEW
« src/objects.cc ('K') | « src/objects.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698