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_RUNTIME_RUNTIME_UTILS_H_ | 5 #ifndef V8_RUNTIME_RUNTIME_UTILS_H_ |
6 #define V8_RUNTIME_RUNTIME_UTILS_H_ | 6 #define V8_RUNTIME_RUNTIME_UTILS_H_ |
7 | 7 |
8 #include "src/base/logging.h" | 8 #include "src/base/logging.h" |
9 #include "src/runtime/runtime.h" | 9 #include "src/runtime/runtime.h" |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 #define CONVERT_NUMBER_ARG_HANDLE_CHECKED(name, index) \ | 46 #define CONVERT_NUMBER_ARG_HANDLE_CHECKED(name, index) \ |
47 RUNTIME_ASSERT(args[index]->IsNumber()); \ | 47 RUNTIME_ASSERT(args[index]->IsNumber()); \ |
48 Handle<Object> name = args.at<Object>(index); | 48 Handle<Object> name = args.at<Object>(index); |
49 | 49 |
50 // Cast the given object to a boolean and store it in a variable with | 50 // Cast the given object to a boolean and store it in a variable with |
51 // the given name. If the object is not a boolean call IllegalOperation | 51 // the given name. If the object is not a boolean call IllegalOperation |
52 // and return. | 52 // and return. |
53 #define CONVERT_BOOLEAN_ARG_CHECKED(name, index) \ | 53 #define CONVERT_BOOLEAN_ARG_CHECKED(name, index) \ |
54 RUNTIME_ASSERT(args[index]->IsBoolean()); \ | 54 RUNTIME_ASSERT(args[index]->IsBoolean()); \ |
55 bool name = args[index]->IsTrue(); | 55 bool name = args[index]->IsTrue(isolate); |
56 | 56 |
57 // Cast the given argument to a Smi and store its value in an int variable | 57 // Cast the given argument to a Smi and store its value in an int variable |
58 // with the given name. If the argument is not a Smi call IllegalOperation | 58 // with the given name. If the argument is not a Smi call IllegalOperation |
59 // and return. | 59 // and return. |
60 #define CONVERT_SMI_ARG_CHECKED(name, index) \ | 60 #define CONVERT_SMI_ARG_CHECKED(name, index) \ |
61 RUNTIME_ASSERT(args[index]->IsSmi()); \ | 61 RUNTIME_ASSERT(args[index]->IsSmi()); \ |
62 int name = args.smi_at(index); | 62 int name = args.smi_at(index); |
63 | 63 |
64 // Cast the given argument to a double and store it in a variable with | 64 // Cast the given argument to a double and store it in a variable with |
65 // the given name. If the argument is not a number (as opposed to | 65 // the given name. If the argument is not a number (as opposed to |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 static inline ObjectTriple MakeTriple(Object* x, Object* y, Object* z) { | 188 static inline ObjectTriple MakeTriple(Object* x, Object* y, Object* z) { |
189 ObjectTriple result = {x, y, z}; | 189 ObjectTriple result = {x, y, z}; |
190 // ObjectTriple is assigned to a hidden first argument. | 190 // ObjectTriple is assigned to a hidden first argument. |
191 return result; | 191 return result; |
192 } | 192 } |
193 | 193 |
194 } // namespace internal | 194 } // namespace internal |
195 } // namespace v8 | 195 } // namespace v8 |
196 | 196 |
197 #endif // V8_RUNTIME_RUNTIME_UTILS_H_ | 197 #endif // V8_RUNTIME_RUNTIME_UTILS_H_ |
OLD | NEW |