OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 static int sp_addr = 0; \ | 52 static int sp_addr = 0; \ |
53 do { \ | 53 do { \ |
54 ASM("str %%sp, %0" : "=g" (sp_addr)); \ | 54 ASM("str %%sp, %0" : "=g" (sp_addr)); \ |
55 } while (0) | 55 } while (0) |
56 #elif defined(__AARCH64EL__) | 56 #elif defined(__AARCH64EL__) |
57 #define GET_STACK_POINTER() \ | 57 #define GET_STACK_POINTER() \ |
58 static int sp_addr = 0; \ | 58 static int sp_addr = 0; \ |
59 do { \ | 59 do { \ |
60 ASM("mov x16, sp; str x16, %0" : "=g" (sp_addr)); \ | 60 ASM("mov x16, sp; str x16, %0" : "=g" (sp_addr)); \ |
61 } while (0) | 61 } while (0) |
62 #elif defined(__MIPSEL__) | 62 #elif defined(__MIPSEB__) || defined(__MIPSEL__) |
63 #define GET_STACK_POINTER() \ | 63 #define GET_STACK_POINTER() \ |
64 static int sp_addr = 0; \ | 64 static int sp_addr = 0; \ |
65 do { \ | 65 do { \ |
66 ASM("sw $sp, %0" : "=g" (sp_addr)); \ | 66 ASM("sw $sp, %0" : "=g" (sp_addr)); \ |
67 } while (0) | 67 } while (0) |
68 #else | 68 #else |
69 #error Host architecture was not detected as supported by v8 | 69 #error Host architecture was not detected as supported by v8 |
70 #endif | 70 #endif |
71 | 71 |
72 void GetStackPointer(const v8::FunctionCallbackInfo<v8::Value>& args) { | 72 void GetStackPointer(const v8::FunctionCallbackInfo<v8::Value>& args) { |
(...skipping 20 matching lines...) Expand all Loading... |
93 v8::Local<v8::Function> foo = | 93 v8::Local<v8::Function> foo = |
94 v8::Local<v8::Function>::Cast(global_object->Get(v8_str("foo"))); | 94 v8::Local<v8::Function>::Cast(global_object->Get(v8_str("foo"))); |
95 | 95 |
96 v8::Local<v8::Value> result = foo->Call(global_object, 0, NULL); | 96 v8::Local<v8::Value> result = foo->Call(global_object, 0, NULL); |
97 CHECK_EQ(0, result->Int32Value() % OS::ActivationFrameAlignment()); | 97 CHECK_EQ(0, result->Int32Value() % OS::ActivationFrameAlignment()); |
98 } | 98 } |
99 | 99 |
100 #undef GET_STACK_POINTERS | 100 #undef GET_STACK_POINTERS |
101 #undef ASM | 101 #undef ASM |
102 #endif // __GNUC__ | 102 #endif // __GNUC__ |
OLD | NEW |