Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(487)

Side by Side Diff: src/arm/virtual-frame-arm.h

Issue 113259: Inline the code dealing with entering spilled scopes and maintaining a... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 class VirtualFrame : public Malloced { 44 class VirtualFrame : public Malloced {
45 public: 45 public:
46 // A utility class to introduce a scope where the virtual frame is 46 // A utility class to introduce a scope where the virtual frame is
47 // expected to remain spilled. The constructor spills the code 47 // expected to remain spilled. The constructor spills the code
48 // generator's current frame, but no attempt is made to require it 48 // generator's current frame, but no attempt is made to require it
49 // to stay spilled. It is intended as documentation while the code 49 // to stay spilled. It is intended as documentation while the code
50 // generator is being transformed. 50 // generator is being transformed.
51 class SpilledScope BASE_EMBEDDED { 51 class SpilledScope BASE_EMBEDDED {
52 public: 52 public:
53 explicit SpilledScope(CodeGenerator* cgen); 53 explicit SpilledScope(CodeGenerator* cgen) {
54 #ifdef DEBUG
55 cgen_ = cgen;
56 previous_state_ = cgen->in_spilled_code();
57 cgen->set_in_spilled_code(true);
58 #endif
59 ASSERT(cgen->has_valid_frame());
60 cgen->frame()->SpillAll();
61 }
54 62
55 ~SpilledScope(); 63 ~SpilledScope() {
64 #ifdef DEBUG
65 cgen_->set_in_spilled_code(previous_state_);
66 #endif
67 }
56 68
57 private: 69 private:
70 #ifdef DEBUG
58 CodeGenerator* cgen_; 71 CodeGenerator* cgen_;
59 bool previous_state_; 72 bool previous_state_;
73 #endif
60 }; 74 };
61 75
62 // An illegal index into the virtual frame. 76 // An illegal index into the virtual frame.
63 static const int kIllegalIndex = -1; 77 static const int kIllegalIndex = -1;
64 78
65 // Construct an initial virtual frame on entry to a JS function. 79 // Construct an initial virtual frame on entry to a JS function.
66 explicit VirtualFrame(CodeGenerator* cgen); 80 explicit VirtualFrame(CodeGenerator* cgen);
67 81
68 // Construct a virtual frame as a clone of an existing one. 82 // Construct a virtual frame as a clone of an existing one.
69 explicit VirtualFrame(VirtualFrame* original); 83 explicit VirtualFrame(VirtualFrame* original);
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 485
472 bool Equals(VirtualFrame* other); 486 bool Equals(VirtualFrame* other);
473 487
474 friend class JumpTarget; 488 friend class JumpTarget;
475 }; 489 };
476 490
477 491
478 } } // namespace v8::internal 492 } } // namespace v8::internal
479 493
480 #endif // V8_ARM_VIRTUAL_FRAME_ARM_H_ 494 #endif // V8_ARM_VIRTUAL_FRAME_ARM_H_
OLDNEW
« no previous file with comments | « src/arm/codegen-arm.cc ('k') | src/codegen.h » ('j') | src/ia32/codegen-ia32.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698