OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 Object* probe = global->EnsurePropertyCell(name); | 388 Object* probe = global->EnsurePropertyCell(name); |
389 if (probe->IsFailure()) { | 389 if (probe->IsFailure()) { |
390 set_failure(Failure::cast(probe)); | 390 set_failure(Failure::cast(probe)); |
391 return result; | 391 return result; |
392 } | 392 } |
393 JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast(probe); | 393 JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast(probe); |
394 ASSERT(cell->value()->IsTheHole()); | 394 ASSERT(cell->value()->IsTheHole()); |
395 __ mov(scratch, Operand(Handle<Object>(cell))); | 395 __ mov(scratch, Operand(Handle<Object>(cell))); |
396 __ ldr(scratch, | 396 __ ldr(scratch, |
397 FieldMemOperand(scratch, JSGlobalPropertyCell::kValueOffset)); | 397 FieldMemOperand(scratch, JSGlobalPropertyCell::kValueOffset)); |
398 __ cmp(scratch, Operand(Factory::the_hole_value())); | 398 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
| 399 __ cmp(scratch, ip); |
399 __ b(ne, miss); | 400 __ b(ne, miss); |
400 } | 401 } |
401 object = JSObject::cast(object->GetPrototype()); | 402 object = JSObject::cast(object->GetPrototype()); |
402 } | 403 } |
403 | 404 |
404 // Return the register containin the holder. | 405 // Return the register containin the holder. |
405 return result; | 406 return result; |
406 } | 407 } |
407 | 408 |
408 | 409 |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 Context::NUMBER_FUNCTION_INDEX, | 661 Context::NUMBER_FUNCTION_INDEX, |
661 r2); | 662 r2); |
662 CheckPrototypes(JSObject::cast(object->GetPrototype()), r2, holder, r3, | 663 CheckPrototypes(JSObject::cast(object->GetPrototype()), r2, holder, r3, |
663 r1, name, &miss); | 664 r1, name, &miss); |
664 break; | 665 break; |
665 } | 666 } |
666 | 667 |
667 case BOOLEAN_CHECK: { | 668 case BOOLEAN_CHECK: { |
668 Label fast; | 669 Label fast; |
669 // Check that the object is a boolean. | 670 // Check that the object is a boolean. |
670 __ cmp(r1, Operand(Factory::true_value())); | 671 __ LoadRoot(ip, Heap::kTrueValueRootIndex); |
| 672 __ cmp(r1, ip); |
671 __ b(eq, &fast); | 673 __ b(eq, &fast); |
672 __ cmp(r1, Operand(Factory::false_value())); | 674 __ LoadRoot(ip, Heap::kFalseValueRootIndex); |
| 675 __ cmp(r1, ip); |
673 __ b(ne, &miss); | 676 __ b(ne, &miss); |
674 __ bind(&fast); | 677 __ bind(&fast); |
675 // Check that the maps starting from the prototype haven't changed. | 678 // Check that the maps starting from the prototype haven't changed. |
676 GenerateLoadGlobalFunctionPrototype(masm(), | 679 GenerateLoadGlobalFunctionPrototype(masm(), |
677 Context::BOOLEAN_FUNCTION_INDEX, | 680 Context::BOOLEAN_FUNCTION_INDEX, |
678 r2); | 681 r2); |
679 CheckPrototypes(JSObject::cast(object->GetPrototype()), r2, holder, r3, | 682 CheckPrototypes(JSObject::cast(object->GetPrototype()), r2, holder, r3, |
680 r1, name, &miss); | 683 r1, name, &miss); |
681 break; | 684 break; |
682 } | 685 } |
683 | 686 |
684 case JSARRAY_HAS_FAST_ELEMENTS_CHECK: | 687 case JSARRAY_HAS_FAST_ELEMENTS_CHECK: |
685 CheckPrototypes(JSObject::cast(object), r1, holder, r3, r2, name, &miss); | 688 CheckPrototypes(JSObject::cast(object), r1, holder, r3, r2, name, &miss); |
686 // Make sure object->HasFastElements(). | 689 // Make sure object->HasFastElements(). |
687 // Get the elements array of the object. | 690 // Get the elements array of the object. |
688 __ ldr(r3, FieldMemOperand(r1, JSObject::kElementsOffset)); | 691 __ ldr(r3, FieldMemOperand(r1, JSObject::kElementsOffset)); |
689 // Check that the object is in fast mode (not dictionary). | 692 // Check that the object is in fast mode (not dictionary). |
690 __ ldr(r2, FieldMemOperand(r3, HeapObject::kMapOffset)); | 693 __ ldr(r2, FieldMemOperand(r3, HeapObject::kMapOffset)); |
691 __ cmp(r2, Operand(Factory::fixed_array_map())); | 694 __ LoadRoot(ip, Heap::kFixedArrayMapRootIndex); |
| 695 __ cmp(r2, ip); |
692 __ b(ne, &miss); | 696 __ b(ne, &miss); |
693 break; | 697 break; |
694 | 698 |
695 default: | 699 default: |
696 UNREACHABLE(); | 700 UNREACHABLE(); |
697 } | 701 } |
698 | 702 |
699 // Get the function and setup the context. | 703 // Get the function and setup the context. |
700 __ mov(r1, Operand(Handle<JSFunction>(function))); | 704 __ mov(r1, Operand(Handle<JSFunction>(function))); |
701 __ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset)); | 705 __ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset)); |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1101 | 1105 |
1102 // Check that the map of the global has not changed. | 1106 // Check that the map of the global has not changed. |
1103 CheckPrototypes(object, r1, holder, r3, r0, name, &miss); | 1107 CheckPrototypes(object, r1, holder, r3, r0, name, &miss); |
1104 | 1108 |
1105 // Get the value from the cell. | 1109 // Get the value from the cell. |
1106 __ mov(r3, Operand(Handle<JSGlobalPropertyCell>(cell))); | 1110 __ mov(r3, Operand(Handle<JSGlobalPropertyCell>(cell))); |
1107 __ ldr(r0, FieldMemOperand(r3, JSGlobalPropertyCell::kValueOffset)); | 1111 __ ldr(r0, FieldMemOperand(r3, JSGlobalPropertyCell::kValueOffset)); |
1108 | 1112 |
1109 // Check for deleted property if property can actually be deleted. | 1113 // Check for deleted property if property can actually be deleted. |
1110 if (!is_dont_delete) { | 1114 if (!is_dont_delete) { |
1111 __ cmp(r0, Operand(Factory::the_hole_value())); | 1115 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
| 1116 __ cmp(r0, ip); |
1112 __ b(eq, &miss); | 1117 __ b(eq, &miss); |
1113 } | 1118 } |
1114 | 1119 |
1115 __ IncrementCounter(&Counters::named_load_global_inline, 1, r1, r3); | 1120 __ IncrementCounter(&Counters::named_load_global_inline, 1, r1, r3); |
1116 __ Ret(); | 1121 __ Ret(); |
1117 | 1122 |
1118 __ bind(&miss); | 1123 __ bind(&miss); |
1119 __ IncrementCounter(&Counters::named_load_global_inline_miss, 1, r1, r3); | 1124 __ IncrementCounter(&Counters::named_load_global_inline_miss, 1, r1, r3); |
1120 GenerateLoadMiss(masm(), Code::LOAD_IC); | 1125 GenerateLoadMiss(masm(), Code::LOAD_IC); |
1121 | 1126 |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1333 __ Jump(ic, RelocInfo::CODE_TARGET); | 1338 __ Jump(ic, RelocInfo::CODE_TARGET); |
1334 | 1339 |
1335 // Return the generated code. | 1340 // Return the generated code. |
1336 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name); | 1341 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name); |
1337 } | 1342 } |
1338 | 1343 |
1339 | 1344 |
1340 #undef __ | 1345 #undef __ |
1341 | 1346 |
1342 } } // namespace v8::internal | 1347 } } // namespace v8::internal |
OLD | NEW |