Chromium Code Reviews| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 static int sp_addr = 0; \ | 46 static int sp_addr = 0; \ |
| 47 do { \ | 47 do { \ |
| 48 ASM("mov %%esp, %0" : "=g" (sp_addr)); \ | 48 ASM("mov %%esp, %0" : "=g" (sp_addr)); \ |
| 49 } while (0) | 49 } while (0) |
| 50 #elif defined(__ARMEL__) | 50 #elif defined(__ARMEL__) |
| 51 #define GET_STACK_POINTER() \ | 51 #define GET_STACK_POINTER() \ |
| 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__) | |
| 57 #define GET_STACK_POINTER() \ | |
| 58 static int sp_addr = 0; \ | |
| 59 do { \ | |
| 60 ASM("mov sp, x0; str x0, %0" : "=g" (sp_addr) : : "x0"); \ | |
|
Rodolph Perfetta (ARM)
2014/02/07 17:53:11
You are moving x0 into sp, not what you meant.
As
rmcilroy
2014/02/07 19:02:09
Done, thanks. The assembler didn't know what ip0
| |
| 61 } while (0) | |
| 56 #elif defined(__MIPSEL__) | 62 #elif defined(__MIPSEL__) |
| 57 #define GET_STACK_POINTER() \ | 63 #define GET_STACK_POINTER() \ |
| 58 static int sp_addr = 0; \ | 64 static int sp_addr = 0; \ |
| 59 do { \ | 65 do { \ |
| 60 ASM("sw $sp, %0" : "=g" (sp_addr)); \ | 66 ASM("sw $sp, %0" : "=g" (sp_addr)); \ |
| 61 } while (0) | 67 } while (0) |
| 62 #else | 68 #else |
| 63 #error Host architecture was not detected as supported by v8 | 69 #error Host architecture was not detected as supported by v8 |
| 64 #endif | 70 #endif |
| 65 | 71 |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 83 "}"); | 89 "}"); |
| 84 | 90 |
| 85 v8::Local<v8::Object> global_object = env->Global(); | 91 v8::Local<v8::Object> global_object = env->Global(); |
| 86 v8::Local<v8::Function> foo = | 92 v8::Local<v8::Function> foo = |
| 87 v8::Local<v8::Function>::Cast(global_object->Get(v8_str("foo"))); | 93 v8::Local<v8::Function>::Cast(global_object->Get(v8_str("foo"))); |
| 88 | 94 |
| 89 v8::Local<v8::Value> result = foo->Call(global_object, 0, NULL); | 95 v8::Local<v8::Value> result = foo->Call(global_object, 0, NULL); |
| 90 CHECK_EQ(0, result->Int32Value() % OS::ActivationFrameAlignment()); | 96 CHECK_EQ(0, result->Int32Value() % OS::ActivationFrameAlignment()); |
| 91 } | 97 } |
| 92 | 98 |
| 93 #undef GET_STACK_POINTERS | 99 #undef GET_STACK_POINTERS |
|
Rodolph Perfetta (ARM)
2014/02/07 17:53:11
not part of your patch but there shouldn't be an S
| |
| 94 #undef ASM | 100 #undef ASM |
| 95 #endif // __GNUC__ | 101 #endif // __GNUC__ |
| OLD | NEW |