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 27 matching lines...) Expand all Loading... | |
38 | 38 |
39 namespace v8 { | 39 namespace v8 { |
40 namespace internal { | 40 namespace internal { |
41 | 41 |
42 // Forward declarations. | 42 // Forward declarations. |
43 class LDeferredCode; | 43 class LDeferredCode; |
44 class SafepointGenerator; | 44 class SafepointGenerator; |
45 | 45 |
46 class LCodeGen BASE_EMBEDDED { | 46 class LCodeGen BASE_EMBEDDED { |
47 public: | 47 public: |
48 LCodeGen(LChunk* chunk, MacroAssembler* assembler, CompilationInfo* info) | 48 LCodeGen(LChunk* chunk, MacroAssembler* assembler, CompilationInfo* info, |
danno
2012/06/01 11:29:24
Perhaps it's better to put the zone in the macro-a
| |
49 Zone* zone) | |
49 : chunk_(chunk), | 50 : chunk_(chunk), |
50 masm_(assembler), | 51 masm_(assembler), |
51 info_(info), | 52 info_(info), |
52 current_block_(-1), | 53 current_block_(-1), |
53 current_instruction_(-1), | 54 current_instruction_(-1), |
54 instructions_(chunk->instructions()), | 55 instructions_(chunk->instructions()), |
55 deoptimizations_(4), | 56 deoptimizations_(4), |
56 jump_table_(4), | 57 jump_table_(4), |
57 deoptimization_literals_(8), | 58 deoptimization_literals_(8), |
58 inlined_function_count_(0), | 59 inlined_function_count_(0), |
59 scope_(info->scope()), | 60 scope_(info->scope()), |
60 status_(UNUSED), | 61 status_(UNUSED), |
62 translations_(zone), | |
61 deferred_(8), | 63 deferred_(8), |
62 osr_pc_offset_(-1), | 64 osr_pc_offset_(-1), |
63 last_lazy_deopt_pc_(0), | 65 last_lazy_deopt_pc_(0), |
66 safepoints_(zone), | |
64 resolver_(this), | 67 resolver_(this), |
65 expected_safepoint_kind_(Safepoint::kSimple) { | 68 expected_safepoint_kind_(Safepoint::kSimple), |
69 zone_(zone) { | |
66 PopulateDeoptimizationLiteralsWithInlinedFunctions(); | 70 PopulateDeoptimizationLiteralsWithInlinedFunctions(); |
67 } | 71 } |
68 | 72 |
69 // Simple accessors. | 73 // Simple accessors. |
70 MacroAssembler* masm() const { return masm_; } | 74 MacroAssembler* masm() const { return masm_; } |
71 CompilationInfo* info() const { return info_; } | 75 CompilationInfo* info() const { return info_; } |
72 Isolate* isolate() const { return info_->isolate(); } | 76 Isolate* isolate() const { return info_->isolate(); } |
73 Factory* factory() const { return isolate()->factory(); } | 77 Factory* factory() const { return isolate()->factory(); } |
74 Heap* heap() const { return isolate()->heap(); } | 78 Heap* heap() const { return isolate()->heap(); } |
79 Zone* zone() const { return zone_; } | |
75 | 80 |
76 // Support for converting LOperands to assembler types. | 81 // Support for converting LOperands to assembler types. |
77 Register ToRegister(LOperand* op) const; | 82 Register ToRegister(LOperand* op) const; |
78 XMMRegister ToDoubleRegister(LOperand* op) const; | 83 XMMRegister ToDoubleRegister(LOperand* op) const; |
79 bool IsInteger32Constant(LConstantOperand* op) const; | 84 bool IsInteger32Constant(LConstantOperand* op) const; |
80 int ToInteger32(LConstantOperand* op) const; | 85 int ToInteger32(LConstantOperand* op) const; |
81 double ToDouble(LConstantOperand* op) const; | 86 double ToDouble(LConstantOperand* op) const; |
82 bool IsTaggedConstant(LConstantOperand* op) const; | 87 bool IsTaggedConstant(LConstantOperand* op) const; |
83 Handle<Object> ToHandle(LConstantOperand* op) const; | 88 Handle<Object> ToHandle(LConstantOperand* op) const; |
84 Operand ToOperand(LOperand* op) const; | 89 Operand ToOperand(LOperand* op) const; |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
339 | 344 |
340 // Builder that keeps track of safepoints in the code. The table | 345 // Builder that keeps track of safepoints in the code. The table |
341 // itself is emitted at the end of the generated code. | 346 // itself is emitted at the end of the generated code. |
342 SafepointTableBuilder safepoints_; | 347 SafepointTableBuilder safepoints_; |
343 | 348 |
344 // Compiler from a set of parallel moves to a sequential list of moves. | 349 // Compiler from a set of parallel moves to a sequential list of moves. |
345 LGapResolver resolver_; | 350 LGapResolver resolver_; |
346 | 351 |
347 Safepoint::Kind expected_safepoint_kind_; | 352 Safepoint::Kind expected_safepoint_kind_; |
348 | 353 |
354 Zone* zone_; | |
355 | |
349 class PushSafepointRegistersScope BASE_EMBEDDED { | 356 class PushSafepointRegistersScope BASE_EMBEDDED { |
350 public: | 357 public: |
351 explicit PushSafepointRegistersScope(LCodeGen* codegen) | 358 explicit PushSafepointRegistersScope(LCodeGen* codegen) |
352 : codegen_(codegen) { | 359 : codegen_(codegen) { |
353 ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); | 360 ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); |
354 codegen_->masm_->PushSafepointRegisters(); | 361 codegen_->masm_->PushSafepointRegisters(); |
355 codegen_->expected_safepoint_kind_ = Safepoint::kWithRegisters; | 362 codegen_->expected_safepoint_kind_ = Safepoint::kWithRegisters; |
356 } | 363 } |
357 | 364 |
358 ~PushSafepointRegistersScope() { | 365 ~PushSafepointRegistersScope() { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
398 LCodeGen* codegen_; | 405 LCodeGen* codegen_; |
399 Label entry_; | 406 Label entry_; |
400 Label exit_; | 407 Label exit_; |
401 Label* external_exit_; | 408 Label* external_exit_; |
402 int instruction_index_; | 409 int instruction_index_; |
403 }; | 410 }; |
404 | 411 |
405 } } // namespace v8::internal | 412 } } // namespace v8::internal |
406 | 413 |
407 #endif // V8_X64_LITHIUM_CODEGEN_X64_H_ | 414 #endif // V8_X64_LITHIUM_CODEGEN_X64_H_ |
OLD | NEW |