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 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 const ParameterCount& actual, InvokeFlag flag, | 627 const ParameterCount& actual, InvokeFlag flag, |
628 const CallWrapper& call_wrapper); | 628 const CallWrapper& call_wrapper); |
629 | 629 |
630 void InvokeFunction(Handle<JSFunction> function, | 630 void InvokeFunction(Handle<JSFunction> function, |
631 const ParameterCount& expected, | 631 const ParameterCount& expected, |
632 const ParameterCount& actual, InvokeFlag flag, | 632 const ParameterCount& actual, InvokeFlag flag, |
633 const CallWrapper& call_wrapper); | 633 const CallWrapper& call_wrapper); |
634 | 634 |
635 void IsObjectJSStringType(Register object, Register scratch, Label* fail); | 635 void IsObjectJSStringType(Register object, Register scratch, Label* fail); |
636 | 636 |
637 void IsObjectNameType(Register object, Register scratch, Label* fail); | |
638 | |
639 void DebugBreak(); | 637 void DebugBreak(); |
640 // Frame restart support | 638 // Frame restart support |
641 void MaybeDropFrames(); | 639 void MaybeDropFrames(); |
642 | 640 |
643 // Exception handling | 641 // Exception handling |
644 | 642 |
645 // Push a new stack handler and link into stack handler chain. | 643 // Push a new stack handler and link into stack handler chain. |
646 void PushStackHandler(); | 644 void PushStackHandler(); |
647 | 645 |
648 // Unlink the stack handler on top of the stack from the stack handler chain. | 646 // Unlink the stack handler on top of the stack from the stack handler chain. |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 // heap object). If mode is ALLOW_ELEMENT_TRANSITION_MAPS, then also match | 775 // heap object). If mode is ALLOW_ELEMENT_TRANSITION_MAPS, then also match |
778 // against maps that are ElementsKind transition maps of the specified map. | 776 // against maps that are ElementsKind transition maps of the specified map. |
779 void CheckMap(Register obj, Register scratch, Handle<Map> map, Label* fail, | 777 void CheckMap(Register obj, Register scratch, Handle<Map> map, Label* fail, |
780 SmiCheckType smi_check_type); | 778 SmiCheckType smi_check_type); |
781 | 779 |
782 | 780 |
783 void CheckMap(Register obj, Register scratch, Heap::RootListIndex index, | 781 void CheckMap(Register obj, Register scratch, Heap::RootListIndex index, |
784 Label* fail, SmiCheckType smi_check_type); | 782 Label* fail, SmiCheckType smi_check_type); |
785 | 783 |
786 | 784 |
787 // Check if the map of an object is equal to a specified weak map and branch | |
788 // to a specified target if equal. Skip the smi check if not required | |
789 // (object is known to be a heap object) | |
790 void DispatchWeakMap(Register obj, Register scratch1, Register scratch2, | |
791 Handle<WeakCell> cell, Handle<Code> success, | |
792 SmiCheckType smi_check_type); | |
793 | |
794 // Compare the given value and the value of weak cell. | |
795 void CmpWeakValue(Register value, Handle<WeakCell> cell, Register scratch, | |
796 CRegister cr = cr7); | |
797 | |
798 void GetWeakValue(Register value, Handle<WeakCell> cell); | 785 void GetWeakValue(Register value, Handle<WeakCell> cell); |
799 | 786 |
800 // Load the value of the weak cell in the value register. Branch to the given | 787 // Load the value of the weak cell in the value register. Branch to the given |
801 // miss label if the weak cell was cleared. | 788 // miss label if the weak cell was cleared. |
802 void LoadWeakValue(Register value, Handle<WeakCell> cell, Label* miss); | 789 void LoadWeakValue(Register value, Handle<WeakCell> cell, Label* miss); |
803 | 790 |
804 // Compare the object in a register to a value from the root list. | 791 // Compare the object in a register to a value from the root list. |
805 // Uses the ip register as scratch. | 792 // Uses the ip register as scratch. |
806 void CompareRoot(Register obj, Heap::RootListIndex index); | 793 void CompareRoot(Register obj, Heap::RootListIndex index); |
807 void PushRoot(Heap::RootListIndex index) { | 794 void PushRoot(Heap::RootListIndex index) { |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1022 void DecrementCounter(StatsCounter* counter, int value, Register scratch1, | 1009 void DecrementCounter(StatsCounter* counter, int value, Register scratch1, |
1023 Register scratch2); | 1010 Register scratch2); |
1024 | 1011 |
1025 | 1012 |
1026 // --------------------------------------------------------------------------- | 1013 // --------------------------------------------------------------------------- |
1027 // Debugging | 1014 // Debugging |
1028 | 1015 |
1029 // Calls Abort(msg) if the condition cond is not satisfied. | 1016 // Calls Abort(msg) if the condition cond is not satisfied. |
1030 // Use --debug_code to enable. | 1017 // Use --debug_code to enable. |
1031 void Assert(Condition cond, BailoutReason reason, CRegister cr = cr7); | 1018 void Assert(Condition cond, BailoutReason reason, CRegister cr = cr7); |
1032 void AssertFastElements(Register elements); | |
1033 | 1019 |
1034 // Like Assert(), but always enabled. | 1020 // Like Assert(), but always enabled. |
1035 void Check(Condition cond, BailoutReason reason, CRegister cr = cr7); | 1021 void Check(Condition cond, BailoutReason reason, CRegister cr = cr7); |
1036 | 1022 |
1037 // Print a message to stdout and abort execution. | 1023 // Print a message to stdout and abort execution. |
1038 void Abort(BailoutReason reason); | 1024 void Abort(BailoutReason reason); |
1039 | 1025 |
1040 // Verify restrictions about code generated in stubs. | 1026 // Verify restrictions about code generated in stubs. |
1041 void set_generating_stub(bool value) { generating_stub_ = value; } | 1027 void set_generating_stub(bool value) { generating_stub_ = value; } |
1042 bool generating_stub() { return generating_stub_; } | 1028 bool generating_stub() { return generating_stub_; } |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1272 // Jump if either of the registers contain a non-smi. | 1258 // Jump if either of the registers contain a non-smi. |
1273 inline void JumpIfNotSmi(Register value, Label* not_smi_label) { | 1259 inline void JumpIfNotSmi(Register value, Label* not_smi_label) { |
1274 TestIfSmi(value, r0); | 1260 TestIfSmi(value, r0); |
1275 bne(not_smi_label, cr0); | 1261 bne(not_smi_label, cr0); |
1276 } | 1262 } |
1277 // Jump if either of the registers contain a non-smi. | 1263 // Jump if either of the registers contain a non-smi. |
1278 void JumpIfNotBothSmi(Register reg1, Register reg2, Label* on_not_both_smi); | 1264 void JumpIfNotBothSmi(Register reg1, Register reg2, Label* on_not_both_smi); |
1279 // Jump if either of the registers contain a smi. | 1265 // Jump if either of the registers contain a smi. |
1280 void JumpIfEitherSmi(Register reg1, Register reg2, Label* on_either_smi); | 1266 void JumpIfEitherSmi(Register reg1, Register reg2, Label* on_either_smi); |
1281 | 1267 |
1282 // Abort execution if argument is a number, enabled via --debug-code. | |
1283 void AssertNotNumber(Register object); | |
1284 | |
1285 // Abort execution if argument is a smi, enabled via --debug-code. | 1268 // Abort execution if argument is a smi, enabled via --debug-code. |
1286 void AssertNotSmi(Register object); | 1269 void AssertNotSmi(Register object); |
1287 void AssertSmi(Register object); | 1270 void AssertSmi(Register object); |
1288 | 1271 |
1289 | 1272 |
1290 #if V8_TARGET_ARCH_PPC64 | 1273 #if V8_TARGET_ARCH_PPC64 |
1291 inline void TestIfInt32(Register value, Register scratch, | 1274 inline void TestIfInt32(Register value, Register scratch, |
1292 CRegister cr = cr7) { | 1275 CRegister cr = cr7) { |
1293 // High bits must be identical to fit into an 32-bit integer | 1276 // High bits must be identical to fit into an 32-bit integer |
1294 extsw(scratch, value); | 1277 extsw(scratch, value); |
(...skipping 13 matching lines...) Expand all Loading... |
1308 // upper half of the smi. | 1291 // upper half of the smi. |
1309 STATIC_ASSERT(kSmiTag == 0); | 1292 STATIC_ASSERT(kSmiTag == 0); |
1310 STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 32); | 1293 STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 32); |
1311 #endif | 1294 #endif |
1312 #if V8_TARGET_ARCH_PPC64 && V8_TARGET_LITTLE_ENDIAN | 1295 #if V8_TARGET_ARCH_PPC64 && V8_TARGET_LITTLE_ENDIAN |
1313 #define SmiWordOffset(offset) (offset + kPointerSize / 2) | 1296 #define SmiWordOffset(offset) (offset + kPointerSize / 2) |
1314 #else | 1297 #else |
1315 #define SmiWordOffset(offset) offset | 1298 #define SmiWordOffset(offset) offset |
1316 #endif | 1299 #endif |
1317 | 1300 |
1318 // Abort execution if argument is not a string, enabled via --debug-code. | |
1319 void AssertString(Register object); | |
1320 | |
1321 // Abort execution if argument is not a name, enabled via --debug-code. | |
1322 void AssertName(Register object); | |
1323 | |
1324 void AssertFunction(Register object); | 1301 void AssertFunction(Register object); |
1325 | 1302 |
1326 // Abort execution if argument is not a JSBoundFunction, | 1303 // Abort execution if argument is not a JSBoundFunction, |
1327 // enabled via --debug-code. | 1304 // enabled via --debug-code. |
1328 void AssertBoundFunction(Register object); | 1305 void AssertBoundFunction(Register object); |
1329 | 1306 |
1330 // Abort execution if argument is not a JSGeneratorObject, | 1307 // Abort execution if argument is not a JSGeneratorObject, |
1331 // enabled via --debug-code. | 1308 // enabled via --debug-code. |
1332 void AssertGeneratorObject(Register object); | 1309 void AssertGeneratorObject(Register object); |
1333 | 1310 |
1334 // Abort execution if argument is not a JSReceiver, enabled via --debug-code. | |
1335 void AssertReceiver(Register object); | |
1336 | |
1337 // Abort execution if argument is not undefined or an AllocationSite, enabled | 1311 // Abort execution if argument is not undefined or an AllocationSite, enabled |
1338 // via --debug-code. | 1312 // via --debug-code. |
1339 void AssertUndefinedOrAllocationSite(Register object, Register scratch); | 1313 void AssertUndefinedOrAllocationSite(Register object, Register scratch); |
1340 | 1314 |
1341 // Abort execution if reg is not the root value with the given index, | 1315 // Abort execution if reg is not the root value with the given index, |
1342 // enabled via --debug-code. | 1316 // enabled via --debug-code. |
1343 void AssertIsRoot(Register reg, Heap::RootListIndex index); | 1317 void AssertIsRoot(Register reg, Heap::RootListIndex index); |
1344 | 1318 |
1345 // --------------------------------------------------------------------------- | 1319 // --------------------------------------------------------------------------- |
1346 // HeapNumber utilities | 1320 // HeapNumber utilities |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1561 inline MemOperand NativeContextMemOperand() { | 1535 inline MemOperand NativeContextMemOperand() { |
1562 return ContextMemOperand(cp, Context::NATIVE_CONTEXT_INDEX); | 1536 return ContextMemOperand(cp, Context::NATIVE_CONTEXT_INDEX); |
1563 } | 1537 } |
1564 | 1538 |
1565 #define ACCESS_MASM(masm) masm-> | 1539 #define ACCESS_MASM(masm) masm-> |
1566 | 1540 |
1567 } // namespace internal | 1541 } // namespace internal |
1568 } // namespace v8 | 1542 } // namespace v8 |
1569 | 1543 |
1570 #endif // V8_PPC_MACRO_ASSEMBLER_PPC_H_ | 1544 #endif // V8_PPC_MACRO_ASSEMBLER_PPC_H_ |
OLD | NEW |