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

Side by Side Diff: src/compiler.h

Issue 6677076: Merge up to bleeding_edge r7201 to isolates branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/isolates
Patch Set: Fix lint. Created 9 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « src/code-stubs.h ('k') | src/compiler.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 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 void MarkAsStrict() { 77 void MarkAsStrict() {
78 flags_ |= IsStrict::encode(true); 78 flags_ |= IsStrict::encode(true);
79 } 79 }
80 StrictModeFlag StrictMode() { 80 StrictModeFlag StrictMode() {
81 return is_strict() ? kStrictMode : kNonStrictMode; 81 return is_strict() ? kStrictMode : kNonStrictMode;
82 } 82 }
83 void MarkAsInLoop() { 83 void MarkAsInLoop() {
84 ASSERT(is_lazy()); 84 ASSERT(is_lazy());
85 flags_ |= IsInLoop::encode(true); 85 flags_ |= IsInLoop::encode(true);
86 } 86 }
87 void MarkAsAllowingNativesSyntax() {
88 flags_ |= IsNativesSyntaxAllowed::encode(true);
89 }
90 bool allows_natives_syntax() const {
91 return IsNativesSyntaxAllowed::decode(flags_);
92 }
87 void SetFunction(FunctionLiteral* literal) { 93 void SetFunction(FunctionLiteral* literal) {
88 ASSERT(function_ == NULL); 94 ASSERT(function_ == NULL);
89 function_ = literal; 95 function_ = literal;
90 } 96 }
91 void SetScope(Scope* scope) { 97 void SetScope(Scope* scope) {
92 ASSERT(scope_ == NULL); 98 ASSERT(scope_ == NULL);
93 scope_ = scope; 99 scope_ = scope;
94 } 100 }
95 void SetCode(Handle<Code> code) { code_ = code; } 101 void SetCode(Handle<Code> code) { code_ = code; }
96 void SetExtension(v8::Extension* extension) { 102 void SetExtension(v8::Extension* extension) {
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 // 179 //
174 // Compilation is either eager or lazy. 180 // Compilation is either eager or lazy.
175 class IsLazy: public BitField<bool, 0, 1> {}; 181 class IsLazy: public BitField<bool, 0, 1> {};
176 // Flags that can be set for eager compilation. 182 // Flags that can be set for eager compilation.
177 class IsEval: public BitField<bool, 1, 1> {}; 183 class IsEval: public BitField<bool, 1, 1> {};
178 class IsGlobal: public BitField<bool, 2, 1> {}; 184 class IsGlobal: public BitField<bool, 2, 1> {};
179 // Flags that can be set for lazy compilation. 185 // Flags that can be set for lazy compilation.
180 class IsInLoop: public BitField<bool, 3, 1> {}; 186 class IsInLoop: public BitField<bool, 3, 1> {};
181 // Strict mode - used in eager compilation. 187 // Strict mode - used in eager compilation.
182 class IsStrict: public BitField<bool, 4, 1> {}; 188 class IsStrict: public BitField<bool, 4, 1> {};
189 // Native syntax (%-stuff) allowed?
190 class IsNativesSyntaxAllowed: public BitField<bool, 5, 1> {};
183 191
184 unsigned flags_; 192 unsigned flags_;
185 193
186 // Fields filled in by the compilation pipeline. 194 // Fields filled in by the compilation pipeline.
187 // AST filled in by the parser. 195 // AST filled in by the parser.
188 FunctionLiteral* function_; 196 FunctionLiteral* function_;
189 // The scope of the function literal as a convenience. Set to indicate 197 // The scope of the function literal as a convenience. Set to indicate
190 // that scopes have been analyzed. 198 // that scopes have been analyzed.
191 Scope* scope_; 199 Scope* scope_;
192 // The compiled code. 200 // The compiled code.
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 isolate->frame_element_constant_list()->Clear(); 296 isolate->frame_element_constant_list()->Clear();
289 isolate->result_constant_list()->Clear(); 297 isolate->result_constant_list()->Clear();
290 } 298 }
291 } 299 }
292 }; 300 };
293 301
294 302
295 } } // namespace v8::internal 303 } } // namespace v8::internal
296 304
297 #endif // V8_COMPILER_H_ 305 #endif // V8_COMPILER_H_
OLDNEW
« no previous file with comments | « src/code-stubs.h ('k') | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698