| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 Scope* scope() const { return scope_; } | 133 Scope* scope() const { return scope_; } |
| 134 HGraph* graph() const { return chunk_->graph(); } | 134 HGraph* graph() const { return chunk_->graph(); } |
| 135 | 135 |
| 136 int GetNextEmittedBlock(int block); | 136 int GetNextEmittedBlock(int block); |
| 137 LInstruction* GetNextInstruction(); | 137 LInstruction* GetNextInstruction(); |
| 138 | 138 |
| 139 void EmitClassOfTest(Label* if_true, | 139 void EmitClassOfTest(Label* if_true, |
| 140 Label* if_false, | 140 Label* if_false, |
| 141 Handle<String> class_name, | 141 Handle<String> class_name, |
| 142 Register input, | 142 Register input, |
| 143 Register temporary); | 143 Register temporary, |
| 144 Register scratch); |
| 144 | 145 |
| 145 int GetStackSlotCount() const { return chunk()->spill_slot_count(); } | 146 int GetStackSlotCount() const { return chunk()->spill_slot_count(); } |
| 146 int GetParameterCount() const { return scope()->num_parameters(); } | 147 int GetParameterCount() const { return scope()->num_parameters(); } |
| 147 | 148 |
| 148 void Abort(const char* format, ...); | 149 void Abort(const char* format, ...); |
| 149 void Comment(const char* format, ...); | 150 void Comment(const char* format, ...); |
| 150 | 151 |
| 151 void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code); } | 152 void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code); } |
| 152 | 153 |
| 153 // Code generation passes. Returns true if code generation should | 154 // Code generation passes. Returns true if code generation should |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 friend class LDeferredCode; | 339 friend class LDeferredCode; |
| 339 friend class LEnvironment; | 340 friend class LEnvironment; |
| 340 friend class SafepointGenerator; | 341 friend class SafepointGenerator; |
| 341 DISALLOW_COPY_AND_ASSIGN(LCodeGen); | 342 DISALLOW_COPY_AND_ASSIGN(LCodeGen); |
| 342 }; | 343 }; |
| 343 | 344 |
| 344 | 345 |
| 345 class LDeferredCode: public ZoneObject { | 346 class LDeferredCode: public ZoneObject { |
| 346 public: | 347 public: |
| 347 explicit LDeferredCode(LCodeGen* codegen) | 348 explicit LDeferredCode(LCodeGen* codegen) |
| 348 : codegen_(codegen), external_exit_(NULL) { | 349 : codegen_(codegen), |
| 350 external_exit_(NULL), |
| 351 instruction_index_(codegen->current_instruction_) { |
| 349 codegen->AddDeferredCode(this); | 352 codegen->AddDeferredCode(this); |
| 350 } | 353 } |
| 351 | 354 |
| 352 virtual ~LDeferredCode() { } | 355 virtual ~LDeferredCode() { } |
| 353 virtual void Generate() = 0; | 356 virtual void Generate() = 0; |
| 357 virtual LInstruction* instr() = 0; |
| 354 | 358 |
| 355 void SetExit(Label *exit) { external_exit_ = exit; } | 359 void SetExit(Label *exit) { external_exit_ = exit; } |
| 356 Label* entry() { return &entry_; } | 360 Label* entry() { return &entry_; } |
| 357 Label* exit() { return external_exit_ != NULL ? external_exit_ : &exit_; } | 361 Label* exit() { return external_exit_ != NULL ? external_exit_ : &exit_; } |
| 362 int instruction_index() const { return instruction_index_; } |
| 358 | 363 |
| 359 protected: | 364 protected: |
| 360 LCodeGen* codegen() const { return codegen_; } | 365 LCodeGen* codegen() const { return codegen_; } |
| 361 MacroAssembler* masm() const { return codegen_->masm(); } | 366 MacroAssembler* masm() const { return codegen_->masm(); } |
| 362 | 367 |
| 363 private: | 368 private: |
| 364 LCodeGen* codegen_; | 369 LCodeGen* codegen_; |
| 365 Label entry_; | 370 Label entry_; |
| 366 Label exit_; | 371 Label exit_; |
| 367 Label* external_exit_; | 372 Label* external_exit_; |
| 373 int instruction_index_; |
| 368 }; | 374 }; |
| 369 | 375 |
| 370 } } // namespace v8::internal | 376 } } // namespace v8::internal |
| 371 | 377 |
| 372 #endif // V8_X64_LITHIUM_CODEGEN_X64_H_ | 378 #endif // V8_X64_LITHIUM_CODEGEN_X64_H_ |
| OLD | NEW |