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 30 matching lines...) Expand all Loading... |
41 | 41 |
42 enum InitState { CONST_INIT, NOT_CONST_INIT }; | 42 enum InitState { CONST_INIT, NOT_CONST_INIT }; |
43 enum TypeofState { INSIDE_TYPEOF, NOT_INSIDE_TYPEOF }; | 43 enum TypeofState { INSIDE_TYPEOF, NOT_INSIDE_TYPEOF }; |
44 | 44 |
45 | 45 |
46 // ------------------------------------------------------------------------- | 46 // ------------------------------------------------------------------------- |
47 // Reference support | 47 // Reference support |
48 | 48 |
49 // A reference is a C++ stack-allocated object that puts a | 49 // A reference is a C++ stack-allocated object that puts a |
50 // reference on the virtual frame. The reference may be consumed | 50 // reference on the virtual frame. The reference may be consumed |
51 // by GetValue, TakeValue, SetValue, and Codegen::UnloadReference. | 51 // by GetValue, TakeValue and SetValue. |
52 // When the lifetime (scope) of a valid reference ends, it must have | 52 // When the lifetime (scope) of a valid reference ends, it must have |
53 // been consumed, and be in state UNLOADED. | 53 // been consumed, and be in state UNLOADED. |
54 class Reference BASE_EMBEDDED { | 54 class Reference BASE_EMBEDDED { |
55 public: | 55 public: |
56 // The values of the types is important, see size(). | 56 // The values of the types is important, see size(). |
57 enum Type { UNLOADED = -2, ILLEGAL = -1, SLOT = 0, NAMED = 1, KEYED = 2 }; | 57 enum Type { UNLOADED = -2, ILLEGAL = -1, SLOT = 0, NAMED = 1, KEYED = 2 }; |
58 Reference(CodeGenerator* cgen, | 58 Reference(CodeGenerator* cgen, |
59 Expression* expression, | 59 Expression* expression, |
60 bool persist_after_get = false); | 60 bool persist_after_get = false); |
61 ~Reference(); | 61 ~Reference(); |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 void GenerateReturnSequence(Result* return_value); | 407 void GenerateReturnSequence(Result* return_value); |
408 | 408 |
409 // Returns the arguments allocation mode. | 409 // Returns the arguments allocation mode. |
410 ArgumentsAllocationMode ArgumentsMode(); | 410 ArgumentsAllocationMode ArgumentsMode(); |
411 | 411 |
412 // Store the arguments object and allocate it if necessary. | 412 // Store the arguments object and allocate it if necessary. |
413 Result StoreArgumentsObject(bool initial); | 413 Result StoreArgumentsObject(bool initial); |
414 | 414 |
415 // The following are used by class Reference. | 415 // The following are used by class Reference. |
416 void LoadReference(Reference* ref); | 416 void LoadReference(Reference* ref); |
417 void UnloadReference(Reference* ref); | |
418 | 417 |
419 static Operand ContextOperand(Register context, int index) { | 418 static Operand ContextOperand(Register context, int index) { |
420 return Operand(context, Context::SlotOffset(index)); | 419 return Operand(context, Context::SlotOffset(index)); |
421 } | 420 } |
422 | 421 |
423 Operand SlotOperand(Slot* slot, Register tmp); | 422 Operand SlotOperand(Slot* slot, Register tmp); |
424 | 423 |
425 Operand ContextSlotOperandCheckExtensions(Slot* slot, | 424 Operand ContextSlotOperandCheckExtensions(Slot* slot, |
426 Result tmp, | 425 Result tmp, |
427 JumpTarget* slow); | 426 JumpTarget* slow); |
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1095 return ObjectBits::encode(object_.code()) | | 1094 return ObjectBits::encode(object_.code()) | |
1096 AddressBits::encode(addr_.code()) | | 1095 AddressBits::encode(addr_.code()) | |
1097 ScratchBits::encode(scratch_.code()); | 1096 ScratchBits::encode(scratch_.code()); |
1098 } | 1097 } |
1099 }; | 1098 }; |
1100 | 1099 |
1101 | 1100 |
1102 } } // namespace v8::internal | 1101 } } // namespace v8::internal |
1103 | 1102 |
1104 #endif // V8_IA32_CODEGEN_IA32_H_ | 1103 #endif // V8_IA32_CODEGEN_IA32_H_ |
OLD | NEW |