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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 | 351 |
352 // Return a position of the element at |index_as_smi| + |additional_offset| | 352 // Return a position of the element at |index_as_smi| + |additional_offset| |
353 // in FixedArray pointer to which is held in |array|. |index_as_smi| is Smi. | 353 // in FixedArray pointer to which is held in |array|. |index_as_smi| is Smi. |
354 static Operand FixedArrayElementOperand(Register array, | 354 static Operand FixedArrayElementOperand(Register array, |
355 Register index_as_smi, | 355 Register index_as_smi, |
356 int additional_offset = 0) { | 356 int additional_offset = 0) { |
357 int offset = FixedArray::kHeaderSize + additional_offset * kPointerSize; | 357 int offset = FixedArray::kHeaderSize + additional_offset * kPointerSize; |
358 return FieldOperand(array, index_as_smi, times_half_pointer_size, offset); | 358 return FieldOperand(array, index_as_smi, times_half_pointer_size, offset); |
359 } | 359 } |
360 | 360 |
| 361 static Operand ContextOperand(Register context, int index) { |
| 362 return Operand(context, Context::SlotOffset(index)); |
| 363 } |
| 364 |
361 private: | 365 private: |
362 // Construction/Destruction | 366 // Construction/Destruction |
363 explicit CodeGenerator(MacroAssembler* masm); | 367 explicit CodeGenerator(MacroAssembler* masm); |
364 | 368 |
365 // Accessors | 369 // Accessors |
366 inline bool is_eval(); | 370 inline bool is_eval(); |
367 inline Scope* scope(); | 371 inline Scope* scope(); |
368 | 372 |
369 // Generating deferred code. | 373 // Generating deferred code. |
370 void ProcessDeferred(); | 374 void ProcessDeferred(); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 | 427 |
424 // Returns the arguments allocation mode. | 428 // Returns the arguments allocation mode. |
425 ArgumentsAllocationMode ArgumentsMode(); | 429 ArgumentsAllocationMode ArgumentsMode(); |
426 | 430 |
427 // Store the arguments object and allocate it if necessary. | 431 // Store the arguments object and allocate it if necessary. |
428 Result StoreArgumentsObject(bool initial); | 432 Result StoreArgumentsObject(bool initial); |
429 | 433 |
430 // The following are used by class Reference. | 434 // The following are used by class Reference. |
431 void LoadReference(Reference* ref); | 435 void LoadReference(Reference* ref); |
432 | 436 |
433 static Operand ContextOperand(Register context, int index) { | |
434 return Operand(context, Context::SlotOffset(index)); | |
435 } | |
436 | |
437 Operand SlotOperand(Slot* slot, Register tmp); | 437 Operand SlotOperand(Slot* slot, Register tmp); |
438 | 438 |
439 Operand ContextSlotOperandCheckExtensions(Slot* slot, | 439 Operand ContextSlotOperandCheckExtensions(Slot* slot, |
440 Result tmp, | 440 Result tmp, |
441 JumpTarget* slow); | 441 JumpTarget* slow); |
442 | 442 |
443 // Expressions | 443 // Expressions |
444 static Operand GlobalObject() { | 444 static Operand GlobalObject() { |
445 return ContextOperand(esi, Context::GLOBAL_INDEX); | 445 return ContextOperand(esi, Context::GLOBAL_INDEX); |
446 } | 446 } |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 | 646 |
647 // Support for types. | 647 // Support for types. |
648 void GenerateIsSmi(ZoneList<Expression*>* args); | 648 void GenerateIsSmi(ZoneList<Expression*>* args); |
649 void GenerateIsNonNegativeSmi(ZoneList<Expression*>* args); | 649 void GenerateIsNonNegativeSmi(ZoneList<Expression*>* args); |
650 void GenerateIsArray(ZoneList<Expression*>* args); | 650 void GenerateIsArray(ZoneList<Expression*>* args); |
651 void GenerateIsRegExp(ZoneList<Expression*>* args); | 651 void GenerateIsRegExp(ZoneList<Expression*>* args); |
652 void GenerateIsObject(ZoneList<Expression*>* args); | 652 void GenerateIsObject(ZoneList<Expression*>* args); |
653 void GenerateIsSpecObject(ZoneList<Expression*>* args); | 653 void GenerateIsSpecObject(ZoneList<Expression*>* args); |
654 void GenerateIsFunction(ZoneList<Expression*>* args); | 654 void GenerateIsFunction(ZoneList<Expression*>* args); |
655 void GenerateIsUndetectableObject(ZoneList<Expression*>* args); | 655 void GenerateIsUndetectableObject(ZoneList<Expression*>* args); |
| 656 void GenerateIsStringWrapperSafeForDefaultValueOf( |
| 657 ZoneList<Expression*>* args); |
656 | 658 |
657 // Support for construct call checks. | 659 // Support for construct call checks. |
658 void GenerateIsConstructCall(ZoneList<Expression*>* args); | 660 void GenerateIsConstructCall(ZoneList<Expression*>* args); |
659 | 661 |
660 // Support for arguments.length and arguments[?]. | 662 // Support for arguments.length and arguments[?]. |
661 void GenerateArgumentsLength(ZoneList<Expression*>* args); | 663 void GenerateArgumentsLength(ZoneList<Expression*>* args); |
662 void GenerateArguments(ZoneList<Expression*>* args); | 664 void GenerateArguments(ZoneList<Expression*>* args); |
663 | 665 |
664 // Support for accessing the class and value fields of an object. | 666 // Support for accessing the class and value fields of an object. |
665 void GenerateClassOf(ZoneList<Expression*>* args); | 667 void GenerateClassOf(ZoneList<Expression*>* args); |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1100 void Print() { | 1102 void Print() { |
1101 PrintF("NumberToStringStub\n"); | 1103 PrintF("NumberToStringStub\n"); |
1102 } | 1104 } |
1103 #endif | 1105 #endif |
1104 }; | 1106 }; |
1105 | 1107 |
1106 | 1108 |
1107 } } // namespace v8::internal | 1109 } } // namespace v8::internal |
1108 | 1110 |
1109 #endif // V8_IA32_CODEGEN_IA32_H_ | 1111 #endif // V8_IA32_CODEGEN_IA32_H_ |
OLD | NEW |