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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 // cannot reach the end of the expression (ie, by emitting only | 307 // cannot reach the end of the expression (ie, by emitting only |
308 // unconditional jumps to the control targets). | 308 // unconditional jumps to the control targets). |
309 inline void LoadConditionAndSpill(Expression* expression, | 309 inline void LoadConditionAndSpill(Expression* expression, |
310 JumpTarget* true_target, | 310 JumpTarget* true_target, |
311 JumpTarget* false_target, | 311 JumpTarget* false_target, |
312 bool force_control); | 312 bool force_control); |
313 | 313 |
314 // Read a value from a slot and leave it on top of the expression stack. | 314 // Read a value from a slot and leave it on top of the expression stack. |
315 void LoadFromSlot(Slot* slot, TypeofState typeof_state); | 315 void LoadFromSlot(Slot* slot, TypeofState typeof_state); |
316 void LoadFromSlotCheckForArguments(Slot* slot, TypeofState state); | 316 void LoadFromSlotCheckForArguments(Slot* slot, TypeofState state); |
| 317 |
317 // Store the value on top of the stack to a slot. | 318 // Store the value on top of the stack to a slot. |
318 void StoreToSlot(Slot* slot, InitState init_state); | 319 void StoreToSlot(Slot* slot, InitState init_state); |
319 | 320 |
320 // Support for compiling assignment expressions. | 321 // Support for compiling assignment expressions. |
321 void EmitSlotAssignment(Assignment* node); | 322 void EmitSlotAssignment(Assignment* node); |
322 void EmitNamedPropertyAssignment(Assignment* node); | 323 void EmitNamedPropertyAssignment(Assignment* node); |
323 void EmitKeyedPropertyAssignment(Assignment* node); | 324 void EmitKeyedPropertyAssignment(Assignment* node); |
324 | 325 |
325 // Load a named property, returning it in r0. The receiver is passed on the | 326 // Load a named property, returning it in r0. The receiver is passed on the |
326 // stack, and remains there. | 327 // stack, and remains there. |
327 void EmitNamedLoad(Handle<String> name, bool is_contextual); | 328 void EmitNamedLoad(Handle<String> name, bool is_contextual); |
328 | 329 |
329 // Store to a named property. If the store is contextual, value is passed on | 330 // Store to a named property. If the store is contextual, value is passed on |
330 // the frame and consumed. Otherwise, receiver and value are passed on the | 331 // the frame and consumed. Otherwise, receiver and value are passed on the |
331 // frame and consumed. The result is returned in r0. | 332 // frame and consumed. The result is returned in r0. |
332 void EmitNamedStore(Handle<String> name, bool is_contextual); | 333 void EmitNamedStore(Handle<String> name, bool is_contextual); |
333 | 334 |
334 // Load a keyed property, leaving it in r0. The receiver and key are | 335 // Load a keyed property, leaving it in r0. The receiver and key are |
335 // passed on the stack, and remain there. | 336 // passed on the stack, and remain there. |
336 void EmitKeyedLoad(); | 337 void EmitKeyedLoad(); |
337 | 338 |
338 // Store a keyed property. Key and receiver are on the stack and the value is | 339 // Store a keyed property. Key and receiver are on the stack and the value is |
339 // in r0. Result is returned in r0. | 340 // in r0. Result is returned in r0. |
340 void EmitKeyedStore(StaticType* key_type); | 341 void EmitKeyedStore(StaticType* key_type); |
341 | 342 |
342 void LoadFromGlobalSlotCheckExtensions(Slot* slot, | 343 void LoadFromGlobalSlotCheckExtensions(Slot* slot, |
343 TypeofState typeof_state, | 344 TypeofState typeof_state, |
344 JumpTarget* slow); | 345 JumpTarget* slow); |
345 | 346 |
| 347 // Support for loading from local/global variables and arguments |
| 348 // whose location is known unless they are shadowed by |
| 349 // eval-introduced bindings. Generates no code for unsupported slot |
| 350 // types and therefore expects to fall through to the slow jump target. |
| 351 void EmitDynamicLoadFromSlotFastCase(Slot* slot, |
| 352 TypeofState typeof_state, |
| 353 JumpTarget* slow, |
| 354 JumpTarget* done); |
| 355 |
346 // Special code for typeof expressions: Unfortunately, we must | 356 // Special code for typeof expressions: Unfortunately, we must |
347 // be careful when loading the expression in 'typeof' | 357 // be careful when loading the expression in 'typeof' |
348 // expressions. We are not allowed to throw reference errors for | 358 // expressions. We are not allowed to throw reference errors for |
349 // non-existing properties of the global object, so we must make it | 359 // non-existing properties of the global object, so we must make it |
350 // look like an explicit property access, instead of an access | 360 // look like an explicit property access, instead of an access |
351 // through the context chain. | 361 // through the context chain. |
352 void LoadTypeofExpression(Expression* x); | 362 void LoadTypeofExpression(Expression* x); |
353 | 363 |
354 void ToBoolean(JumpTarget* true_target, JumpTarget* false_target); | 364 void ToBoolean(JumpTarget* true_target, JumpTarget* false_target); |
355 | 365 |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
942 return ObjectBits::encode(object_.code()) | | 952 return ObjectBits::encode(object_.code()) | |
943 OffsetBits::encode(offset_.code()) | | 953 OffsetBits::encode(offset_.code()) | |
944 ScratchBits::encode(scratch_.code()); | 954 ScratchBits::encode(scratch_.code()); |
945 } | 955 } |
946 }; | 956 }; |
947 | 957 |
948 | 958 |
949 } } // namespace v8::internal | 959 } } // namespace v8::internal |
950 | 960 |
951 #endif // V8_ARM_CODEGEN_ARM_H_ | 961 #endif // V8_ARM_CODEGEN_ARM_H_ |
OLD | NEW |