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

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

Issue 35413006: Correct handling of arrays with callbacks in the prototype chain. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: A few test updates and simpler prototype updating. Created 7 years, 1 month 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 4269 matching lines...) Expand 10 before | Expand all | Expand 10 after
4280 WRITE_FIELD(this, kBitField3Offset, Smi::FromInt(value >> 1)); 4280 WRITE_FIELD(this, kBitField3Offset, Smi::FromInt(value >> 1));
4281 } 4281 }
4282 4282
4283 4283
4284 uint32_t Map::bit_field3() { 4284 uint32_t Map::bit_field3() {
4285 Object* value = READ_FIELD(this, kBitField3Offset); 4285 Object* value = READ_FIELD(this, kBitField3Offset);
4286 return Smi::cast(value)->value(); 4286 return Smi::cast(value)->value();
4287 } 4287 }
4288 4288
4289 4289
4290 void Map::set_bit_field4(uint32_t bits) {
4291 // Ensure the upper 2 bits have the same value by sign extending it. This is
4292 // necessary to be able to use the 31st bit.
4293 int value = bits << 1;
4294 WRITE_FIELD(this, kBitField4Offset, Smi::FromInt(value >> 1));
4295 }
4296
4297
4298 uint32_t Map::bit_field4() {
4299 Object* value = READ_FIELD(this, kBitField4Offset);
4300 return Smi::cast(value)->value();
4301 }
4302
4303
4304 void Map::set_has_element_callbacks(bool value) {
4305 set_bit_field4(HasElementCallbacks::update(bit_field4(), value));
4306 }
4307
4308
4309 bool Map::has_element_callbacks() {
4310 return HasElementCallbacks::decode(bit_field4());
4311 }
4312
4313
4290 void Map::ClearTransitions(Heap* heap, WriteBarrierMode mode) { 4314 void Map::ClearTransitions(Heap* heap, WriteBarrierMode mode) {
4291 Object* back_pointer = GetBackPointer(); 4315 Object* back_pointer = GetBackPointer();
4292 4316
4293 if (Heap::ShouldZapGarbage() && HasTransitionArray()) { 4317 if (Heap::ShouldZapGarbage() && HasTransitionArray()) {
4294 ZapTransitions(); 4318 ZapTransitions();
4295 } 4319 }
4296 4320
4297 WRITE_FIELD(this, kTransitionsOrBackPointerOffset, back_pointer); 4321 WRITE_FIELD(this, kTransitionsOrBackPointerOffset, back_pointer);
4298 CONDITIONAL_WRITE_BARRIER( 4322 CONDITIONAL_WRITE_BARRIER(
4299 heap, this, kTransitionsOrBackPointerOffset, back_pointer, mode); 4323 heap, this, kTransitionsOrBackPointerOffset, back_pointer, mode);
(...skipping 2093 matching lines...) Expand 10 before | Expand all | Expand 10 after
6393 #undef WRITE_UINT32_FIELD 6417 #undef WRITE_UINT32_FIELD
6394 #undef READ_SHORT_FIELD 6418 #undef READ_SHORT_FIELD
6395 #undef WRITE_SHORT_FIELD 6419 #undef WRITE_SHORT_FIELD
6396 #undef READ_BYTE_FIELD 6420 #undef READ_BYTE_FIELD
6397 #undef WRITE_BYTE_FIELD 6421 #undef WRITE_BYTE_FIELD
6398 6422
6399 6423
6400 } } // namespace v8::internal 6424 } } // namespace v8::internal
6401 6425
6402 #endif // V8_OBJECTS_INL_H_ 6426 #endif // V8_OBJECTS_INL_H_
OLDNEW
« src/objects.cc ('K') | « src/objects.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698