OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 4544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4555 return Top::context()->global(); | 4555 return Top::context()->global(); |
4556 } | 4556 } |
4557 | 4557 |
4558 | 4558 |
4559 // A mechanism to return a pair of Object pointers in registers (if possible). | 4559 // A mechanism to return a pair of Object pointers in registers (if possible). |
4560 // How this is achieved is calling convention-dependent. | 4560 // How this is achieved is calling convention-dependent. |
4561 // All currently supported x86 compiles uses calling conventions that are cdecl | 4561 // All currently supported x86 compiles uses calling conventions that are cdecl |
4562 // variants where a 64-bit value is returned in two 32-bit registers | 4562 // variants where a 64-bit value is returned in two 32-bit registers |
4563 // (edx:eax on ia32, r1:r0 on ARM). | 4563 // (edx:eax on ia32, r1:r0 on ARM). |
4564 // In AMD-64 calling convention a struct of two pointers is returned in rdx:rax. | 4564 // In AMD-64 calling convention a struct of two pointers is returned in rdx:rax. |
4565 // In Win64 calling convention, a struct of two pointers is returned in space pa
ssed | 4565 // In Win64 calling convention, a struct of two pointers is returned in memory, |
4566 // as a hidden first parameter. | 4566 // allocated by the caller, and passed as a pointer in a hidden first parameter. |
4567 #ifdef V8_HOST_ARCH_64_BIT | 4567 #ifdef V8_HOST_ARCH_64_BIT |
4568 struct ObjectPair { | 4568 struct ObjectPair { |
4569 Object* x; | 4569 Object* x; |
4570 Object* y; | 4570 Object* y; |
4571 }; | 4571 }; |
4572 | 4572 |
4573 static inline ObjectPair MakePair(Object* x, Object* y) { | 4573 static inline ObjectPair MakePair(Object* x, Object* y) { |
4574 ObjectPair result = {x, y}; | 4574 ObjectPair result = {x, y}; |
4575 // Pointers x and y returned in rax and rdx, in AMD-x64-abi. | 4575 // Pointers x and y returned in rax and rdx, in AMD-x64-abi. |
4576 // In Win64 they are assigned to a hidden first argument. | 4576 // In Win64 they are assigned to a hidden first argument. |
(...skipping 3116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7693 } else { | 7693 } else { |
7694 // Handle last resort GC and make sure to allow future allocations | 7694 // Handle last resort GC and make sure to allow future allocations |
7695 // to grow the heap without causing GCs (if possible). | 7695 // to grow the heap without causing GCs (if possible). |
7696 Counters::gc_last_resort_from_js.Increment(); | 7696 Counters::gc_last_resort_from_js.Increment(); |
7697 Heap::CollectAllGarbage(false); | 7697 Heap::CollectAllGarbage(false); |
7698 } | 7698 } |
7699 } | 7699 } |
7700 | 7700 |
7701 | 7701 |
7702 } } // namespace v8::internal | 7702 } } // namespace v8::internal |
OLD | NEW |