| 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 1533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1544 | 1544 |
| 1545 | 1545 |
| 1546 Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object, | 1546 Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object, |
| 1547 GlobalObject* holder, | 1547 GlobalObject* holder, |
| 1548 JSGlobalPropertyCell* cell, | 1548 JSGlobalPropertyCell* cell, |
| 1549 String* name, | 1549 String* name, |
| 1550 bool is_dont_delete) { | 1550 bool is_dont_delete) { |
| 1551 // ----------- S t a t e ------------- | 1551 // ----------- S t a t e ------------- |
| 1552 // -- r2 : name | 1552 // -- r2 : name |
| 1553 // -- lr : return address | 1553 // -- lr : return address |
| 1554 // -- [sp] : receiver | 1554 // -- r0 : receiver |
| 1555 // -- sp[0] : receiver |
| 1555 // ----------------------------------- | 1556 // ----------------------------------- |
| 1556 Label miss; | 1557 Label miss; |
| 1557 | 1558 |
| 1558 // Get the receiver from the stack. | |
| 1559 __ ldr(r1, MemOperand(sp, 0 * kPointerSize)); | |
| 1560 | |
| 1561 // If the object is the holder then we know that it's a global | 1559 // If the object is the holder then we know that it's a global |
| 1562 // object which can only happen for contextual calls. In this case, | 1560 // object which can only happen for contextual calls. In this case, |
| 1563 // the receiver cannot be a smi. | 1561 // the receiver cannot be a smi. |
| 1564 if (object != holder) { | 1562 if (object != holder) { |
| 1565 __ tst(r1, Operand(kSmiTagMask)); | 1563 __ tst(r0, Operand(kSmiTagMask)); |
| 1566 __ b(eq, &miss); | 1564 __ b(eq, &miss); |
| 1567 } | 1565 } |
| 1568 | 1566 |
| 1569 // Check that the map of the global has not changed. | 1567 // Check that the map of the global has not changed. |
| 1570 CheckPrototypes(object, r1, holder, r3, r0, name, &miss); | 1568 CheckPrototypes(object, r0, holder, r3, r4, name, &miss); |
| 1571 | 1569 |
| 1572 // Get the value from the cell. | 1570 // Get the value from the cell. |
| 1573 __ mov(r3, Operand(Handle<JSGlobalPropertyCell>(cell))); | 1571 __ mov(r3, Operand(Handle<JSGlobalPropertyCell>(cell))); |
| 1574 __ ldr(r0, FieldMemOperand(r3, JSGlobalPropertyCell::kValueOffset)); | 1572 __ ldr(r4, FieldMemOperand(r3, JSGlobalPropertyCell::kValueOffset)); |
| 1575 | 1573 |
| 1576 // Check for deleted property if property can actually be deleted. | 1574 // Check for deleted property if property can actually be deleted. |
| 1577 if (!is_dont_delete) { | 1575 if (!is_dont_delete) { |
| 1578 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); | 1576 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
| 1579 __ cmp(r0, ip); | 1577 __ cmp(r4, ip); |
| 1580 __ b(eq, &miss); | 1578 __ b(eq, &miss); |
| 1581 } | 1579 } |
| 1582 | 1580 |
| 1581 __ mov(r0, r4); |
| 1583 __ IncrementCounter(&Counters::named_load_global_inline, 1, r1, r3); | 1582 __ IncrementCounter(&Counters::named_load_global_inline, 1, r1, r3); |
| 1584 __ Ret(); | 1583 __ Ret(); |
| 1585 | 1584 |
| 1586 __ bind(&miss); | 1585 __ bind(&miss); |
| 1587 __ IncrementCounter(&Counters::named_load_global_inline_miss, 1, r1, r3); | 1586 __ IncrementCounter(&Counters::named_load_global_inline_miss, 1, r1, r3); |
| 1588 GenerateLoadMiss(masm(), Code::LOAD_IC); | 1587 GenerateLoadMiss(masm(), Code::LOAD_IC); |
| 1589 | 1588 |
| 1590 // Return the generated code. | 1589 // Return the generated code. |
| 1591 return GetCode(NORMAL, name); | 1590 return GetCode(NORMAL, name); |
| 1592 } | 1591 } |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1947 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); | 1946 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); |
| 1948 | 1947 |
| 1949 // Return the generated code. | 1948 // Return the generated code. |
| 1950 return GetCode(); | 1949 return GetCode(); |
| 1951 } | 1950 } |
| 1952 | 1951 |
| 1953 | 1952 |
| 1954 #undef __ | 1953 #undef __ |
| 1955 | 1954 |
| 1956 } } // namespace v8::internal | 1955 } } // namespace v8::internal |
| OLD | NEW |