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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 | 46 |
47 CompilationInfo::CompilationInfo(Handle<Script> script, Zone* zone) | 47 CompilationInfo::CompilationInfo(Handle<Script> script, Zone* zone) |
48 : flags_(kThisHasUses), | 48 : flags_(kThisHasUses), |
49 script_(script), | 49 script_(script), |
50 source_stream_(NULL), | 50 source_stream_(NULL), |
51 osr_ast_id_(BailoutId::None()), | 51 osr_ast_id_(BailoutId::None()), |
52 parameter_count_(0), | 52 parameter_count_(0), |
53 optimization_id_(-1), | 53 optimization_id_(-1), |
54 ast_value_factory_(NULL), | 54 ast_value_factory_(NULL), |
55 ast_value_factory_owned_(false) { | 55 ast_value_factory_owned_(false), |
| 56 aborted_due_to_dependency_change_(false) { |
56 Initialize(script->GetIsolate(), BASE, zone); | 57 Initialize(script->GetIsolate(), BASE, zone); |
57 } | 58 } |
58 | 59 |
59 | 60 |
60 CompilationInfo::CompilationInfo(Isolate* isolate, Zone* zone) | 61 CompilationInfo::CompilationInfo(Isolate* isolate, Zone* zone) |
61 : flags_(kThisHasUses), | 62 : flags_(kThisHasUses), |
62 script_(Handle<Script>::null()), | 63 script_(Handle<Script>::null()), |
63 source_stream_(NULL), | 64 source_stream_(NULL), |
64 osr_ast_id_(BailoutId::None()), | 65 osr_ast_id_(BailoutId::None()), |
65 parameter_count_(0), | 66 parameter_count_(0), |
66 optimization_id_(-1), | 67 optimization_id_(-1), |
67 ast_value_factory_(NULL), | 68 ast_value_factory_(NULL), |
68 ast_value_factory_owned_(false) { | 69 ast_value_factory_owned_(false), |
| 70 aborted_due_to_dependency_change_(false) { |
69 Initialize(isolate, STUB, zone); | 71 Initialize(isolate, STUB, zone); |
70 } | 72 } |
71 | 73 |
72 | 74 |
73 CompilationInfo::CompilationInfo(Handle<SharedFunctionInfo> shared_info, | 75 CompilationInfo::CompilationInfo(Handle<SharedFunctionInfo> shared_info, |
74 Zone* zone) | 76 Zone* zone) |
75 : flags_(kLazy | kThisHasUses), | 77 : flags_(kLazy | kThisHasUses), |
76 shared_info_(shared_info), | 78 shared_info_(shared_info), |
77 script_(Handle<Script>(Script::cast(shared_info->script()))), | 79 script_(Handle<Script>(Script::cast(shared_info->script()))), |
78 source_stream_(NULL), | 80 source_stream_(NULL), |
79 osr_ast_id_(BailoutId::None()), | 81 osr_ast_id_(BailoutId::None()), |
80 parameter_count_(0), | 82 parameter_count_(0), |
81 optimization_id_(-1), | 83 optimization_id_(-1), |
82 ast_value_factory_(NULL), | 84 ast_value_factory_(NULL), |
83 ast_value_factory_owned_(false) { | 85 ast_value_factory_owned_(false), |
| 86 aborted_due_to_dependency_change_(false) { |
84 Initialize(script_->GetIsolate(), BASE, zone); | 87 Initialize(script_->GetIsolate(), BASE, zone); |
85 } | 88 } |
86 | 89 |
87 | 90 |
88 CompilationInfo::CompilationInfo(Handle<JSFunction> closure, Zone* zone) | 91 CompilationInfo::CompilationInfo(Handle<JSFunction> closure, Zone* zone) |
89 : flags_(kLazy | kThisHasUses), | 92 : flags_(kLazy | kThisHasUses), |
90 closure_(closure), | 93 closure_(closure), |
91 shared_info_(Handle<SharedFunctionInfo>(closure->shared())), | 94 shared_info_(Handle<SharedFunctionInfo>(closure->shared())), |
92 script_(Handle<Script>(Script::cast(shared_info_->script()))), | 95 script_(Handle<Script>(Script::cast(shared_info_->script()))), |
93 source_stream_(NULL), | 96 source_stream_(NULL), |
94 context_(closure->context()), | 97 context_(closure->context()), |
95 osr_ast_id_(BailoutId::None()), | 98 osr_ast_id_(BailoutId::None()), |
96 parameter_count_(0), | 99 parameter_count_(0), |
97 optimization_id_(-1), | 100 optimization_id_(-1), |
98 ast_value_factory_(NULL), | 101 ast_value_factory_(NULL), |
99 ast_value_factory_owned_(false) { | 102 ast_value_factory_owned_(false), |
| 103 aborted_due_to_dependency_change_(false) { |
100 Initialize(script_->GetIsolate(), BASE, zone); | 104 Initialize(script_->GetIsolate(), BASE, zone); |
101 } | 105 } |
102 | 106 |
103 | 107 |
104 CompilationInfo::CompilationInfo(HydrogenCodeStub* stub, Isolate* isolate, | 108 CompilationInfo::CompilationInfo(HydrogenCodeStub* stub, Isolate* isolate, |
105 Zone* zone) | 109 Zone* zone) |
106 : flags_(kLazy | kThisHasUses), | 110 : flags_(kLazy | kThisHasUses), |
107 source_stream_(NULL), | 111 source_stream_(NULL), |
108 osr_ast_id_(BailoutId::None()), | 112 osr_ast_id_(BailoutId::None()), |
109 parameter_count_(0), | 113 parameter_count_(0), |
110 optimization_id_(-1), | 114 optimization_id_(-1), |
111 ast_value_factory_(NULL), | 115 ast_value_factory_(NULL), |
112 ast_value_factory_owned_(false) { | 116 ast_value_factory_owned_(false), |
| 117 aborted_due_to_dependency_change_(false) { |
113 Initialize(isolate, STUB, zone); | 118 Initialize(isolate, STUB, zone); |
114 code_stub_ = stub; | 119 code_stub_ = stub; |
115 } | 120 } |
116 | 121 |
117 | 122 |
118 CompilationInfo::CompilationInfo( | 123 CompilationInfo::CompilationInfo( |
119 ScriptCompiler::ExternalSourceStream* stream, | 124 ScriptCompiler::ExternalSourceStream* stream, |
120 ScriptCompiler::StreamedSource::Encoding encoding, Isolate* isolate, | 125 ScriptCompiler::StreamedSource::Encoding encoding, Isolate* isolate, |
121 Zone* zone) | 126 Zone* zone) |
122 : flags_(kThisHasUses), | 127 : flags_(kThisHasUses), |
123 source_stream_(stream), | 128 source_stream_(stream), |
124 source_stream_encoding_(encoding), | 129 source_stream_encoding_(encoding), |
125 osr_ast_id_(BailoutId::None()), | 130 osr_ast_id_(BailoutId::None()), |
126 parameter_count_(0), | 131 parameter_count_(0), |
127 optimization_id_(-1), | 132 optimization_id_(-1), |
128 ast_value_factory_(NULL), | 133 ast_value_factory_(NULL), |
129 ast_value_factory_owned_(false) { | 134 ast_value_factory_owned_(false), |
| 135 aborted_due_to_dependency_change_(false) { |
130 Initialize(isolate, BASE, zone); | 136 Initialize(isolate, BASE, zone); |
131 } | 137 } |
132 | 138 |
133 | 139 |
134 void CompilationInfo::Initialize(Isolate* isolate, | 140 void CompilationInfo::Initialize(Isolate* isolate, |
135 Mode mode, | 141 Mode mode, |
136 Zone* zone) { | 142 Zone* zone) { |
137 isolate_ = isolate; | 143 isolate_ = isolate; |
138 function_ = NULL; | 144 function_ = NULL; |
139 scope_ = NULL; | 145 scope_ = NULL; |
(...skipping 1292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1432 AllowHandleDereference allow_deref; | 1438 AllowHandleDereference allow_deref; |
1433 bool tracing_on = info()->IsStub() | 1439 bool tracing_on = info()->IsStub() |
1434 ? FLAG_trace_hydrogen_stubs | 1440 ? FLAG_trace_hydrogen_stubs |
1435 : (FLAG_trace_hydrogen && | 1441 : (FLAG_trace_hydrogen && |
1436 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); | 1442 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); |
1437 return (tracing_on && | 1443 return (tracing_on && |
1438 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1444 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
1439 } | 1445 } |
1440 | 1446 |
1441 } } // namespace v8::internal | 1447 } } // namespace v8::internal |
OLD | NEW |