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 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
63 | 63 |
64 | 64 |
65 // Cast the given argument to PropertyDetails and store its value in a | 65 // Cast the given argument to PropertyDetails and store its value in a |
66 // variable with the given name. If the argument is not a Smi call | 66 // variable with the given name. If the argument is not a Smi call |
67 // IllegalOperation and return. | 67 // IllegalOperation and return. |
68 #define CONVERT_PROPERTY_DETAILS_CHECKED(name, index) \ | 68 #define CONVERT_PROPERTY_DETAILS_CHECKED(name, index) \ |
69 RUNTIME_ASSERT(args[index]->IsSmi()); \ | 69 RUNTIME_ASSERT(args[index]->IsSmi()); \ |
70 PropertyDetails name = PropertyDetails(Smi::cast(args[index])); | 70 PropertyDetails name = PropertyDetails(Smi::cast(args[index])); |
71 | 71 |
72 | 72 |
73 // Assert that the given argument has a valid value for a StrictMode | 73 // Assert that the given argument has a valid value for a LanguageMode |
74 // and store it in a StrictMode variable with the given name. | 74 // and store it in a LanguageMode variable with the given name. |
75 #define CONVERT_STRICT_MODE_ARG_CHECKED(name, index) \ | 75 #define CONVERT_LANGUAGE_MODE_ARG_CHECKED(name, index) \ |
76 RUNTIME_ASSERT(args[index]->IsSmi()); \ | 76 RUNTIME_ASSERT(args[index]->IsSmi()); \ |
77 RUNTIME_ASSERT(args.smi_at(index) == STRICT || \ | 77 STATIC_ASSERT(LANGUAGE_END == 2); \ |
78 args.smi_at(index) == SLOPPY); \ | 78 RUNTIME_ASSERT(args.smi_at(index) == STRICT || \ |
rossberg
2015/02/03 12:26:20
same here
marja
2015/02/03 14:45:02
Done.
| |
79 StrictMode name = static_cast<StrictMode>(args.smi_at(index)); | 79 args.smi_at(index) == SLOPPY); \ |
80 LanguageMode name = static_cast<LanguageMode>(args.smi_at(index)); | |
80 | 81 |
81 | 82 |
82 // Assert that the given argument is a number within the Int32 range | 83 // Assert that the given argument is a number within the Int32 range |
83 // and convert it to int32_t. If the argument is not an Int32 call | 84 // and convert it to int32_t. If the argument is not an Int32 call |
84 // IllegalOperation and return. | 85 // IllegalOperation and return. |
85 #define CONVERT_INT32_ARG_CHECKED(name, index) \ | 86 #define CONVERT_INT32_ARG_CHECKED(name, index) \ |
86 RUNTIME_ASSERT(args[index]->IsNumber()); \ | 87 RUNTIME_ASSERT(args[index]->IsNumber()); \ |
87 int32_t name = 0; \ | 88 int32_t name = 0; \ |
88 RUNTIME_ASSERT(args[index]->ToInt32(&name)); | 89 RUNTIME_ASSERT(args[index]->ToInt32(&name)); |
89 | 90 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
138 #else | 139 #else |
139 #error Unknown endianness | 140 #error Unknown endianness |
140 #endif | 141 #endif |
141 } | 142 } |
142 #endif | 143 #endif |
143 | 144 |
144 } | 145 } |
145 } // namespace v8::internal | 146 } // namespace v8::internal |
146 | 147 |
147 #endif // V8_RUNTIME_RUNTIME_UTILS_H_ | 148 #endif // V8_RUNTIME_RUNTIME_UTILS_H_ |
OLD | NEW |