OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 namespace v8 { | 53 namespace v8 { |
54 namespace internal { | 54 namespace internal { |
55 | 55 |
56 | 56 |
57 CompilationInfo::CompilationInfo(Handle<Script> script, | 57 CompilationInfo::CompilationInfo(Handle<Script> script, |
58 Zone* zone) | 58 Zone* zone) |
59 : flags_(LanguageModeField::encode(CLASSIC_MODE)), | 59 : flags_(LanguageModeField::encode(CLASSIC_MODE)), |
60 script_(script), | 60 script_(script), |
61 osr_ast_id_(BailoutId::None()), | 61 osr_ast_id_(BailoutId::None()), |
62 osr_pc_offset_(0) { | 62 osr_pc_offset_(0), |
| 63 parameter_count_(0) { |
63 Initialize(script->GetIsolate(), BASE, zone); | 64 Initialize(script->GetIsolate(), BASE, zone); |
64 } | 65 } |
65 | 66 |
66 | 67 |
67 CompilationInfo::CompilationInfo(Handle<SharedFunctionInfo> shared_info, | 68 CompilationInfo::CompilationInfo(Handle<SharedFunctionInfo> shared_info, |
68 Zone* zone) | 69 Zone* zone) |
69 : flags_(LanguageModeField::encode(CLASSIC_MODE) | IsLazy::encode(true)), | 70 : flags_(LanguageModeField::encode(CLASSIC_MODE) | IsLazy::encode(true)), |
70 shared_info_(shared_info), | 71 shared_info_(shared_info), |
71 script_(Handle<Script>(Script::cast(shared_info->script()))), | 72 script_(Handle<Script>(Script::cast(shared_info->script()))), |
72 osr_ast_id_(BailoutId::None()), | 73 osr_ast_id_(BailoutId::None()), |
73 osr_pc_offset_(0) { | 74 osr_pc_offset_(0), |
| 75 parameter_count_(0) { |
74 Initialize(script_->GetIsolate(), BASE, zone); | 76 Initialize(script_->GetIsolate(), BASE, zone); |
75 } | 77 } |
76 | 78 |
77 | 79 |
78 CompilationInfo::CompilationInfo(Handle<JSFunction> closure, | 80 CompilationInfo::CompilationInfo(Handle<JSFunction> closure, |
79 Zone* zone) | 81 Zone* zone) |
80 : flags_(LanguageModeField::encode(CLASSIC_MODE) | IsLazy::encode(true)), | 82 : flags_(LanguageModeField::encode(CLASSIC_MODE) | IsLazy::encode(true)), |
81 closure_(closure), | 83 closure_(closure), |
82 shared_info_(Handle<SharedFunctionInfo>(closure->shared())), | 84 shared_info_(Handle<SharedFunctionInfo>(closure->shared())), |
83 script_(Handle<Script>(Script::cast(shared_info_->script()))), | 85 script_(Handle<Script>(Script::cast(shared_info_->script()))), |
84 context_(closure->context()), | 86 context_(closure->context()), |
85 osr_ast_id_(BailoutId::None()), | 87 osr_ast_id_(BailoutId::None()), |
86 osr_pc_offset_(0) { | 88 osr_pc_offset_(0), |
| 89 parameter_count_(0) { |
87 Initialize(script_->GetIsolate(), BASE, zone); | 90 Initialize(script_->GetIsolate(), BASE, zone); |
88 } | 91 } |
89 | 92 |
90 | 93 |
91 CompilationInfo::CompilationInfo(HydrogenCodeStub* stub, | 94 CompilationInfo::CompilationInfo(HydrogenCodeStub* stub, |
92 Isolate* isolate, | 95 Isolate* isolate, |
93 Zone* zone) | 96 Zone* zone) |
94 : flags_(LanguageModeField::encode(CLASSIC_MODE) | | 97 : flags_(LanguageModeField::encode(CLASSIC_MODE) | |
95 IsLazy::encode(true)), | 98 IsLazy::encode(true)), |
96 osr_ast_id_(BailoutId::None()), | 99 osr_ast_id_(BailoutId::None()), |
97 osr_pc_offset_(0) { | 100 osr_pc_offset_(0), |
| 101 parameter_count_(0) { |
98 Initialize(isolate, STUB, zone); | 102 Initialize(isolate, STUB, zone); |
99 code_stub_ = stub; | 103 code_stub_ = stub; |
100 } | 104 } |
101 | 105 |
102 | 106 |
103 void CompilationInfo::Initialize(Isolate* isolate, | 107 void CompilationInfo::Initialize(Isolate* isolate, |
104 Mode mode, | 108 Mode mode, |
105 Zone* zone) { | 109 Zone* zone) { |
106 isolate_ = isolate; | 110 isolate_ = isolate; |
107 function_ = NULL; | 111 function_ = NULL; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 DependentCode* dependent_code = | 181 DependentCode* dependent_code = |
178 DependentCode::ForObject(group_objects->at(j), group); | 182 DependentCode::ForObject(group_objects->at(j), group); |
179 dependent_code->RemoveCompilationInfo(group, this); | 183 dependent_code->RemoveCompilationInfo(group, this); |
180 } | 184 } |
181 dependencies_[i] = NULL; // Zone-allocated, no need to delete. | 185 dependencies_[i] = NULL; // Zone-allocated, no need to delete. |
182 } | 186 } |
183 } | 187 } |
184 | 188 |
185 | 189 |
186 int CompilationInfo::num_parameters() const { | 190 int CompilationInfo::num_parameters() const { |
187 ASSERT(!IsStub()); | 191 if (IsStub()) { |
188 return scope()->num_parameters(); | 192 ASSERT(parameter_count_ > 0); |
| 193 return parameter_count_; |
| 194 } else { |
| 195 return scope()->num_parameters(); |
| 196 } |
189 } | 197 } |
190 | 198 |
191 | 199 |
192 int CompilationInfo::num_heap_slots() const { | 200 int CompilationInfo::num_heap_slots() const { |
193 if (IsStub()) { | 201 if (IsStub()) { |
194 return 0; | 202 return 0; |
195 } else { | 203 } else { |
196 return scope()->num_heap_slots(); | 204 return scope()->num_heap_slots(); |
197 } | 205 } |
198 } | 206 } |
(...skipping 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1353 AllowHandleDereference allow_deref; | 1361 AllowHandleDereference allow_deref; |
1354 bool tracing_on = info()->IsStub() | 1362 bool tracing_on = info()->IsStub() |
1355 ? FLAG_trace_hydrogen_stubs | 1363 ? FLAG_trace_hydrogen_stubs |
1356 : (FLAG_trace_hydrogen && | 1364 : (FLAG_trace_hydrogen && |
1357 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); | 1365 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); |
1358 return (tracing_on && | 1366 return (tracing_on && |
1359 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1367 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
1360 } | 1368 } |
1361 | 1369 |
1362 } } // namespace v8::internal | 1370 } } // namespace v8::internal |
OLD | NEW |