| Index: src/compiler.h
|
| diff --git a/src/compiler.h b/src/compiler.h
|
| index af9459566dd06f862e38a7837d4c60ab4d62fabc..72030f1443c3a17f11d42b64e8238abd745b90b9 100644
|
| --- a/src/compiler.h
|
| +++ b/src/compiler.h
|
| @@ -44,6 +44,7 @@ class CompilationInfo {
|
| CompilationInfo(Handle<Script> script, Zone* zone);
|
| CompilationInfo(Handle<SharedFunctionInfo> shared_info, Zone* zone);
|
| CompilationInfo(Handle<JSFunction> closure, Zone* zone);
|
| + CompilationInfo(Isolate* isolate, Zone* zone);
|
|
|
| virtual ~CompilationInfo();
|
|
|
| @@ -74,6 +75,9 @@ class CompilationInfo {
|
| ScriptDataImpl* pre_parse_data() const { return pre_parse_data_; }
|
| Handle<Context> context() const { return context_; }
|
| BailoutId osr_ast_id() const { return osr_ast_id_; }
|
| + int num_parameters() const;
|
| + int num_heap_slots() const;
|
| + Code::Flags flags() const;
|
|
|
| void MarkAsEval() {
|
| ASSERT(!is_lazy());
|
| @@ -96,9 +100,31 @@ class CompilationInfo {
|
| void MarkAsNative() {
|
| flags_ |= IsNative::encode(true);
|
| }
|
| +
|
| bool is_native() const {
|
| return IsNative::decode(flags_);
|
| }
|
| +
|
| + bool is_calling() const {
|
| + return is_deferred_calling() || is_non_deferred_calling();
|
| + }
|
| +
|
| + void MarkAsDeferredCalling() {
|
| + flags_ |= IsDeferredCalling::encode(true);
|
| + }
|
| +
|
| + bool is_deferred_calling() const {
|
| + return IsDeferredCalling::decode(flags_);
|
| + }
|
| +
|
| + void MarkAsNonDeferredCalling() {
|
| + flags_ |= IsNonDeferredCalling::encode(true);
|
| + }
|
| +
|
| + bool is_non_deferred_calling() const {
|
| + return IsNonDeferredCalling::decode(flags_);
|
| + }
|
| +
|
| void SetFunction(FunctionLiteral* literal) {
|
| ASSERT(function_ == NULL);
|
| function_ = literal;
|
| @@ -149,6 +175,7 @@ class CompilationInfo {
|
| // Accessors for the different compilation modes.
|
| bool IsOptimizing() const { return mode_ == OPTIMIZE; }
|
| bool IsOptimizable() const { return mode_ == BASE; }
|
| + bool IsStub() const { return mode_ == STUB; }
|
| void SetOptimizing(BailoutId osr_ast_id) {
|
| SetMode(OPTIMIZE);
|
| osr_ast_id_ = osr_ast_id;
|
| @@ -197,10 +224,15 @@ class CompilationInfo {
|
| enum Mode {
|
| BASE,
|
| OPTIMIZE,
|
| - NONOPT
|
| + NONOPT,
|
| + STUB
|
| };
|
|
|
| void Initialize(Mode mode) {
|
| + if (mode == STUB) {
|
| + mode_ = STUB;
|
| + return;
|
| + }
|
| mode_ = V8::UseCrankshaft() ? mode : NONOPT;
|
| ASSERT(!script_.is_null());
|
| if (script_->type()->value() == Script::TYPE_NATIVE) {
|
| @@ -237,6 +269,12 @@ class CompilationInfo {
|
| // If compiling for debugging produce just full code matching the
|
| // initial mode setting.
|
| class IsCompilingForDebugging: public BitField<bool, 8, 1> {};
|
| + // If the compiled code contains calls that require building a frame
|
| + class IsCalling: public BitField<bool, 9, 1> {};
|
| + // If the compiled code contains calls that require building a frame
|
| + class IsDeferredCalling: public BitField<bool, 10, 1> {};
|
| + // If the compiled code contains calls that require building a frame
|
| + class IsNonDeferredCalling: public BitField<bool, 11, 1> {};
|
|
|
|
|
| unsigned flags_;
|
| @@ -305,6 +343,10 @@ class CompilationInfoWithZone: public CompilationInfo {
|
| : CompilationInfo(closure, &zone_),
|
| zone_(closure->GetIsolate()),
|
| zone_scope_(&zone_, DELETE_ON_EXIT) {}
|
| + explicit CompilationInfoWithZone(Isolate* isolate)
|
| + : CompilationInfo(isolate, &zone_),
|
| + zone_(isolate),
|
| + zone_scope_(&zone_, DELETE_ON_EXIT) {}
|
|
|
| private:
|
| Zone zone_;
|
|
|