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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 | 345 |
346 // Return a position of the element at |index_as_smi| + |additional_offset| | 346 // Return a position of the element at |index_as_smi| + |additional_offset| |
347 // in FixedArray pointer to which is held in |array|. |index_as_smi| is Smi. | 347 // in FixedArray pointer to which is held in |array|. |index_as_smi| is Smi. |
348 static Operand FixedArrayElementOperand(Register array, | 348 static Operand FixedArrayElementOperand(Register array, |
349 Register index_as_smi, | 349 Register index_as_smi, |
350 int additional_offset = 0) { | 350 int additional_offset = 0) { |
351 int offset = FixedArray::kHeaderSize + additional_offset * kPointerSize; | 351 int offset = FixedArray::kHeaderSize + additional_offset * kPointerSize; |
352 return FieldOperand(array, index_as_smi, times_half_pointer_size, offset); | 352 return FieldOperand(array, index_as_smi, times_half_pointer_size, offset); |
353 } | 353 } |
354 | 354 |
355 static Operand ContextOperand(Register context, int index) { | |
356 return Operand(context, Context::SlotOffset(index)); | |
357 } | |
358 | |
359 private: | 355 private: |
360 // Type of a member function that generates inline code for a native function. | 356 // Type of a member function that generates inline code for a native function. |
361 typedef void (CodeGenerator::*InlineFunctionGenerator) | 357 typedef void (CodeGenerator::*InlineFunctionGenerator) |
362 (ZoneList<Expression*>*); | 358 (ZoneList<Expression*>*); |
363 | 359 |
364 static const InlineFunctionGenerator kInlineFunctionGenerators[]; | 360 static const InlineFunctionGenerator kInlineFunctionGenerators[]; |
365 | 361 |
366 // Construction/Destruction | 362 // Construction/Destruction |
367 explicit CodeGenerator(MacroAssembler* masm); | 363 explicit CodeGenerator(MacroAssembler* masm); |
368 | 364 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 // The following are used by class Reference. | 430 // The following are used by class Reference. |
435 void LoadReference(Reference* ref); | 431 void LoadReference(Reference* ref); |
436 | 432 |
437 Operand SlotOperand(Slot* slot, Register tmp); | 433 Operand SlotOperand(Slot* slot, Register tmp); |
438 | 434 |
439 Operand ContextSlotOperandCheckExtensions(Slot* slot, | 435 Operand ContextSlotOperandCheckExtensions(Slot* slot, |
440 Result tmp, | 436 Result tmp, |
441 JumpTarget* slow); | 437 JumpTarget* slow); |
442 | 438 |
443 // Expressions | 439 // Expressions |
444 static Operand GlobalObject() { | |
445 return ContextOperand(esi, Context::GLOBAL_INDEX); | |
446 } | |
447 | |
448 void LoadCondition(Expression* expr, | 440 void LoadCondition(Expression* expr, |
449 ControlDestination* destination, | 441 ControlDestination* destination, |
450 bool force_control); | 442 bool force_control); |
451 void Load(Expression* expr); | 443 void Load(Expression* expr); |
452 void LoadGlobal(); | 444 void LoadGlobal(); |
453 void LoadGlobalReceiver(); | 445 void LoadGlobalReceiver(); |
454 | 446 |
455 // Generate code to push the value of an expression on top of the frame | 447 // Generate code to push the value of an expression on top of the frame |
456 // and then spill the frame fully to memory. This function is used | 448 // and then spill the frame fully to memory. This function is used |
457 // temporarily while the code generator is being transformed. | 449 // temporarily while the code generator is being transformed. |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 | 787 |
796 friend class CodeGeneratorPatcher; // Used in test-log-stack-tracer.cc | 788 friend class CodeGeneratorPatcher; // Used in test-log-stack-tracer.cc |
797 | 789 |
798 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); | 790 DISALLOW_COPY_AND_ASSIGN(CodeGenerator); |
799 }; | 791 }; |
800 | 792 |
801 | 793 |
802 } } // namespace v8::internal | 794 } } // namespace v8::internal |
803 | 795 |
804 #endif // V8_IA32_CODEGEN_IA32_H_ | 796 #endif // V8_IA32_CODEGEN_IA32_H_ |
OLD | NEW |