| 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 26 matching lines...) Expand all Loading... |
| 37 // Forward declarations | 37 // Forward declarations |
| 38 class CompilationInfo; | 38 class CompilationInfo; |
| 39 class DeferredCode; | 39 class DeferredCode; |
| 40 class JumpTarget; | 40 class JumpTarget; |
| 41 class RegisterAllocator; | 41 class RegisterAllocator; |
| 42 class RegisterFile; | 42 class RegisterFile; |
| 43 | 43 |
| 44 enum InitState { CONST_INIT, NOT_CONST_INIT }; | 44 enum InitState { CONST_INIT, NOT_CONST_INIT }; |
| 45 enum TypeofState { INSIDE_TYPEOF, NOT_INSIDE_TYPEOF }; | 45 enum TypeofState { INSIDE_TYPEOF, NOT_INSIDE_TYPEOF }; |
| 46 enum GenerateInlineSmi { DONT_GENERATE_INLINE_SMI, GENERATE_INLINE_SMI }; | 46 enum GenerateInlineSmi { DONT_GENERATE_INLINE_SMI, GENERATE_INLINE_SMI }; |
| 47 enum WriteBarrierCharacter { UNLIKELY_SMI, LIKELY_SMI, NEVER_NEWSPACE }; |
| 47 | 48 |
| 48 | 49 |
| 49 // ------------------------------------------------------------------------- | 50 // ------------------------------------------------------------------------- |
| 50 // Reference support | 51 // Reference support |
| 51 | 52 |
| 52 // A reference is a C++ stack-allocated object that puts a | 53 // A reference is a C++ stack-allocated object that puts a |
| 53 // reference on the virtual frame. The reference may be consumed | 54 // reference on the virtual frame. The reference may be consumed |
| 54 // by GetValue, TakeValue, SetValue, and Codegen::UnloadReference. | 55 // by GetValue, TakeValue, SetValue, and Codegen::UnloadReference. |
| 55 // When the lifetime (scope) of a valid reference ends, it must have | 56 // When the lifetime (scope) of a valid reference ends, it must have |
| 56 // been consumed, and be in state UNLOADED. | 57 // been consumed, and be in state UNLOADED. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // the expression stack, and it is consumed by the call unless the | 94 // the expression stack, and it is consumed by the call unless the |
| 94 // reference is for a compound assignment. | 95 // reference is for a compound assignment. |
| 95 // If the reference is not consumed, it is left in place under its value. | 96 // If the reference is not consumed, it is left in place under its value. |
| 96 void GetValue(); | 97 void GetValue(); |
| 97 | 98 |
| 98 // Generate code to store the value on top of the expression stack in the | 99 // Generate code to store the value on top of the expression stack in the |
| 99 // reference. The reference is expected to be immediately below the value | 100 // reference. The reference is expected to be immediately below the value |
| 100 // on the expression stack. The value is stored in the location specified | 101 // on the expression stack. The value is stored in the location specified |
| 101 // by the reference, and is left on top of the stack, after the reference | 102 // by the reference, and is left on top of the stack, after the reference |
| 102 // is popped from beneath it (unloaded). | 103 // is popped from beneath it (unloaded). |
| 103 void SetValue(InitState init_state); | 104 void SetValue(InitState init_state, WriteBarrierCharacter wb); |
| 104 | 105 |
| 105 // This is in preparation for something that uses the reference on the stack. | 106 // This is in preparation for something that uses the reference on the stack. |
| 106 // If we need this reference afterwards get then dup it now. Otherwise mark | 107 // If we need this reference afterwards get then dup it now. Otherwise mark |
| 107 // it as used. | 108 // it as used. |
| 108 inline void DupIfPersist(); | 109 inline void DupIfPersist(); |
| 109 | 110 |
| 110 private: | 111 private: |
| 111 CodeGenerator* cgen_; | 112 CodeGenerator* cgen_; |
| 112 Expression* expression_; | 113 Expression* expression_; |
| 113 Type type_; | 114 Type type_; |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 // the frame and consumed. Otherwise, receiver and value are passed on the | 378 // the frame and consumed. Otherwise, receiver and value are passed on the |
| 378 // frame and consumed. The result is returned in r0. | 379 // frame and consumed. The result is returned in r0. |
| 379 void EmitNamedStore(Handle<String> name, bool is_contextual); | 380 void EmitNamedStore(Handle<String> name, bool is_contextual); |
| 380 | 381 |
| 381 // Load a keyed property, leaving it in r0. The receiver and key are | 382 // Load a keyed property, leaving it in r0. The receiver and key are |
| 382 // passed on the stack, and remain there. | 383 // passed on the stack, and remain there. |
| 383 void EmitKeyedLoad(); | 384 void EmitKeyedLoad(); |
| 384 | 385 |
| 385 // Store a keyed property. Key and receiver are on the stack and the value is | 386 // Store a keyed property. Key and receiver are on the stack and the value is |
| 386 // in r0. Result is returned in r0. | 387 // in r0. Result is returned in r0. |
| 387 void EmitKeyedStore(StaticType* key_type); | 388 void EmitKeyedStore(StaticType* key_type, WriteBarrierCharacter wb_info); |
| 388 | 389 |
| 389 void LoadFromGlobalSlotCheckExtensions(Slot* slot, | 390 void LoadFromGlobalSlotCheckExtensions(Slot* slot, |
| 390 TypeofState typeof_state, | 391 TypeofState typeof_state, |
| 391 JumpTarget* slow); | 392 JumpTarget* slow); |
| 392 | 393 |
| 393 // Support for loading from local/global variables and arguments | 394 // Support for loading from local/global variables and arguments |
| 394 // whose location is known unless they are shadowed by | 395 // whose location is known unless they are shadowed by |
| 395 // eval-introduced bindings. Generates no code for unsupported slot | 396 // eval-introduced bindings. Generates no code for unsupported slot |
| 396 // types and therefore expects to fall through to the slow jump target. | 397 // types and therefore expects to fall through to the slow jump target. |
| 397 void EmitDynamicLoadFromSlotFastCase(Slot* slot, | 398 void EmitDynamicLoadFromSlotFastCase(Slot* slot, |
| (...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1084 return ObjectBits::encode(object_.code()) | | 1085 return ObjectBits::encode(object_.code()) | |
| 1085 OffsetBits::encode(offset_.code()) | | 1086 OffsetBits::encode(offset_.code()) | |
| 1086 ScratchBits::encode(scratch_.code()); | 1087 ScratchBits::encode(scratch_.code()); |
| 1087 } | 1088 } |
| 1088 }; | 1089 }; |
| 1089 | 1090 |
| 1090 | 1091 |
| 1091 } } // namespace v8::internal | 1092 } } // namespace v8::internal |
| 1092 | 1093 |
| 1093 #endif // V8_ARM_CODEGEN_ARM_H_ | 1094 #endif // V8_ARM_CODEGEN_ARM_H_ |
| OLD | NEW |