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 __ LoadRoot(kScratchRegister, Heap::kTheHoleValueRootIndex); | |
2447 __ cmpq(kScratchRegister, | |
Kevin Millikin (Chromium)
2011/01/27 05:27:54
I think theres a compare root function on x64 (and
| |
2448 FieldOperand(rbx, JSGlobalPropertyCell::kValueOffset)); | |
2449 __ j(equal, &miss); | |
2450 | |
2441 // Store the value in the cell. | 2451 // Store the value in the cell. |
2442 __ Move(rcx, Handle<JSGlobalPropertyCell>(cell)); | 2452 __ movq(FieldOperand(rbx, JSGlobalPropertyCell::kValueOffset), rax); |
2443 __ movq(FieldOperand(rcx, JSGlobalPropertyCell::kValueOffset), rax); | |
2444 | 2453 |
2445 // Return the value (register rax). | 2454 // Return the value (register rax). |
2446 __ IncrementCounter(&Counters::named_store_global_inline, 1); | 2455 __ IncrementCounter(&Counters::named_store_global_inline, 1); |
2447 __ ret(0); | 2456 __ ret(0); |
2448 | 2457 |
2449 // Handle store cache miss. | 2458 // Handle store cache miss. |
2450 __ bind(&miss); | 2459 __ bind(&miss); |
2451 __ IncrementCounter(&Counters::named_store_global_inline_miss, 1); | 2460 __ IncrementCounter(&Counters::named_store_global_inline_miss, 1); |
2452 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); | 2461 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); |
2453 __ Jump(ic, RelocInfo::CODE_TARGET); | 2462 __ Jump(ic, RelocInfo::CODE_TARGET); |
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3419 __ TailCallRuntime(Runtime::kSetProperty, 3, 1); | 3428 __ TailCallRuntime(Runtime::kSetProperty, 3, 1); |
3420 | 3429 |
3421 return GetCode(flags); | 3430 return GetCode(flags); |
3422 } | 3431 } |
3423 | 3432 |
3424 #undef __ | 3433 #undef __ |
3425 | 3434 |
3426 } } // namespace v8::internal | 3435 } } // namespace v8::internal |
3427 | 3436 |
3428 #endif // V8_TARGET_ARCH_X64 | 3437 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |