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 4474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4485 } | 4485 } |
4486 | 4486 |
4487 | 4487 |
4488 // A mechanism to return pairs of Object*'s. This is somewhat | 4488 // A mechanism to return pairs of Object*'s. This is somewhat |
4489 // compiler-dependent as it assumes that a 64-bit value (a long long) | 4489 // compiler-dependent as it assumes that a 64-bit value (a long long) |
4490 // is returned via two registers (edx:eax on ia32). Both the ia32 and | 4490 // is returned via two registers (edx:eax on ia32). Both the ia32 and |
4491 // arm platform support this; it is mostly an issue of "coaxing" the | 4491 // arm platform support this; it is mostly an issue of "coaxing" the |
4492 // compiler to do the right thing. | 4492 // compiler to do the right thing. |
4493 // | 4493 // |
4494 // TODO(1236026): This is a non-portable hack that should be removed. | 4494 // TODO(1236026): This is a non-portable hack that should be removed. |
4495 // TODO(x64): Definitely! | 4495 #ifdef V8_HOST_ARCH_64_BIT |
| 4496 // Tested with GCC, not with MSVC. |
| 4497 struct ObjectPair { |
| 4498 Object* x; |
| 4499 Object* y; |
| 4500 }; |
| 4501 static inline ObjectPair MakePair(Object* x, Object* y) { |
| 4502 ObjectPair result = {x, y}; |
| 4503 return result; // Pointers x and y returned in rax and rdx, in AMD-x64-abi. |
| 4504 } |
| 4505 #else |
4496 typedef uint64_t ObjectPair; | 4506 typedef uint64_t ObjectPair; |
4497 static inline ObjectPair MakePair(Object* x, Object* y) { | 4507 static inline ObjectPair MakePair(Object* x, Object* y) { |
4498 #if V8_HOST_ARCH_64_BIT | |
4499 UNIMPLEMENTED(); | |
4500 return 0; | |
4501 #else | |
4502 return reinterpret_cast<uint32_t>(x) | | 4508 return reinterpret_cast<uint32_t>(x) | |
4503 (reinterpret_cast<ObjectPair>(y) << 32); | 4509 (reinterpret_cast<ObjectPair>(y) << 32); |
| 4510 } |
4504 #endif | 4511 #endif |
4505 } | 4512 |
| 4513 |
4506 | 4514 |
4507 | 4515 |
4508 static inline Object* Unhole(Object* x, PropertyAttributes attributes) { | 4516 static inline Object* Unhole(Object* x, PropertyAttributes attributes) { |
4509 ASSERT(!x->IsTheHole() || (attributes & READ_ONLY) != 0); | 4517 ASSERT(!x->IsTheHole() || (attributes & READ_ONLY) != 0); |
4510 USE(attributes); | 4518 USE(attributes); |
4511 return x->IsTheHole() ? Heap::undefined_value() : x; | 4519 return x->IsTheHole() ? Heap::undefined_value() : x; |
4512 } | 4520 } |
4513 | 4521 |
4514 | 4522 |
4515 static JSObject* ComputeReceiverForNonGlobal(JSObject* holder) { | 4523 static JSObject* ComputeReceiverForNonGlobal(JSObject* holder) { |
(...skipping 3012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7528 } else { | 7536 } else { |
7529 // Handle last resort GC and make sure to allow future allocations | 7537 // Handle last resort GC and make sure to allow future allocations |
7530 // to grow the heap without causing GCs (if possible). | 7538 // to grow the heap without causing GCs (if possible). |
7531 Counters::gc_last_resort_from_js.Increment(); | 7539 Counters::gc_last_resort_from_js.Increment(); |
7532 Heap::CollectAllGarbage(); | 7540 Heap::CollectAllGarbage(); |
7533 } | 7541 } |
7534 } | 7542 } |
7535 | 7543 |
7536 | 7544 |
7537 } } // namespace v8::internal | 7545 } } // namespace v8::internal |
OLD | NEW |