| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 inline VirtualFrame(); | 64 inline VirtualFrame(); |
| 65 | 65 |
| 66 // Construct a virtual frame as a clone of an existing one. | 66 // Construct a virtual frame as a clone of an existing one. |
| 67 explicit inline VirtualFrame(VirtualFrame* original); | 67 explicit inline VirtualFrame(VirtualFrame* original); |
| 68 | 68 |
| 69 CodeGenerator* cgen() { return CodeGeneratorScope::Current(); } | 69 CodeGenerator* cgen() { return CodeGeneratorScope::Current(); } |
| 70 MacroAssembler* masm() { return cgen()->masm(); } | 70 MacroAssembler* masm() { return cgen()->masm(); } |
| 71 | 71 |
| 72 // Create a duplicate of an existing valid frame element. | 72 // Create a duplicate of an existing valid frame element. |
| 73 FrameElement CopyElementAt(int index, | 73 FrameElement CopyElementAt(int index, |
| 74 NumberInfo::Type info = NumberInfo::kUnknown); | 74 NumberInfo info = NumberInfo::Unknown()); |
| 75 | 75 |
| 76 // The number of elements on the virtual frame. | 76 // The number of elements on the virtual frame. |
| 77 int element_count() { return elements_.length(); } | 77 int element_count() { return elements_.length(); } |
| 78 | 78 |
| 79 // The height of the virtual expression stack. | 79 // The height of the virtual expression stack. |
| 80 int height() { | 80 int height() { |
| 81 return element_count() - expression_base_index(); | 81 return element_count() - expression_base_index(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 int register_location(int num) { | 84 int register_location(int num) { |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 void EmitMultiPopReversed(RegList regs); // lower first | 360 void EmitMultiPopReversed(RegList regs); // lower first |
| 361 | 361 |
| 362 // Push an element on top of the expression stack and emit a | 362 // Push an element on top of the expression stack and emit a |
| 363 // corresponding push instruction. | 363 // corresponding push instruction. |
| 364 void EmitPush(Register reg); | 364 void EmitPush(Register reg); |
| 365 // Same but for multiple registers. | 365 // Same but for multiple registers. |
| 366 void EmitMultiPush(RegList regs); // lower indexed registers are pushed first | 366 void EmitMultiPush(RegList regs); // lower indexed registers are pushed first |
| 367 void EmitMultiPushReversed(RegList regs); // higher first | 367 void EmitMultiPushReversed(RegList regs); // higher first |
| 368 | 368 |
| 369 // Push an element on the virtual frame. | 369 // Push an element on the virtual frame. |
| 370 inline void Push(Register reg, NumberInfo::Type info = NumberInfo::kUnknown); | 370 inline void Push(Register reg, NumberInfo info = NumberInfo::Unknown()); |
| 371 inline void Push(Handle<Object> value); | 371 inline void Push(Handle<Object> value); |
| 372 inline void Push(Smi* value); | 372 inline void Push(Smi* value); |
| 373 | 373 |
| 374 // Pushing a result invalidates it (its contents become owned by the frame). | 374 // Pushing a result invalidates it (its contents become owned by the frame). |
| 375 void Push(Result* result) { | 375 void Push(Result* result) { |
| 376 if (result->is_register()) { | 376 if (result->is_register()) { |
| 377 Push(result->reg()); | 377 Push(result->reg()); |
| 378 } else { | 378 } else { |
| 379 ASSERT(result->is_constant()); | 379 ASSERT(result->is_constant()); |
| 380 Push(result->handle()); | 380 Push(result->handle()); |
| 381 } | 381 } |
| 382 result->Unuse(); | 382 result->Unuse(); |
| 383 } | 383 } |
| 384 | 384 |
| 385 // Nip removes zero or more elements from immediately below the top | 385 // Nip removes zero or more elements from immediately below the top |
| 386 // of the frame, leaving the previous top-of-frame value on top of | 386 // of the frame, leaving the previous top-of-frame value on top of |
| 387 // the frame. Nip(k) is equivalent to x = Pop(), Drop(k), Push(x). | 387 // the frame. Nip(k) is equivalent to x = Pop(), Drop(k), Push(x). |
| 388 inline void Nip(int num_dropped); | 388 inline void Nip(int num_dropped); |
| 389 | 389 |
| 390 // This pushes 4 arguments slots on the stack and saves asked 'a' registers | 390 // This pushes 4 arguments slots on the stack and saves asked 'a' registers |
| 391 // 'a' registers are arguments register a0 to a3. | 391 // 'a' registers are arguments register a0 to a3. |
| 392 void EmitArgumentSlots(RegList reglist); | 392 void EmitArgumentSlots(RegList reglist); |
| 393 | 393 |
| 394 inline void SetTypeForLocalAt(int index, NumberInfo info); |
| 395 |
| 394 private: | 396 private: |
| 395 static const int kLocal0Offset = JavaScriptFrameConstants::kLocal0Offset; | 397 static const int kLocal0Offset = JavaScriptFrameConstants::kLocal0Offset; |
| 396 static const int kFunctionOffset = JavaScriptFrameConstants::kFunctionOffset; | 398 static const int kFunctionOffset = JavaScriptFrameConstants::kFunctionOffset; |
| 397 static const int kContextOffset = StandardFrameConstants::kContextOffset; | 399 static const int kContextOffset = StandardFrameConstants::kContextOffset; |
| 398 | 400 |
| 399 static const int kHandlerSize = StackHandlerConstants::kSize / kPointerSize; | 401 static const int kHandlerSize = StackHandlerConstants::kSize / kPointerSize; |
| 400 static const int kPreallocatedElements = 5 + 8; // 8 expression stack slots. | 402 static const int kPreallocatedElements = 5 + 8; // 8 expression stack slots. |
| 401 | 403 |
| 402 ZoneList<FrameElement> elements_; | 404 ZoneList<FrameElement> elements_; |
| 403 | 405 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 // Classes that need raw access to the elements_ array. | 542 // Classes that need raw access to the elements_ array. |
| 541 friend class DeferredCode; | 543 friend class DeferredCode; |
| 542 friend class JumpTarget; | 544 friend class JumpTarget; |
| 543 }; | 545 }; |
| 544 | 546 |
| 545 | 547 |
| 546 } } // namespace v8::internal | 548 } } // namespace v8::internal |
| 547 | 549 |
| 548 #endif // V8_MIPS_VIRTUAL_FRAME_MIPS_H_ | 550 #endif // V8_MIPS_VIRTUAL_FRAME_MIPS_H_ |
| 549 | 551 |
| OLD | NEW |