OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 | 64 |
65 void MarkAsEval() { | 65 void MarkAsEval() { |
66 ASSERT(!is_lazy()); | 66 ASSERT(!is_lazy()); |
67 flags_ |= IsEval::encode(true); | 67 flags_ |= IsEval::encode(true); |
68 } | 68 } |
69 void MarkAsGlobal() { | 69 void MarkAsGlobal() { |
70 ASSERT(!is_lazy()); | 70 ASSERT(!is_lazy()); |
71 flags_ |= IsGlobal::encode(true); | 71 flags_ |= IsGlobal::encode(true); |
72 } | 72 } |
73 void MarkAsStrict() { | 73 void MarkAsStrict() { |
74 ASSERT(!is_lazy()); | |
75 flags_ |= IsStrict::encode(true); | 74 flags_ |= IsStrict::encode(true); |
76 } | 75 } |
77 StrictModeFlag StrictMode() { | 76 StrictModeFlag StrictMode() { |
78 return is_strict() ? kStrictMode : kNonStrictMode; | 77 return is_strict() ? kStrictMode : kNonStrictMode; |
79 } | 78 } |
80 void MarkAsInLoop() { | 79 void MarkAsInLoop() { |
81 ASSERT(is_lazy()); | 80 ASSERT(is_lazy()); |
82 flags_ |= IsInLoop::encode(true); | 81 flags_ |= IsInLoop::encode(true); |
83 } | 82 } |
84 void SetFunction(FunctionLiteral* literal) { | 83 void SetFunction(FunctionLiteral* literal) { |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 enum Mode { | 145 enum Mode { |
147 BASE, | 146 BASE, |
148 OPTIMIZE, | 147 OPTIMIZE, |
149 NONOPT | 148 NONOPT |
150 }; | 149 }; |
151 | 150 |
152 CompilationInfo() : function_(NULL) {} | 151 CompilationInfo() : function_(NULL) {} |
153 | 152 |
154 void Initialize(Mode mode) { | 153 void Initialize(Mode mode) { |
155 mode_ = V8::UseCrankshaft() ? mode : NONOPT; | 154 mode_ = V8::UseCrankshaft() ? mode : NONOPT; |
| 155 if (!shared_info_.is_null() && shared_info_->strict_mode()) { |
| 156 MarkAsStrict(); |
| 157 } |
156 } | 158 } |
157 | 159 |
158 void SetMode(Mode mode) { | 160 void SetMode(Mode mode) { |
159 ASSERT(V8::UseCrankshaft()); | 161 ASSERT(V8::UseCrankshaft()); |
160 mode_ = mode; | 162 mode_ = mode; |
161 } | 163 } |
162 | 164 |
163 // Flags using template class BitField<type, start, length>. All are | 165 // Flags using template class BitField<type, start, length>. All are |
164 // false by default. | 166 // false by default. |
165 // | 167 // |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 FrameElement::ClearConstantList(); | 282 FrameElement::ClearConstantList(); |
281 Result::ClearConstantList(); | 283 Result::ClearConstantList(); |
282 } | 284 } |
283 } | 285 } |
284 }; | 286 }; |
285 | 287 |
286 | 288 |
287 } } // namespace v8::internal | 289 } } // namespace v8::internal |
288 | 290 |
289 #endif // V8_COMPILER_H_ | 291 #endif // V8_COMPILER_H_ |
OLD | NEW |