| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 // | 116 // |
| 117 // A builtin function is defined by writing: | 117 // A builtin function is defined by writing: |
| 118 // | 118 // |
| 119 // BUILTIN(name) { | 119 // BUILTIN(name) { |
| 120 // ... | 120 // ... |
| 121 // } | 121 // } |
| 122 // | 122 // |
| 123 // In the body of the builtin function the arguments can be accessed | 123 // In the body of the builtin function the arguments can be accessed |
| 124 // through the BuiltinArguments object args. | 124 // through the BuiltinArguments object args. |
| 125 | 125 |
| 126 #if defined(V8_ARM_ON_X86_64) |
| 127 #define BUILTIN(name) \ |
| 128 static MaybeObject* Builtin_x86_64_impl##name(name##ArgumentsType args, \ |
| 129 Isolate* isolate); \ |
| 130 static MaybeObject* Builtin_##name(int arglength, Object** argobject, \ |
| 131 Isolate* isolate) { \ |
| 132 name##ArgumentsType args(arglength, argobject); \ |
| 133 return Builtin_x86_64_impl##name(args, isolate); \ |
| 134 } \ |
| 135 static MaybeObject* Builtin_x86_64_impl##name(name##ArgumentsType args, \ |
| 136 Isolate* isolate) |
| 137 |
| 138 #else |
| 139 |
| 126 #ifdef DEBUG | 140 #ifdef DEBUG |
| 127 | 141 |
| 128 #define BUILTIN(name) \ | 142 #define BUILTIN(name) \ |
| 129 MUST_USE_RESULT static MaybeObject* Builtin_Impl_##name( \ | 143 MUST_USE_RESULT static MaybeObject* Builtin_Impl_##name( \ |
| 130 name##ArgumentsType args, Isolate* isolate); \ | 144 name##ArgumentsType args, Isolate* isolate); \ |
| 131 MUST_USE_RESULT static MaybeObject* Builtin_##name( \ | 145 MUST_USE_RESULT static MaybeObject* Builtin_##name( \ |
| 132 name##ArgumentsType args, Isolate* isolate) { \ | 146 name##ArgumentsType args, Isolate* isolate) { \ |
| 133 ASSERT(isolate == Isolate::Current()); \ | 147 ASSERT(isolate == Isolate::Current()); \ |
| 134 args.Verify(); \ | 148 args.Verify(); \ |
| 135 return Builtin_Impl_##name(args, isolate); \ | 149 return Builtin_Impl_##name(args, isolate); \ |
| 136 } \ | 150 } \ |
| 137 MUST_USE_RESULT static MaybeObject* Builtin_Impl_##name( \ | 151 MUST_USE_RESULT static MaybeObject* Builtin_Impl_##name( \ |
| 138 name##ArgumentsType args, Isolate* isolate) | 152 name##ArgumentsType args, Isolate* isolate) |
| 139 | 153 |
| 140 #else // For release mode. | 154 #else // For release mode. |
| 141 | 155 |
| 142 #define BUILTIN(name) \ | 156 #define BUILTIN(name) \ |
| 143 static MaybeObject* Builtin_##name(name##ArgumentsType args, Isolate* isolate) | 157 static MaybeObject* Builtin_##name(name##ArgumentsType args, Isolate* isolate) |
| 144 | 158 |
| 145 #endif | 159 #endif |
| 146 | 160 #endif // defined(V8_ARM_ON_X86_64) |
| 147 | 161 |
| 148 static inline bool CalledAsConstructor(Isolate* isolate) { | 162 static inline bool CalledAsConstructor(Isolate* isolate) { |
| 149 #ifdef DEBUG | 163 #ifdef DEBUG |
| 150 // Calculate the result using a full stack frame iterator and check | 164 // Calculate the result using a full stack frame iterator and check |
| 151 // that the state of the stack is as we assume it to be in the | 165 // that the state of the stack is as we assume it to be in the |
| 152 // code below. | 166 // code below. |
| 153 StackFrameIterator it(isolate); | 167 StackFrameIterator it(isolate); |
| 154 ASSERT(it.frame()->is_exit()); | 168 ASSERT(it.frame()->is_exit()); |
| 155 it.Advance(); | 169 it.Advance(); |
| 156 StackFrame* frame = it.frame(); | 170 StackFrame* frame = it.frame(); |
| (...skipping 1710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1867 return Handle<Code>(code_address); \ | 1881 return Handle<Code>(code_address); \ |
| 1868 } | 1882 } |
| 1869 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 1883 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
| 1870 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 1884 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 1871 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 1885 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 1872 #undef DEFINE_BUILTIN_ACCESSOR_C | 1886 #undef DEFINE_BUILTIN_ACCESSOR_C |
| 1873 #undef DEFINE_BUILTIN_ACCESSOR_A | 1887 #undef DEFINE_BUILTIN_ACCESSOR_A |
| 1874 | 1888 |
| 1875 | 1889 |
| 1876 } } // namespace v8::internal | 1890 } } // namespace v8::internal |
| OLD | NEW |