| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
| 8 | 8 |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 namespace internal { | 31 namespace internal { |
| 32 | 32 |
| 33 | 33 |
| 34 CompilationInfo::CompilationInfo(Handle<Script> script, | 34 CompilationInfo::CompilationInfo(Handle<Script> script, |
| 35 Zone* zone) | 35 Zone* zone) |
| 36 : flags_(StrictModeField::encode(SLOPPY)), | 36 : flags_(StrictModeField::encode(SLOPPY)), |
| 37 script_(script), | 37 script_(script), |
| 38 osr_ast_id_(BailoutId::None()), | 38 osr_ast_id_(BailoutId::None()), |
| 39 parameter_count_(0), | 39 parameter_count_(0), |
| 40 this_has_uses_(true), | 40 this_has_uses_(true), |
| 41 optimization_id_(-1), | 41 optimization_id_(-1) { |
| 42 ast_value_factory_(NULL), | |
| 43 ast_value_factory_owned_(false) { | |
| 44 Initialize(script->GetIsolate(), BASE, zone); | 42 Initialize(script->GetIsolate(), BASE, zone); |
| 45 } | 43 } |
| 46 | 44 |
| 47 | 45 |
| 48 CompilationInfo::CompilationInfo(Handle<SharedFunctionInfo> shared_info, | 46 CompilationInfo::CompilationInfo(Handle<SharedFunctionInfo> shared_info, |
| 49 Zone* zone) | 47 Zone* zone) |
| 50 : flags_(StrictModeField::encode(SLOPPY) | IsLazy::encode(true)), | 48 : flags_(StrictModeField::encode(SLOPPY) | IsLazy::encode(true)), |
| 51 shared_info_(shared_info), | 49 shared_info_(shared_info), |
| 52 script_(Handle<Script>(Script::cast(shared_info->script()))), | 50 script_(Handle<Script>(Script::cast(shared_info->script()))), |
| 53 osr_ast_id_(BailoutId::None()), | 51 osr_ast_id_(BailoutId::None()), |
| 54 parameter_count_(0), | 52 parameter_count_(0), |
| 55 this_has_uses_(true), | 53 this_has_uses_(true), |
| 56 optimization_id_(-1), | 54 optimization_id_(-1) { |
| 57 ast_value_factory_(NULL), | |
| 58 ast_value_factory_owned_(false) { | |
| 59 Initialize(script_->GetIsolate(), BASE, zone); | 55 Initialize(script_->GetIsolate(), BASE, zone); |
| 60 } | 56 } |
| 61 | 57 |
| 62 | 58 |
| 63 CompilationInfo::CompilationInfo(Handle<JSFunction> closure, | 59 CompilationInfo::CompilationInfo(Handle<JSFunction> closure, |
| 64 Zone* zone) | 60 Zone* zone) |
| 65 : flags_(StrictModeField::encode(SLOPPY) | IsLazy::encode(true)), | 61 : flags_(StrictModeField::encode(SLOPPY) | IsLazy::encode(true)), |
| 66 closure_(closure), | 62 closure_(closure), |
| 67 shared_info_(Handle<SharedFunctionInfo>(closure->shared())), | 63 shared_info_(Handle<SharedFunctionInfo>(closure->shared())), |
| 68 script_(Handle<Script>(Script::cast(shared_info_->script()))), | 64 script_(Handle<Script>(Script::cast(shared_info_->script()))), |
| 69 context_(closure->context()), | 65 context_(closure->context()), |
| 70 osr_ast_id_(BailoutId::None()), | 66 osr_ast_id_(BailoutId::None()), |
| 71 parameter_count_(0), | 67 parameter_count_(0), |
| 72 this_has_uses_(true), | 68 this_has_uses_(true), |
| 73 optimization_id_(-1), | 69 optimization_id_(-1) { |
| 74 ast_value_factory_(NULL), | |
| 75 ast_value_factory_owned_(false) { | |
| 76 Initialize(script_->GetIsolate(), BASE, zone); | 70 Initialize(script_->GetIsolate(), BASE, zone); |
| 77 } | 71 } |
| 78 | 72 |
| 79 | 73 |
| 80 CompilationInfo::CompilationInfo(HydrogenCodeStub* stub, | 74 CompilationInfo::CompilationInfo(HydrogenCodeStub* stub, |
| 81 Isolate* isolate, | 75 Isolate* isolate, |
| 82 Zone* zone) | 76 Zone* zone) |
| 83 : flags_(StrictModeField::encode(SLOPPY) | IsLazy::encode(true)), | 77 : flags_(StrictModeField::encode(SLOPPY) | IsLazy::encode(true)), |
| 84 osr_ast_id_(BailoutId::None()), | 78 osr_ast_id_(BailoutId::None()), |
| 85 parameter_count_(0), | 79 parameter_count_(0), |
| 86 this_has_uses_(true), | 80 this_has_uses_(true), |
| 87 optimization_id_(-1), | 81 optimization_id_(-1) { |
| 88 ast_value_factory_(NULL), | |
| 89 ast_value_factory_owned_(false) { | |
| 90 Initialize(isolate, STUB, zone); | 82 Initialize(isolate, STUB, zone); |
| 91 code_stub_ = stub; | 83 code_stub_ = stub; |
| 92 } | 84 } |
| 93 | 85 |
| 94 | 86 |
| 95 void CompilationInfo::Initialize(Isolate* isolate, | 87 void CompilationInfo::Initialize(Isolate* isolate, |
| 96 Mode mode, | 88 Mode mode, |
| 97 Zone* zone) { | 89 Zone* zone) { |
| 98 isolate_ = isolate; | 90 isolate_ = isolate; |
| 99 function_ = NULL; | 91 function_ = NULL; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 // passed in shared info, rather than creating a new one. | 124 // passed in shared info, rather than creating a new one. |
| 133 feedback_vector_ = Handle<FixedArray>(shared_info()->feedback_vector(), | 125 feedback_vector_ = Handle<FixedArray>(shared_info()->feedback_vector(), |
| 134 isolate); | 126 isolate); |
| 135 } | 127 } |
| 136 } | 128 } |
| 137 | 129 |
| 138 | 130 |
| 139 CompilationInfo::~CompilationInfo() { | 131 CompilationInfo::~CompilationInfo() { |
| 140 delete deferred_handles_; | 132 delete deferred_handles_; |
| 141 delete no_frame_ranges_; | 133 delete no_frame_ranges_; |
| 142 if (ast_value_factory_owned_) delete ast_value_factory_; | |
| 143 #ifdef DEBUG | 134 #ifdef DEBUG |
| 144 // Check that no dependent maps have been added or added dependent maps have | 135 // Check that no dependent maps have been added or added dependent maps have |
| 145 // been rolled back or committed. | 136 // been rolled back or committed. |
| 146 for (int i = 0; i < DependentCode::kGroupCount; i++) { | 137 for (int i = 0; i < DependentCode::kGroupCount; i++) { |
| 147 ASSERT_EQ(NULL, dependencies_[i]); | 138 ASSERT_EQ(NULL, dependencies_[i]); |
| 148 } | 139 } |
| 149 #endif // DEBUG | 140 #endif // DEBUG |
| 150 } | 141 } |
| 151 | 142 |
| 152 | 143 |
| (...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1305 AllowHandleDereference allow_deref; | 1296 AllowHandleDereference allow_deref; |
| 1306 bool tracing_on = info()->IsStub() | 1297 bool tracing_on = info()->IsStub() |
| 1307 ? FLAG_trace_hydrogen_stubs | 1298 ? FLAG_trace_hydrogen_stubs |
| 1308 : (FLAG_trace_hydrogen && | 1299 : (FLAG_trace_hydrogen && |
| 1309 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); | 1300 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); |
| 1310 return (tracing_on && | 1301 return (tracing_on && |
| 1311 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1302 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
| 1312 } | 1303 } |
| 1313 | 1304 |
| 1314 } } // namespace v8::internal | 1305 } } // namespace v8::internal |
| OLD | NEW |