Chromium Code Reviews| 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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 394 // Perform map transition for the receiver if necessary. | 394 // Perform map transition for the receiver if necessary. |
| 395 if ((transition != NULL) && (object->map()->unused_property_fields() == 0)) { | 395 if ((transition != NULL) && (object->map()->unused_property_fields() == 0)) { |
| 396 // The properties must be extended before we can store the value. | 396 // The properties must be extended before we can store the value. |
| 397 // We jump to a runtime call that extends the propeties array. | 397 // We jump to a runtime call that extends the propeties array. |
| 398 __ mov(ecx, Immediate(Handle<Map>(transition))); | 398 __ mov(ecx, Immediate(Handle<Map>(transition))); |
| 399 Handle<Code> ic(Builtins::builtin(storage_extend)); | 399 Handle<Code> ic(Builtins::builtin(storage_extend)); |
| 400 __ jmp(ic, RelocInfo::CODE_TARGET); | 400 __ jmp(ic, RelocInfo::CODE_TARGET); |
| 401 return; | 401 return; |
| 402 } | 402 } |
| 403 | 403 |
| 404 // Adjust for the number of properties stored in the object. Even in the | |
| 405 // face of a transition we can use the old map here because the size of the | |
| 406 // object and the number of in-object properties is not going to change. | |
| 407 index -= object->map()->inobject_properties(); | |
| 408 | |
| 409 if (index >= 0) { | |
| 410 // Get the properties array (optimistically). | |
| 411 __ mov(scratch, FieldOperand(receiver_reg, JSObject::kPropertiesOffset)); | |
| 412 } | |
| 413 | |
| 414 if (transition != NULL) { | 404 if (transition != NULL) { |
| 415 // Update the map of the object; no write barrier updating is | 405 // Update the map of the object; no write barrier updating is |
| 416 // needed because the map is never in new space. | 406 // needed because the map is never in new space. |
| 417 __ mov(FieldOperand(receiver_reg, HeapObject::kMapOffset), | 407 __ mov(FieldOperand(receiver_reg, HeapObject::kMapOffset), |
| 418 Immediate(Handle<Map>(transition))); | 408 Immediate(Handle<Map>(transition))); |
| 419 } | 409 } |
| 420 | 410 |
| 411 // Adjust for the number of properties stored in the object. Even in the | |
| 412 // face of a transition we can use the old map here because the size of the | |
| 413 // object and the number of in-object properties is not going to change. | |
| 414 index -= object->map()->inobject_properties(); | |
| 415 | |
| 421 if (index < 0) { | 416 if (index < 0) { |
| 422 // Set the property straight into the object. | 417 // Set the property straight into the object. |
| 423 int offset = object->map()->instance_size() + (index * kPointerSize); | 418 int offset = object->map()->instance_size() + (index * kPointerSize); |
| 424 __ mov(FieldOperand(receiver_reg, offset), eax); | 419 __ mov(FieldOperand(receiver_reg, offset), eax); |
| 425 | 420 |
| 426 // Update the write barrier for the array address. | 421 // Update the write barrier for the array address. |
| 427 // Pass the value being stored in the now unused name_reg. | 422 // Pass the value being stored in the now unused name_reg. |
| 428 __ mov(name_reg, Operand(eax)); | 423 __ mov(name_reg, Operand(eax)); |
| 429 __ RecordWrite(receiver_reg, offset, name_reg, scratch); | 424 __ RecordWrite(receiver_reg, offset, name_reg, scratch); |
| 430 } else { | 425 } else { |
| 431 // Write to the properties array. | 426 // Write to the properties array. |
| 432 int offset = index * kPointerSize + Array::kHeaderSize; | 427 int offset = index * kPointerSize + Array::kHeaderSize; |
| 428 // Get the properties array (optimistically). | |
| 429 __ mov(scratch, FieldOperand(receiver_reg, JSObject::kPropertiesOffset)); | |
|
iposva
2008/11/20 01:10:57
Moving the load of the properties pointer down her
Feng Qian
2008/11/20 16:30:47
Running V8 bench suite (Richards, DeltaBlue, Crypt
| |
| 433 __ mov(FieldOperand(scratch, offset), eax); | 430 __ mov(FieldOperand(scratch, offset), eax); |
| 434 | 431 |
| 435 // Update the write barrier for the array address. | 432 // Update the write barrier for the array address. |
| 436 // Pass the value being stored in the now unused name_reg. | 433 // Pass the value being stored in the now unused name_reg. |
| 437 __ mov(name_reg, Operand(eax)); | 434 __ mov(name_reg, Operand(eax)); |
| 438 __ RecordWrite(scratch, offset, name_reg, receiver_reg); | 435 __ RecordWrite(scratch, offset, name_reg, receiver_reg); |
| 439 } | 436 } |
| 440 | 437 |
| 441 // Return the value (register eax). | 438 // Return the value (register eax). |
| 442 __ ret(0); | 439 __ ret(0); |
| (...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1202 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 1199 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
| 1203 | 1200 |
| 1204 // Return the generated code. | 1201 // Return the generated code. |
| 1205 return GetCode(CALLBACKS); | 1202 return GetCode(CALLBACKS); |
| 1206 } | 1203 } |
| 1207 | 1204 |
| 1208 | 1205 |
| 1209 #undef __ | 1206 #undef __ |
| 1210 | 1207 |
| 1211 } } // namespace v8::internal | 1208 } } // namespace v8::internal |
| OLD | NEW |