OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 bool is_lazy() const { return IsLazy::decode(flags_); } | 52 bool is_lazy() const { return IsLazy::decode(flags_); } |
53 bool is_eval() const { return IsEval::decode(flags_); } | 53 bool is_eval() const { return IsEval::decode(flags_); } |
54 bool is_global() const { return IsGlobal::decode(flags_); } | 54 bool is_global() const { return IsGlobal::decode(flags_); } |
55 bool is_strict_mode() const { return strict_mode_flag() == kStrictMode; } | 55 bool is_strict_mode() const { return strict_mode_flag() == kStrictMode; } |
56 StrictModeFlag strict_mode_flag() const { | 56 StrictModeFlag strict_mode_flag() const { |
57 return StrictModeFlagField::decode(flags_); | 57 return StrictModeFlagField::decode(flags_); |
58 } | 58 } |
59 bool is_in_loop() const { return IsInLoop::decode(flags_); } | 59 bool is_in_loop() const { return IsInLoop::decode(flags_); } |
60 FunctionLiteral* function() const { return function_; } | 60 FunctionLiteral* function() const { return function_; } |
61 Scope* scope() const { return scope_; } | 61 Scope* scope() const { return scope_; } |
| 62 Scope* global_scope() const { return global_scope_; } |
62 Handle<Code> code() const { return code_; } | 63 Handle<Code> code() const { return code_; } |
63 Handle<JSFunction> closure() const { return closure_; } | 64 Handle<JSFunction> closure() const { return closure_; } |
64 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } | 65 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } |
65 Handle<Script> script() const { return script_; } | 66 Handle<Script> script() const { return script_; } |
66 v8::Extension* extension() const { return extension_; } | 67 v8::Extension* extension() const { return extension_; } |
67 ScriptDataImpl* pre_parse_data() const { return pre_parse_data_; } | 68 ScriptDataImpl* pre_parse_data() const { return pre_parse_data_; } |
68 Handle<Context> calling_context() const { return calling_context_; } | 69 Handle<Context> calling_context() const { return calling_context_; } |
69 int osr_ast_id() const { return osr_ast_id_; } | 70 int osr_ast_id() const { return osr_ast_id_; } |
70 | 71 |
71 void MarkAsEval() { | 72 void MarkAsEval() { |
(...skipping 20 matching lines...) Expand all Loading... |
92 return IsNative::decode(flags_); | 93 return IsNative::decode(flags_); |
93 } | 94 } |
94 void SetFunction(FunctionLiteral* literal) { | 95 void SetFunction(FunctionLiteral* literal) { |
95 ASSERT(function_ == NULL); | 96 ASSERT(function_ == NULL); |
96 function_ = literal; | 97 function_ = literal; |
97 } | 98 } |
98 void SetScope(Scope* scope) { | 99 void SetScope(Scope* scope) { |
99 ASSERT(scope_ == NULL); | 100 ASSERT(scope_ == NULL); |
100 scope_ = scope; | 101 scope_ = scope; |
101 } | 102 } |
| 103 void SetGlobalScope(Scope* global_scope) { |
| 104 ASSERT(global_scope_ == NULL); |
| 105 global_scope_ = global_scope; |
| 106 } |
102 void SetCode(Handle<Code> code) { code_ = code; } | 107 void SetCode(Handle<Code> code) { code_ = code; } |
103 void SetExtension(v8::Extension* extension) { | 108 void SetExtension(v8::Extension* extension) { |
104 ASSERT(!is_lazy()); | 109 ASSERT(!is_lazy()); |
105 extension_ = extension; | 110 extension_ = extension; |
106 } | 111 } |
107 void SetPreParseData(ScriptDataImpl* pre_parse_data) { | 112 void SetPreParseData(ScriptDataImpl* pre_parse_data) { |
108 ASSERT(!is_lazy()); | 113 ASSERT(!is_lazy()); |
109 pre_parse_data_ = pre_parse_data; | 114 pre_parse_data_ = pre_parse_data; |
110 } | 115 } |
111 void SetCallingContext(Handle<Context> context) { | 116 void SetCallingContext(Handle<Context> context) { |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 | 226 |
222 | 227 |
223 unsigned flags_; | 228 unsigned flags_; |
224 | 229 |
225 // Fields filled in by the compilation pipeline. | 230 // Fields filled in by the compilation pipeline. |
226 // AST filled in by the parser. | 231 // AST filled in by the parser. |
227 FunctionLiteral* function_; | 232 FunctionLiteral* function_; |
228 // The scope of the function literal as a convenience. Set to indicate | 233 // The scope of the function literal as a convenience. Set to indicate |
229 // that scopes have been analyzed. | 234 // that scopes have been analyzed. |
230 Scope* scope_; | 235 Scope* scope_; |
| 236 // The global scope provided as a convenience. |
| 237 Scope* global_scope_; |
231 // The compiled code. | 238 // The compiled code. |
232 Handle<Code> code_; | 239 Handle<Code> code_; |
233 | 240 |
234 // Possible initial inputs to the compilation process. | 241 // Possible initial inputs to the compilation process. |
235 Handle<JSFunction> closure_; | 242 Handle<JSFunction> closure_; |
236 Handle<SharedFunctionInfo> shared_info_; | 243 Handle<SharedFunctionInfo> shared_info_; |
237 Handle<Script> script_; | 244 Handle<Script> script_; |
238 | 245 |
239 // Fields possibly needed for eager compilation, NULL by default. | 246 // Fields possibly needed for eager compilation, NULL by default. |
240 v8::Extension* extension_; | 247 v8::Extension* extension_; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 | 320 |
314 static void RecordFunctionCompilation(Logger::LogEventsAndTags tag, | 321 static void RecordFunctionCompilation(Logger::LogEventsAndTags tag, |
315 CompilationInfo* info, | 322 CompilationInfo* info, |
316 Handle<SharedFunctionInfo> shared); | 323 Handle<SharedFunctionInfo> shared); |
317 }; | 324 }; |
318 | 325 |
319 | 326 |
320 } } // namespace v8::internal | 327 } } // namespace v8::internal |
321 | 328 |
322 #endif // V8_COMPILER_H_ | 329 #endif // V8_COMPILER_H_ |
OLD | NEW |