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 |