OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/compiler/pipeline.h" | 5 #include "src/compiler/pipeline.h" |
6 | 6 |
7 #include <fstream> // NOLINT(readability/streams) | 7 #include <fstream> // NOLINT(readability/streams) |
8 #include <sstream> | 8 #include <sstream> |
9 | 9 |
10 #include "src/base/adapters.h" | 10 #include "src/base/adapters.h" |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 InstructionSequence::InstructionBlocksFor(instruction_zone(), | 273 InstructionSequence::InstructionBlocksFor(instruction_zone(), |
274 schedule()); | 274 schedule()); |
275 sequence_ = new (instruction_zone()) InstructionSequence( | 275 sequence_ = new (instruction_zone()) InstructionSequence( |
276 info()->isolate(), instruction_zone(), instruction_blocks); | 276 info()->isolate(), instruction_zone(), instruction_blocks); |
277 } | 277 } |
278 | 278 |
279 void InitializeFrameData(CallDescriptor* descriptor) { | 279 void InitializeFrameData(CallDescriptor* descriptor) { |
280 DCHECK(frame_ == nullptr); | 280 DCHECK(frame_ == nullptr); |
281 int fixed_frame_size = 0; | 281 int fixed_frame_size = 0; |
282 if (descriptor != nullptr) { | 282 if (descriptor != nullptr) { |
283 fixed_frame_size = (descriptor->IsCFunctionCall()) | 283 fixed_frame_size = CalculateFixedFrameSize(descriptor); |
284 ? StandardFrameConstants::kFixedSlotCountAboveFp + | |
285 StandardFrameConstants::kCPSlotCount | |
286 : StandardFrameConstants::kFixedSlotCount; | |
287 } | 284 } |
288 frame_ = new (instruction_zone()) Frame(fixed_frame_size, descriptor); | 285 frame_ = new (instruction_zone()) Frame(fixed_frame_size, descriptor); |
289 } | 286 } |
290 | 287 |
291 void InitializeRegisterAllocationData(const RegisterConfiguration* config, | 288 void InitializeRegisterAllocationData(const RegisterConfiguration* config, |
292 CallDescriptor* descriptor, | 289 CallDescriptor* descriptor, |
293 const char* debug_name) { | 290 const char* debug_name) { |
294 DCHECK(register_allocation_data_ == nullptr); | 291 DCHECK(register_allocation_data_ == nullptr); |
295 register_allocation_data_ = new (register_allocation_zone()) | 292 register_allocation_data_ = new (register_allocation_zone()) |
296 RegisterAllocationData(config, register_allocation_zone(), frame(), | 293 RegisterAllocationData(config, register_allocation_zone(), frame(), |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 InstructionSequence* sequence_; | 328 InstructionSequence* sequence_; |
332 Frame* frame_; | 329 Frame* frame_; |
333 | 330 |
334 // All objects in the following group of fields are allocated in | 331 // All objects in the following group of fields are allocated in |
335 // register_allocation_zone_. They are all set to nullptr when the zone is | 332 // register_allocation_zone_. They are all set to nullptr when the zone is |
336 // destroyed. | 333 // destroyed. |
337 ZonePool::Scope register_allocation_zone_scope_; | 334 ZonePool::Scope register_allocation_zone_scope_; |
338 Zone* register_allocation_zone_; | 335 Zone* register_allocation_zone_; |
339 RegisterAllocationData* register_allocation_data_; | 336 RegisterAllocationData* register_allocation_data_; |
340 | 337 |
| 338 int CalculateFixedFrameSize(CallDescriptor* descriptor) { |
| 339 if (descriptor->IsJSFunctionCall()) { |
| 340 return StandardFrameConstants::kFixedSlotCount; |
| 341 } |
| 342 return descriptor->IsCFunctionCall() |
| 343 ? (CommonFrameConstants::kFixedSlotCountAboveFp + |
| 344 CommonFrameConstants::kCPSlotCount) |
| 345 : TypedFrameConstants::kFixedSlotCount; |
| 346 } |
| 347 |
341 DISALLOW_COPY_AND_ASSIGN(PipelineData); | 348 DISALLOW_COPY_AND_ASSIGN(PipelineData); |
342 }; | 349 }; |
343 | 350 |
344 | 351 |
345 namespace { | 352 namespace { |
346 | 353 |
347 struct TurboCfgFile : public std::ofstream { | 354 struct TurboCfgFile : public std::ofstream { |
348 explicit TurboCfgFile(Isolate* isolate) | 355 explicit TurboCfgFile(Isolate* isolate) |
349 : std::ofstream(isolate->GetTurboCfgFileName().c_str(), | 356 : std::ofstream(isolate->GetTurboCfgFileName().c_str(), |
350 std::ios_base::app) {} | 357 std::ios_base::app) {} |
(...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1512 } | 1519 } |
1513 | 1520 |
1514 data->DeleteRegisterAllocationZone(); | 1521 data->DeleteRegisterAllocationZone(); |
1515 } | 1522 } |
1516 | 1523 |
1517 Isolate* Pipeline::isolate() const { return info()->isolate(); } | 1524 Isolate* Pipeline::isolate() const { return info()->isolate(); } |
1518 | 1525 |
1519 } // namespace compiler | 1526 } // namespace compiler |
1520 } // namespace internal | 1527 } // namespace internal |
1521 } // namespace v8 | 1528 } // namespace v8 |
OLD | NEW |