OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 2420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2431 // -- rdx : receiver | 2431 // -- rdx : receiver |
2432 // -- rsp[0] : return address | 2432 // -- rsp[0] : return address |
2433 // ----------------------------------- | 2433 // ----------------------------------- |
2434 Label miss; | 2434 Label miss; |
2435 | 2435 |
2436 // Check that the map of the global has not changed. | 2436 // Check that the map of the global has not changed. |
2437 __ Cmp(FieldOperand(rdx, HeapObject::kMapOffset), | 2437 __ Cmp(FieldOperand(rdx, HeapObject::kMapOffset), |
2438 Handle<Map>(object->map())); | 2438 Handle<Map>(object->map())); |
2439 __ j(not_equal, &miss); | 2439 __ j(not_equal, &miss); |
2440 | 2440 |
| 2441 // Check that the value in the cell is not the hole. If it is, this |
| 2442 // cell could have been deleted and reintroducing the global needs |
| 2443 // to update the property details in the property dictionary of the |
| 2444 // global object. We bail out to the runtime system to do that. |
| 2445 __ Move(rbx, Handle<JSGlobalPropertyCell>(cell)); |
| 2446 __ CompareRoot(FieldOperand(rbx, JSGlobalPropertyCell::kValueOffset), |
| 2447 Heap::kTheHoleValueRootIndex); |
| 2448 __ j(equal, &miss); |
| 2449 |
2441 // Store the value in the cell. | 2450 // Store the value in the cell. |
2442 __ Move(rcx, Handle<JSGlobalPropertyCell>(cell)); | 2451 __ movq(FieldOperand(rbx, JSGlobalPropertyCell::kValueOffset), rax); |
2443 __ movq(FieldOperand(rcx, JSGlobalPropertyCell::kValueOffset), rax); | |
2444 | 2452 |
2445 // Return the value (register rax). | 2453 // Return the value (register rax). |
2446 __ IncrementCounter(&Counters::named_store_global_inline, 1); | 2454 __ IncrementCounter(&Counters::named_store_global_inline, 1); |
2447 __ ret(0); | 2455 __ ret(0); |
2448 | 2456 |
2449 // Handle store cache miss. | 2457 // Handle store cache miss. |
2450 __ bind(&miss); | 2458 __ bind(&miss); |
2451 __ IncrementCounter(&Counters::named_store_global_inline_miss, 1); | 2459 __ IncrementCounter(&Counters::named_store_global_inline_miss, 1); |
2452 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); | 2460 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); |
2453 __ Jump(ic, RelocInfo::CODE_TARGET); | 2461 __ Jump(ic, RelocInfo::CODE_TARGET); |
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3419 __ TailCallRuntime(Runtime::kSetProperty, 3, 1); | 3427 __ TailCallRuntime(Runtime::kSetProperty, 3, 1); |
3420 | 3428 |
3421 return GetCode(flags); | 3429 return GetCode(flags); |
3422 } | 3430 } |
3423 | 3431 |
3424 #undef __ | 3432 #undef __ |
3425 | 3433 |
3426 } } // namespace v8::internal | 3434 } } // namespace v8::internal |
3427 | 3435 |
3428 #endif // V8_TARGET_ARCH_X64 | 3436 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |