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

Side by Side Diff: src/compiler.h

Issue 9221011: Collect AstNode type information (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: refactor to AstVisitor approach Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2012 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
11 // with the distribution. 11 // with the distribution.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_classic_mode() const { return language_mode() == CLASSIC_MODE; } 55 bool is_classic_mode() const { return language_mode() == CLASSIC_MODE; }
56 bool is_extended_mode() const { return language_mode() == EXTENDED_MODE; } 56 bool is_extended_mode() const { return language_mode() == EXTENDED_MODE; }
57 LanguageMode language_mode() const { 57 LanguageMode language_mode() const {
58 return LanguageModeField::decode(flags_); 58 return LanguageModeField::decode(flags_);
59 } 59 }
60 bool is_in_loop() const { return IsInLoop::decode(flags_); } 60 bool is_in_loop() const { return IsInLoop::decode(flags_); }
61 FunctionLiteral* function() const { return function_; } 61 FunctionLiteral* function() const { return function_; }
62 AstConstructionVisitor* ast_construction_visitor() {
63 return &ast_construction_visitor_;
64 }
62 Scope* scope() const { return scope_; } 65 Scope* scope() const { return scope_; }
63 Scope* global_scope() const { return global_scope_; } 66 Scope* global_scope() const { return global_scope_; }
64 Handle<Code> code() const { return code_; } 67 Handle<Code> code() const { return code_; }
65 Handle<JSFunction> closure() const { return closure_; } 68 Handle<JSFunction> closure() const { return closure_; }
66 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } 69 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; }
67 Handle<Script> script() const { return script_; } 70 Handle<Script> script() const { return script_; }
68 v8::Extension* extension() const { return extension_; } 71 v8::Extension* extension() const { return extension_; }
69 ScriptDataImpl* pre_parse_data() const { return pre_parse_data_; } 72 ScriptDataImpl* pre_parse_data() const { return pre_parse_data_; }
70 Handle<Context> calling_context() const { return calling_context_; } 73 Handle<Context> calling_context() const { return calling_context_; }
71 int osr_ast_id() const { return osr_ast_id_; } 74 int osr_ast_id() const { return osr_ast_id_; }
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 Handle<Script> script_; 249 Handle<Script> script_;
247 250
248 // Fields possibly needed for eager compilation, NULL by default. 251 // Fields possibly needed for eager compilation, NULL by default.
249 v8::Extension* extension_; 252 v8::Extension* extension_;
250 ScriptDataImpl* pre_parse_data_; 253 ScriptDataImpl* pre_parse_data_;
251 254
252 // The context of the caller is needed for eval code, and will be a null 255 // The context of the caller is needed for eval code, and will be a null
253 // handle otherwise. 256 // handle otherwise.
254 Handle<Context> calling_context_; 257 Handle<Context> calling_context_;
255 258
259 // AstConstructionVisitor that visits all of function_'s AST nodes.
260 AstConstructionVisitor ast_construction_visitor_;
261
256 // Compilation mode flag and whether deoptimization is allowed. 262 // Compilation mode flag and whether deoptimization is allowed.
257 Mode mode_; 263 Mode mode_;
258 int osr_ast_id_; 264 int osr_ast_id_;
259 265
260 DISALLOW_COPY_AND_ASSIGN(CompilationInfo); 266 DISALLOW_COPY_AND_ASSIGN(CompilationInfo);
261 }; 267 };
262 268
263 269
264 // The V8 compiler 270 // The V8 compiler
265 // 271 //
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 328
323 static void RecordFunctionCompilation(Logger::LogEventsAndTags tag, 329 static void RecordFunctionCompilation(Logger::LogEventsAndTags tag,
324 CompilationInfo* info, 330 CompilationInfo* info,
325 Handle<SharedFunctionInfo> shared); 331 Handle<SharedFunctionInfo> shared);
326 }; 332 };
327 333
328 334
329 } } // namespace v8::internal 335 } } // namespace v8::internal
330 336
331 #endif // V8_COMPILER_H_ 337 #endif // V8_COMPILER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698