| 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 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 #include "api.h" | 30 #include "api.h" |
| 31 #include "arguments.h" | 31 #include "arguments.h" |
| 32 #include "bootstrapper.h" | 32 #include "bootstrapper.h" |
| 33 #include "builtins.h" | 33 #include "builtins.h" |
| 34 #include "cpu-profiler.h" | 34 #include "cpu-profiler.h" |
| 35 #include "gdb-jit.h" | 35 #include "gdb-jit.h" |
| 36 #include "ic-inl.h" | 36 #include "ic-inl.h" |
| 37 #include "heap-profiler.h" | 37 #include "heap-profiler.h" |
| 38 #include "mark-compact.h" | 38 #include "mark-compact.h" |
| 39 #include "msan.h" |
| 39 #include "stub-cache.h" | 40 #include "stub-cache.h" |
| 40 #include "vm-state-inl.h" | 41 #include "vm-state-inl.h" |
| 41 | 42 |
| 42 namespace v8 { | 43 namespace v8 { |
| 43 namespace internal { | 44 namespace internal { |
| 44 | 45 |
| 45 namespace { | 46 namespace { |
| 46 | 47 |
| 47 // Arguments object passed to C++ builtins. | 48 // Arguments object passed to C++ builtins. |
| 48 template <BuiltinExtraArguments extra_args> | 49 template <BuiltinExtraArguments extra_args> |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 // through the BuiltinArguments object args. | 126 // through the BuiltinArguments object args. |
| 126 | 127 |
| 127 #ifdef DEBUG | 128 #ifdef DEBUG |
| 128 | 129 |
| 129 #define BUILTIN(name) \ | 130 #define BUILTIN(name) \ |
| 130 MUST_USE_RESULT static MaybeObject* Builtin_Impl_##name( \ | 131 MUST_USE_RESULT static MaybeObject* Builtin_Impl_##name( \ |
| 131 name##ArgumentsType args, Isolate* isolate); \ | 132 name##ArgumentsType args, Isolate* isolate); \ |
| 132 MUST_USE_RESULT static MaybeObject* Builtin_##name( \ | 133 MUST_USE_RESULT static MaybeObject* Builtin_##name( \ |
| 133 int args_length, Object** args_object, Isolate* isolate) { \ | 134 int args_length, Object** args_object, Isolate* isolate) { \ |
| 134 name##ArgumentsType args(args_length, args_object); \ | 135 name##ArgumentsType args(args_length, args_object); \ |
| 136 MSAN_RUNTIME_FUNCTION3(args_length, args_object, isolate); \ |
| 135 args.Verify(); \ | 137 args.Verify(); \ |
| 136 return Builtin_Impl_##name(args, isolate); \ | 138 return Builtin_Impl_##name(args, isolate); \ |
| 137 } \ | 139 } \ |
| 138 MUST_USE_RESULT static MaybeObject* Builtin_Impl_##name( \ | 140 MUST_USE_RESULT static MaybeObject* Builtin_Impl_##name( \ |
| 139 name##ArgumentsType args, Isolate* isolate) | 141 name##ArgumentsType args, Isolate* isolate) |
| 140 | 142 |
| 141 #else // For release mode. | 143 #else // For release mode. |
| 142 | 144 |
| 143 #define BUILTIN(name) \ | 145 #define BUILTIN(name) \ |
| 144 static MaybeObject* Builtin_impl##name( \ | 146 static MaybeObject* Builtin_impl##name( \ |
| 145 name##ArgumentsType args, Isolate* isolate); \ | 147 name##ArgumentsType args, Isolate* isolate); \ |
| 146 static MaybeObject* Builtin_##name( \ | 148 static MaybeObject* Builtin_##name( \ |
| 147 int args_length, Object** args_object, Isolate* isolate) { \ | 149 int args_length, Object** args_object, Isolate* isolate) { \ |
| 148 name##ArgumentsType args(args_length, args_object); \ | 150 name##ArgumentsType args(args_length, args_object); \ |
| 151 MSAN_RUNTIME_FUNCTION3(args_length, args_object, isolate); \ |
| 149 return Builtin_impl##name(args, isolate); \ | 152 return Builtin_impl##name(args, isolate); \ |
| 150 } \ | 153 } \ |
| 151 static MaybeObject* Builtin_impl##name( \ | 154 static MaybeObject* Builtin_impl##name( \ |
| 152 name##ArgumentsType args, Isolate* isolate) | 155 name##ArgumentsType args, Isolate* isolate) |
| 153 #endif | 156 #endif |
| 154 | 157 |
| 155 | 158 |
| 156 static inline bool CalledAsConstructor(Isolate* isolate) { | 159 static inline bool CalledAsConstructor(Isolate* isolate) { |
| 157 #ifdef DEBUG | 160 #ifdef DEBUG |
| 158 // Calculate the result using a full stack frame iterator and check | 161 // Calculate the result using a full stack frame iterator and check |
| (...skipping 1641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1800 } | 1803 } |
| 1801 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 1804 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
| 1802 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 1805 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 1803 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 1806 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
| 1804 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 1807 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 1805 #undef DEFINE_BUILTIN_ACCESSOR_C | 1808 #undef DEFINE_BUILTIN_ACCESSOR_C |
| 1806 #undef DEFINE_BUILTIN_ACCESSOR_A | 1809 #undef DEFINE_BUILTIN_ACCESSOR_A |
| 1807 | 1810 |
| 1808 | 1811 |
| 1809 } } // namespace v8::internal | 1812 } } // namespace v8::internal |
| OLD | NEW |