Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Side by Side Diff: src/runtime/runtime-utils.h

Issue 894683003: Introduce LanguageMode, drop StrictMode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebased (w/ conflicts) Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/runtime/runtime-scopes.cc ('k') | src/scopeinfo.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 RUNTIME_ASSERT(is_valid_language_mode(args.smi_at(index))); \
78 args.smi_at(index) == SLOPPY); \ 78 LanguageMode name = static_cast<LanguageMode>(args.smi_at(index));
79 StrictMode name = static_cast<StrictMode>(args.smi_at(index));
80 79
81 80
82 // Assert that the given argument is a number within the Int32 range 81 // 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 82 // and convert it to int32_t. If the argument is not an Int32 call
84 // IllegalOperation and return. 83 // IllegalOperation and return.
85 #define CONVERT_INT32_ARG_CHECKED(name, index) \ 84 #define CONVERT_INT32_ARG_CHECKED(name, index) \
86 RUNTIME_ASSERT(args[index]->IsNumber()); \ 85 RUNTIME_ASSERT(args[index]->IsNumber()); \
87 int32_t name = 0; \ 86 int32_t name = 0; \
88 RUNTIME_ASSERT(args[index]->ToInt32(&name)); 87 RUNTIME_ASSERT(args[index]->ToInt32(&name));
89 88
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 #else 137 #else
139 #error Unknown endianness 138 #error Unknown endianness
140 #endif 139 #endif
141 } 140 }
142 #endif 141 #endif
143 142
144 } 143 }
145 } // namespace v8::internal 144 } // namespace v8::internal
146 145
147 #endif // V8_RUNTIME_RUNTIME_UTILS_H_ 146 #endif // V8_RUNTIME_RUNTIME_UTILS_H_
OLDNEW
« no previous file with comments | « src/runtime/runtime-scopes.cc ('k') | src/scopeinfo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698