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