| 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 2426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2437 // -- rdx : receiver | 2437 // -- rdx : receiver |
| 2438 // -- rsp[0] : return address | 2438 // -- rsp[0] : return address |
| 2439 // ----------------------------------- | 2439 // ----------------------------------- |
| 2440 Label miss; | 2440 Label miss; |
| 2441 | 2441 |
| 2442 // Check that the map of the global has not changed. | 2442 // Check that the map of the global has not changed. |
| 2443 __ Cmp(FieldOperand(rdx, HeapObject::kMapOffset), | 2443 __ Cmp(FieldOperand(rdx, HeapObject::kMapOffset), |
| 2444 Handle<Map>(object->map())); | 2444 Handle<Map>(object->map())); |
| 2445 __ j(not_equal, &miss); | 2445 __ j(not_equal, &miss); |
| 2446 | 2446 |
| 2447 // Check that the value in the cell is not the hole. If it is, this |
| 2448 // cell could have been deleted and reintroducing the global needs |
| 2449 // to update the property details in the property dictionary of the |
| 2450 // global object. We bail out to the runtime system to do that. |
| 2451 __ Move(rbx, Handle<JSGlobalPropertyCell>(cell)); |
| 2452 __ CompareRoot(FieldOperand(rbx, JSGlobalPropertyCell::kValueOffset), |
| 2453 Heap::kTheHoleValueRootIndex); |
| 2454 __ j(equal, &miss); |
| 2455 |
| 2447 // Store the value in the cell. | 2456 // Store the value in the cell. |
| 2448 __ Move(rcx, Handle<JSGlobalPropertyCell>(cell)); | 2457 __ movq(FieldOperand(rbx, JSGlobalPropertyCell::kValueOffset), rax); |
| 2449 __ movq(FieldOperand(rcx, JSGlobalPropertyCell::kValueOffset), rax); | |
| 2450 | 2458 |
| 2451 // Return the value (register rax). | 2459 // Return the value (register rax). |
| 2452 __ IncrementCounter(COUNTERS->named_store_global_inline(), 1); | 2460 __ IncrementCounter(COUNTERS->named_store_global_inline(), 1); |
| 2453 __ ret(0); | 2461 __ ret(0); |
| 2454 | 2462 |
| 2455 // Handle store cache miss. | 2463 // Handle store cache miss. |
| 2456 __ bind(&miss); | 2464 __ bind(&miss); |
| 2457 __ IncrementCounter(COUNTERS->named_store_global_inline_miss(), 1); | 2465 __ IncrementCounter(COUNTERS->named_store_global_inline_miss(), 1); |
| 2458 Handle<Code> ic(Isolate::Current()->builtins()->builtin( | 2466 Handle<Code> ic(Isolate::Current()->builtins()->builtin( |
| 2459 Builtins::StoreIC_Miss)); | 2467 Builtins::StoreIC_Miss)); |
| (...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3429 __ TailCallRuntime(Runtime::kSetProperty, 3, 1); | 3437 __ TailCallRuntime(Runtime::kSetProperty, 3, 1); |
| 3430 | 3438 |
| 3431 return GetCode(flags); | 3439 return GetCode(flags); |
| 3432 } | 3440 } |
| 3433 | 3441 |
| 3434 #undef __ | 3442 #undef __ |
| 3435 | 3443 |
| 3436 } } // namespace v8::internal | 3444 } } // namespace v8::internal |
| 3437 | 3445 |
| 3438 #endif // V8_TARGET_ARCH_X64 | 3446 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |