OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_PPC_MACRO_ASSEMBLER_PPC_H_ | 5 #ifndef V8_PPC_MACRO_ASSEMBLER_PPC_H_ |
6 #define V8_PPC_MACRO_ASSEMBLER_PPC_H_ | 6 #define V8_PPC_MACRO_ASSEMBLER_PPC_H_ |
7 | 7 |
8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
9 #include "src/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
10 #include "src/frames.h" | 10 #include "src/frames.h" |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 // remove in a register (or no_reg, if there is nothing to remove). | 408 // remove in a register (or no_reg, if there is nothing to remove). |
409 void LeaveExitFrame(bool save_doubles, Register argument_count, | 409 void LeaveExitFrame(bool save_doubles, Register argument_count, |
410 bool restore_context, | 410 bool restore_context, |
411 bool argument_count_is_length = false); | 411 bool argument_count_is_length = false); |
412 | 412 |
413 // Get the actual activation frame alignment for target environment. | 413 // Get the actual activation frame alignment for target environment. |
414 static int ActivationFrameAlignment(); | 414 static int ActivationFrameAlignment(); |
415 | 415 |
416 void LoadContext(Register dst, int context_chain_length); | 416 void LoadContext(Register dst, int context_chain_length); |
417 | 417 |
| 418 // Load the global proxy from the current context. |
| 419 void LoadGlobalProxy(Register dst); |
| 420 |
418 // Conditionally load the cached Array transitioned map of type | 421 // Conditionally load the cached Array transitioned map of type |
419 // transitioned_kind from the native context if the map in register | 422 // transitioned_kind from the native context if the map in register |
420 // map_in_out is the cached Array map in the native context of | 423 // map_in_out is the cached Array map in the native context of |
421 // expected_kind. | 424 // expected_kind. |
422 void LoadTransitionedArrayMapConditional(ElementsKind expected_kind, | 425 void LoadTransitionedArrayMapConditional(ElementsKind expected_kind, |
423 ElementsKind transitioned_kind, | 426 ElementsKind transitioned_kind, |
424 Register map_in_out, | 427 Register map_in_out, |
425 Register scratch, | 428 Register scratch, |
426 Label* no_map_match); | 429 Label* no_map_match); |
427 | 430 |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 | 777 |
775 void GetWeakValue(Register value, Handle<WeakCell> cell); | 778 void GetWeakValue(Register value, Handle<WeakCell> cell); |
776 | 779 |
777 // Load the value of the weak cell in the value register. Branch to the given | 780 // Load the value of the weak cell in the value register. Branch to the given |
778 // miss label if the weak cell was cleared. | 781 // miss label if the weak cell was cleared. |
779 void LoadWeakValue(Register value, Handle<WeakCell> cell, Label* miss); | 782 void LoadWeakValue(Register value, Handle<WeakCell> cell, Label* miss); |
780 | 783 |
781 // Compare the object in a register to a value from the root list. | 784 // Compare the object in a register to a value from the root list. |
782 // Uses the ip register as scratch. | 785 // Uses the ip register as scratch. |
783 void CompareRoot(Register obj, Heap::RootListIndex index); | 786 void CompareRoot(Register obj, Heap::RootListIndex index); |
| 787 void PushRoot(Heap::RootListIndex index) { |
| 788 LoadRoot(r0, index); |
| 789 Push(r0); |
| 790 } |
784 | 791 |
| 792 // Compare the object in a register to a value and jump if they are equal. |
| 793 void JumpIfRoot(Register with, Heap::RootListIndex index, Label* if_equal) { |
| 794 CompareRoot(with, index); |
| 795 beq(if_equal); |
| 796 } |
| 797 |
| 798 // Compare the object in a register to a value and jump if they are not equal. |
| 799 void JumpIfNotRoot(Register with, Heap::RootListIndex index, |
| 800 Label* if_not_equal) { |
| 801 CompareRoot(with, index); |
| 802 bne(if_not_equal); |
| 803 } |
785 | 804 |
786 // Load and check the instance type of an object for being a string. | 805 // Load and check the instance type of an object for being a string. |
787 // Loads the type into the second argument register. | 806 // Loads the type into the second argument register. |
788 // Returns a condition that will be enabled if the object was a string. | 807 // Returns a condition that will be enabled if the object was a string. |
789 Condition IsObjectStringType(Register obj, Register type) { | 808 Condition IsObjectStringType(Register obj, Register type) { |
790 LoadP(type, FieldMemOperand(obj, HeapObject::kMapOffset)); | 809 LoadP(type, FieldMemOperand(obj, HeapObject::kMapOffset)); |
791 lbz(type, FieldMemOperand(type, Map::kInstanceTypeOffset)); | 810 lbz(type, FieldMemOperand(type, Map::kInstanceTypeOffset)); |
792 andi(r0, type, Operand(kIsNotStringMask)); | 811 andi(r0, type, Operand(kIsNotStringMask)); |
793 DCHECK_EQ(0u, kStringTag); | 812 DCHECK_EQ(0u, kStringTag); |
794 return eq; | 813 return eq; |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1281 #else | 1300 #else |
1282 #define SmiWordOffset(offset) offset | 1301 #define SmiWordOffset(offset) offset |
1283 #endif | 1302 #endif |
1284 | 1303 |
1285 // Abort execution if argument is not a string, enabled via --debug-code. | 1304 // Abort execution if argument is not a string, enabled via --debug-code. |
1286 void AssertString(Register object); | 1305 void AssertString(Register object); |
1287 | 1306 |
1288 // Abort execution if argument is not a name, enabled via --debug-code. | 1307 // Abort execution if argument is not a name, enabled via --debug-code. |
1289 void AssertName(Register object); | 1308 void AssertName(Register object); |
1290 | 1309 |
| 1310 void AssertFunction(Register object); |
| 1311 |
1291 // Abort execution if argument is not undefined or an AllocationSite, enabled | 1312 // Abort execution if argument is not undefined or an AllocationSite, enabled |
1292 // via --debug-code. | 1313 // via --debug-code. |
1293 void AssertUndefinedOrAllocationSite(Register object, Register scratch); | 1314 void AssertUndefinedOrAllocationSite(Register object, Register scratch); |
1294 | 1315 |
1295 // Abort execution if reg is not the root value with the given index, | 1316 // Abort execution if reg is not the root value with the given index, |
1296 // enabled via --debug-code. | 1317 // enabled via --debug-code. |
1297 void AssertIsRoot(Register reg, Heap::RootListIndex index); | 1318 void AssertIsRoot(Register reg, Heap::RootListIndex index); |
1298 | 1319 |
1299 // --------------------------------------------------------------------------- | 1320 // --------------------------------------------------------------------------- |
1300 // HeapNumber utilities | 1321 // HeapNumber utilities |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1549 #define ACCESS_MASM(masm) \ | 1570 #define ACCESS_MASM(masm) \ |
1550 masm->stop(__FILE_LINE__); \ | 1571 masm->stop(__FILE_LINE__); \ |
1551 masm-> | 1572 masm-> |
1552 #else | 1573 #else |
1553 #define ACCESS_MASM(masm) masm-> | 1574 #define ACCESS_MASM(masm) masm-> |
1554 #endif | 1575 #endif |
1555 } | 1576 } |
1556 } // namespace v8::internal | 1577 } // namespace v8::internal |
1557 | 1578 |
1558 #endif // V8_PPC_MACRO_ASSEMBLER_PPC_H_ | 1579 #endif // V8_PPC_MACRO_ASSEMBLER_PPC_H_ |
OLD | NEW |