| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 RegisterAllocator* allocator() const { return allocator_; } | 334 RegisterAllocator* allocator() const { return allocator_; } |
| 335 | 335 |
| 336 CodeGenState* state() { return state_; } | 336 CodeGenState* state() { return state_; } |
| 337 void set_state(CodeGenState* state) { state_ = state; } | 337 void set_state(CodeGenState* state) { state_ = state; } |
| 338 | 338 |
| 339 void AddDeferred(DeferredCode* code) { deferred_.Add(code); } | 339 void AddDeferred(DeferredCode* code) { deferred_.Add(code); } |
| 340 | 340 |
| 341 bool in_spilled_code() const { return in_spilled_code_; } | 341 bool in_spilled_code() const { return in_spilled_code_; } |
| 342 void set_in_spilled_code(bool flag) { in_spilled_code_ = flag; } | 342 void set_in_spilled_code(bool flag) { in_spilled_code_ = flag; } |
| 343 | 343 |
| 344 static Operand ContextOperand(Register context, int index) { | |
| 345 return Operand(context, Context::SlotOffset(index)); | |
| 346 } | |
| 347 | |
| 348 private: | 344 private: |
| 349 // Type of a member function that generates inline code for a native function. | 345 // Type of a member function that generates inline code for a native function. |
| 350 typedef void (CodeGenerator::*InlineFunctionGenerator) | 346 typedef void (CodeGenerator::*InlineFunctionGenerator) |
| 351 (ZoneList<Expression*>*); | 347 (ZoneList<Expression*>*); |
| 352 | 348 |
| 353 static const InlineFunctionGenerator kInlineFunctionGenerators[]; | 349 static const InlineFunctionGenerator kInlineFunctionGenerators[]; |
| 354 | 350 |
| 355 // Construction/Destruction | 351 // Construction/Destruction |
| 356 explicit CodeGenerator(MacroAssembler* masm); | 352 explicit CodeGenerator(MacroAssembler* masm); |
| 357 | 353 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 void LoadReference(Reference* ref); | 406 void LoadReference(Reference* ref); |
| 411 void UnloadReference(Reference* ref); | 407 void UnloadReference(Reference* ref); |
| 412 | 408 |
| 413 Operand SlotOperand(Slot* slot, Register tmp); | 409 Operand SlotOperand(Slot* slot, Register tmp); |
| 414 | 410 |
| 415 Operand ContextSlotOperandCheckExtensions(Slot* slot, | 411 Operand ContextSlotOperandCheckExtensions(Slot* slot, |
| 416 Result tmp, | 412 Result tmp, |
| 417 JumpTarget* slow); | 413 JumpTarget* slow); |
| 418 | 414 |
| 419 // Expressions | 415 // Expressions |
| 420 static Operand GlobalObject() { | |
| 421 return ContextOperand(rsi, Context::GLOBAL_INDEX); | |
| 422 } | |
| 423 | |
| 424 void LoadCondition(Expression* x, | 416 void LoadCondition(Expression* x, |
| 425 ControlDestination* destination, | 417 ControlDestination* destination, |
| 426 bool force_control); | 418 bool force_control); |
| 427 void Load(Expression* expr); | 419 void Load(Expression* expr); |
| 428 void LoadGlobal(); | 420 void LoadGlobal(); |
| 429 void LoadGlobalReceiver(); | 421 void LoadGlobalReceiver(); |
| 430 | 422 |
| 431 // Generate code to push the value of an expression on top of the frame | 423 // Generate code to push the value of an expression on top of the frame |
| 432 // and then spill the frame fully to memory. This function is used | 424 // and then spill the frame fully to memory. This function is used |
| 433 // temporarily while the code generator is being transformed. | 425 // temporarily while the code generator is being transformed. |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 | 736 |
| 745 friend class CodeGeneratorPatcher; // Used in test-log-stack-tracer.cc | 737 friend class CodeGeneratorPatcher; // Used in test-log-stack-tracer.cc |
| 746 | 738 |
| 747 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); | 739 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); |
| 748 }; | 740 }; |
| 749 | 741 |
| 750 | 742 |
| 751 } } // namespace v8::internal | 743 } } // namespace v8::internal |
| 752 | 744 |
| 753 #endif // V8_X64_CODEGEN_X64_H_ | 745 #endif // V8_X64_CODEGEN_X64_H_ |
| OLD | NEW |