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

Unified Diff: src/compiler.h

Issue 552232: Introduce a stack-allocated structure to encapsulate compile-time information. (Closed)
Patch Set: Remove inadvertently included files. Created 10 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/codegen.cc ('k') | src/compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.h
diff --git a/src/compiler.h b/src/compiler.h
index 74c7ffb1719dfa202c7478593749521d1b006f19..0661f348027ac366c79b56aec45f3e4a1a2c94e2 100644
--- a/src/compiler.h
+++ b/src/compiler.h
@@ -35,6 +35,31 @@
namespace v8 {
namespace internal {
+// CompilationInfo encapsulates some information known at compile time.
+class CompilationInfo BASE_EMBEDDED {
+ public:
+ CompilationInfo(Handle<SharedFunctionInfo> shared_info,
+ Handle<Object> receiver,
+ int loop_nesting)
+ : shared_info_(shared_info),
+ receiver_(receiver_),
+ loop_nesting_(loop_nesting) {
+ }
+
+ Handle<SharedFunctionInfo> shared_info() { return shared_info_; }
+
+ bool has_receiver() { return !receiver_.is_null(); }
+ Handle<Object> receiver() { return receiver_; }
+
+ int loop_nesting() { return loop_nesting_; }
+
+ private:
+ Handle<SharedFunctionInfo> shared_info_;
+ Handle<Object> receiver_;
+ int loop_nesting_;
+};
+
+
// The V8 compiler
//
// General strategy: Source code is translated into an anonymous function w/o
@@ -70,9 +95,7 @@ class Compiler : public AllStatic {
// Compile from function info (used for lazy compilation). Returns
// true on success and false if the compilation resulted in a stack
// overflow.
- static bool CompileLazy(Handle<SharedFunctionInfo> shared,
- Handle<Object> receiver,
- int loop_nesting);
+ static bool CompileLazy(CompilationInfo* info);
// Compile a function boilerplate object (the function is possibly
// lazily compiled). Called recursively from a backend code
« no previous file with comments | « src/codegen.cc ('k') | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698