Index: src/x64/stub-cache-x64.cc |
diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc |
index 8353259b309108bec378c42b926e083e5162dbe2..29172576b3ad61e1718259fe628f8da98ad5a8c8 100644 |
--- a/src/x64/stub-cache-x64.cc |
+++ b/src/x64/stub-cache-x64.cc |
@@ -2438,9 +2438,18 @@ MaybeObject* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object, |
Handle<Map>(object->map())); |
__ j(not_equal, &miss); |
+ // Check that the value in the cell is not the hole. If it is, this |
+ // cell could have been deleted and reintroducing the global needs |
+ // to update the property details in the property dictionary of the |
+ // global object. We bail out to the runtime system to do that. |
+ __ Move(rbx, Handle<JSGlobalPropertyCell>(cell)); |
+ __ LoadRoot(kScratchRegister, Heap::kTheHoleValueRootIndex); |
+ __ cmpq(kScratchRegister, |
Kevin Millikin (Chromium)
2011/01/27 05:27:54
I think theres a compare root function on x64 (and
|
+ FieldOperand(rbx, JSGlobalPropertyCell::kValueOffset)); |
+ __ j(equal, &miss); |
+ |
// Store the value in the cell. |
- __ Move(rcx, Handle<JSGlobalPropertyCell>(cell)); |
- __ movq(FieldOperand(rcx, JSGlobalPropertyCell::kValueOffset), rax); |
+ __ movq(FieldOperand(rbx, JSGlobalPropertyCell::kValueOffset), rax); |
// Return the value (register rax). |
__ IncrementCounter(&Counters::named_store_global_inline, 1); |