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

Side by Side Diff: src/ia32/virtual-frame-ia32.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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 Result RawCallCodeObject(Handle<Code> code, RelocInfo::Mode rmode); 498 Result RawCallCodeObject(Handle<Code> code, RelocInfo::Mode rmode);
485 499
486 bool Equals(VirtualFrame* other); 500 bool Equals(VirtualFrame* other);
487 501
488 friend class JumpTarget; 502 friend class JumpTarget;
489 }; 503 };
490 504
491 } } // namespace v8::internal 505 } } // namespace v8::internal
492 506
493 #endif // V8_IA32_VIRTUAL_FRAME_IA32_H_ 507 #endif // V8_IA32_VIRTUAL_FRAME_IA32_H_
OLDNEW
« src/ia32/codegen-ia32.h ('K') | « src/ia32/codegen-ia32.cc ('k') | src/virtual-frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698