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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 | 404 |
405 // Perform global security token check if needed. | 405 // Perform global security token check if needed. |
406 if (object->IsJSGlobalObject()) { | 406 if (object->IsJSGlobalObject()) { |
407 __ CheckAccessGlobal(r3, r1, &miss); | 407 __ CheckAccessGlobal(r3, r1, &miss); |
408 } | 408 } |
409 | 409 |
410 // Stub never generated for non-global objects that require access | 410 // Stub never generated for non-global objects that require access |
411 // checks. | 411 // checks. |
412 ASSERT(object->IsJSGlobalObject() || !object->IsAccessCheckNeeded()); | 412 ASSERT(object->IsJSGlobalObject() || !object->IsAccessCheckNeeded()); |
413 | 413 |
414 // Get the properties array | 414 // Perform map transition for the receiver if necessary. |
415 __ ldr(r1, FieldMemOperand(r3, JSObject::kPropertiesOffset)); | 415 if ((transition != NULL) && (object->map()->unused_property_fields() == 0)) { |
| 416 // The properties must be extended before we can store the value. |
| 417 // We jump to a runtime call that extends the propeties array. |
| 418 __ mov(r2, Operand(Handle<Map>(transition))); |
| 419 // Please note, if we implement keyed store for arm we need |
| 420 // to call the Builtins::KeyedStoreIC_ExtendStorage. |
| 421 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_ExtendStorage)); |
| 422 __ Jump(ic, RelocInfo::CODE_TARGET); |
| 423 } else { |
| 424 // Get the properties array |
| 425 __ ldr(r1, FieldMemOperand(r3, JSObject::kPropertiesOffset)); |
416 | 426 |
417 // Perform map transition for the receiver if necessary. | 427 if (transition != NULL) { |
418 if (transition != NULL) { | |
419 if (object->map()->unused_property_fields() == 0) { | |
420 // The properties must be extended before we can store the value. | |
421 // We jump to a runtime call that extends the propeties array. | |
422 __ mov(r2, Operand(Handle<Map>(transition))); | |
423 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_ExtendStorage)); | |
424 __ Jump(ic, RelocInfo::CODE_TARGET); | |
425 } else { | |
426 // Update the map of the object; no write barrier updating is | 428 // Update the map of the object; no write barrier updating is |
427 // needed because the map is never in new space. | 429 // needed because the map is never in new space. |
428 __ mov(ip, Operand(Handle<Map>(transition))); | 430 __ mov(ip, Operand(Handle<Map>(transition))); |
429 __ str(ip, FieldMemOperand(r3, HeapObject::kMapOffset)); | 431 __ str(ip, FieldMemOperand(r3, HeapObject::kMapOffset)); |
430 } | 432 } |
| 433 |
| 434 // Write to the properties array. |
| 435 int offset = index * kPointerSize + Array::kHeaderSize; |
| 436 __ str(r0, FieldMemOperand(r1, offset)); |
| 437 |
| 438 // Skip updating write barrier if storing a smi. |
| 439 __ tst(r0, Operand(kSmiTagMask)); |
| 440 __ b(eq, &exit); |
| 441 |
| 442 // Update the write barrier for the array address. |
| 443 __ mov(r3, Operand(offset)); |
| 444 __ RecordWrite(r1, r3, r2); // OK to clobber r2, since we return |
| 445 |
| 446 // Return the value (register r0). |
| 447 __ bind(&exit); |
| 448 __ Ret(); |
431 } | 449 } |
432 | |
433 // Write to the properties array. | |
434 int offset = index * kPointerSize + Array::kHeaderSize; | |
435 __ str(r0, FieldMemOperand(r1, offset)); | |
436 | |
437 // Skip updating write barrier if storing a smi. | |
438 __ tst(r0, Operand(kSmiTagMask)); | |
439 __ b(eq, &exit); | |
440 | |
441 // Update the write barrier for the array address. | |
442 __ mov(r3, Operand(offset)); | |
443 __ RecordWrite(r1, r3, r2); // OK to clobber r2, since we return | |
444 | |
445 // Return the value (register r0). | |
446 __ bind(&exit); | |
447 __ Ret(); | |
448 | |
449 // Handle store cache miss. | 450 // Handle store cache miss. |
450 __ bind(&miss); | 451 __ bind(&miss); |
451 __ mov(r2, Operand(Handle<String>(name))); // restore name | 452 __ mov(r2, Operand(Handle<String>(name))); // restore name |
452 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); | 453 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); |
453 __ Jump(ic, RelocInfo::CODE_TARGET); | 454 __ Jump(ic, RelocInfo::CODE_TARGET); |
454 | 455 |
455 // Return the generated code. | 456 // Return the generated code. |
456 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION); | 457 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION); |
457 } | 458 } |
458 | 459 |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 String* name) { | 798 String* name) { |
798 UNIMPLEMENTED(); | 799 UNIMPLEMENTED(); |
799 return Heap::undefined_value(); | 800 return Heap::undefined_value(); |
800 } | 801 } |
801 | 802 |
802 | 803 |
803 | 804 |
804 #undef __ | 805 #undef __ |
805 | 806 |
806 } } // namespace v8::internal | 807 } } // namespace v8::internal |
OLD | NEW |