OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1179 Handle<String> name, | 1179 Handle<String> name, |
1180 Label* miss) { | 1180 Label* miss) { |
1181 ASSERT(holder->IsGlobalObject()); | 1181 ASSERT(holder->IsGlobalObject()); |
1182 | 1182 |
1183 // Get the number of arguments. | 1183 // Get the number of arguments. |
1184 const int argc = arguments().immediate(); | 1184 const int argc = arguments().immediate(); |
1185 | 1185 |
1186 // Get the receiver from the stack. | 1186 // Get the receiver from the stack. |
1187 __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize)); | 1187 __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize)); |
1188 | 1188 |
1189 // If the object is the holder then we know that it's a global | |
1190 // object which can only happen for contextual calls. In this case, | |
1191 // the receiver cannot be a smi. | |
1192 if (!object.is_identical_to(holder)) { | |
1193 __ JumpIfSmi(rdx, miss); | |
1194 } | |
1195 | 1189 |
1196 // Check that the maps haven't changed. | 1190 // Check that the maps haven't changed. |
| 1191 __ JumpIfSmi(rdx, miss); |
1197 CheckPrototypes(object, rdx, holder, rbx, rax, rdi, name, miss); | 1192 CheckPrototypes(object, rdx, holder, rbx, rax, rdi, name, miss); |
1198 } | 1193 } |
1199 | 1194 |
1200 | 1195 |
1201 void CallStubCompiler::GenerateLoadFunctionFromCell( | 1196 void CallStubCompiler::GenerateLoadFunctionFromCell( |
1202 Handle<JSGlobalPropertyCell> cell, | 1197 Handle<JSGlobalPropertyCell> cell, |
1203 Handle<JSFunction> function, | 1198 Handle<JSFunction> function, |
1204 Label* miss) { | 1199 Label* miss) { |
1205 // Get the value from the cell. | 1200 // Get the value from the cell. |
1206 __ Move(rdi, cell); | 1201 __ Move(rdi, cell); |
(...skipping 1391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2598 Handle<JSGlobalPropertyCell> cell, | 2593 Handle<JSGlobalPropertyCell> cell, |
2599 Handle<String> name, | 2594 Handle<String> name, |
2600 bool is_dont_delete) { | 2595 bool is_dont_delete) { |
2601 // ----------- S t a t e ------------- | 2596 // ----------- S t a t e ------------- |
2602 // -- rax : receiver | 2597 // -- rax : receiver |
2603 // -- rcx : name | 2598 // -- rcx : name |
2604 // -- rsp[0] : return address | 2599 // -- rsp[0] : return address |
2605 // ----------------------------------- | 2600 // ----------------------------------- |
2606 Label miss; | 2601 Label miss; |
2607 | 2602 |
2608 // If the object is the holder then we know that it's a global | |
2609 // object which can only happen for contextual loads. In this case, | |
2610 // the receiver cannot be a smi. | |
2611 if (!object.is_identical_to(holder)) { | |
2612 __ JumpIfSmi(rax, &miss); | |
2613 } | |
2614 | |
2615 // Check that the maps haven't changed. | 2603 // Check that the maps haven't changed. |
| 2604 __ JumpIfSmi(rax, &miss); |
2616 CheckPrototypes(object, rax, holder, rbx, rdx, rdi, name, &miss); | 2605 CheckPrototypes(object, rax, holder, rbx, rdx, rdi, name, &miss); |
2617 | 2606 |
2618 // Get the value from the cell. | 2607 // Get the value from the cell. |
2619 __ Move(rbx, cell); | 2608 __ Move(rbx, cell); |
2620 __ movq(rbx, FieldOperand(rbx, JSGlobalPropertyCell::kValueOffset)); | 2609 __ movq(rbx, FieldOperand(rbx, JSGlobalPropertyCell::kValueOffset)); |
2621 | 2610 |
2622 // Check for deleted property if property can actually be deleted. | 2611 // Check for deleted property if property can actually be deleted. |
2623 if (!is_dont_delete) { | 2612 if (!is_dont_delete) { |
2624 __ CompareRoot(rbx, Heap::kTheHoleValueRootIndex); | 2613 __ CompareRoot(rbx, Heap::kTheHoleValueRootIndex); |
2625 __ j(equal, &miss); | 2614 __ j(equal, &miss); |
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3586 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); | 3575 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); |
3587 __ jmp(ic_miss, RelocInfo::CODE_TARGET); | 3576 __ jmp(ic_miss, RelocInfo::CODE_TARGET); |
3588 } | 3577 } |
3589 | 3578 |
3590 | 3579 |
3591 #undef __ | 3580 #undef __ |
3592 | 3581 |
3593 } } // namespace v8::internal | 3582 } } // namespace v8::internal |
3594 | 3583 |
3595 #endif // V8_TARGET_ARCH_X64 | 3584 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |