OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 | 429 |
430 // Stub never generated for non-global objects that require access | 430 // Stub never generated for non-global objects that require access |
431 // checks. | 431 // checks. |
432 ASSERT(object->IsJSGlobalObject() || !object->IsAccessCheckNeeded()); | 432 ASSERT(object->IsJSGlobalObject() || !object->IsAccessCheckNeeded()); |
433 | 433 |
434 // Get the properties array (optimistically). | 434 // Get the properties array (optimistically). |
435 __ mov(scratch, FieldOperand(receiver_reg, JSObject::kPropertiesOffset)); | 435 __ mov(scratch, FieldOperand(receiver_reg, JSObject::kPropertiesOffset)); |
436 | 436 |
437 // Perform map transition for the receiver if necessary. | 437 // Perform map transition for the receiver if necessary. |
438 if (transition != NULL) { | 438 if (transition != NULL) { |
439 // Update the map of the object; no write barrier updating is | 439 if (object->map()->unused_property_fields() == 0) { |
440 // needed because the map is never in new space. | 440 // The properties must be extended before we can store the value. |
441 __ mov(FieldOperand(receiver_reg, HeapObject::kMapOffset), | 441 // We jump to a runtime call that extends the propeties array. |
442 Immediate(Handle<Map>(transition))); | 442 __ mov(Operand(ecx), Immediate(Handle<Map>(transition))); |
| 443 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_ExtendStorage)); |
| 444 __ jmp(ic, RelocInfo::CODE_TARGET); |
| 445 } else { |
| 446 // Update the map of the object; no write barrier updating is |
| 447 // needed because the map is never in new space. |
| 448 __ mov(FieldOperand(receiver_reg, HeapObject::kMapOffset), |
| 449 Immediate(Handle<Map>(transition))); |
| 450 } |
443 } | 451 } |
444 | 452 |
445 // Write to the properties array. | 453 // Write to the properties array. |
446 int offset = index * kPointerSize + Array::kHeaderSize; | 454 int offset = index * kPointerSize + Array::kHeaderSize; |
447 __ mov(FieldOperand(scratch, offset), eax); | 455 __ mov(FieldOperand(scratch, offset), eax); |
448 | 456 |
449 // Update the write barrier for the array address. | 457 // Update the write barrier for the array address. |
450 // Pass the value being stored in the now unused name_reg. | 458 // Pass the value being stored in the now unused name_reg. |
451 __ mov(name_reg, Operand(eax)); | 459 __ mov(name_reg, Operand(eax)); |
452 __ RecordWrite(scratch, offset, name_reg, receiver_reg); | 460 __ RecordWrite(scratch, offset, name_reg, receiver_reg); |
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1233 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 1241 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
1234 | 1242 |
1235 // Return the generated code. | 1243 // Return the generated code. |
1236 return GetCode(CALLBACKS); | 1244 return GetCode(CALLBACKS); |
1237 } | 1245 } |
1238 | 1246 |
1239 | 1247 |
1240 #undef __ | 1248 #undef __ |
1241 | 1249 |
1242 } } // namespace v8::internal | 1250 } } // namespace v8::internal |
OLD | NEW |