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

Unified Diff: src/arm/macro-assembler-arm.h

Issue 609843002: Refactor FrameAndConstantPoolScope and ConstantPoolUnavailableScope to be architecture independent (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Eliminate unreachable paths. Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/arm/assembler-arm.cc ('k') | src/arm/macro-assembler-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/macro-assembler-arm.h
diff --git a/src/arm/macro-assembler-arm.h b/src/arm/macro-assembler-arm.h
index d2a178664e0f18796e422670050a30e73ad76ec3..79d26f2696cd4c729c49b85eaf52e099e661b3d4 100644
--- a/src/arm/macro-assembler-arm.h
+++ b/src/arm/macro-assembler-arm.h
@@ -1401,7 +1401,8 @@ class MacroAssembler: public Assembler {
}
// Activation support.
- void EnterFrame(StackFrame::Type type, bool load_constant_pool = false);
+ void EnterFrame(StackFrame::Type type,
+ bool load_constant_pool_pointer_reg = false);
// Returns the pc offset at which the frame ends.
int LeaveFrame(StackFrame::Type type);
@@ -1530,71 +1531,6 @@ class CodePatcher {
};
-class FrameAndConstantPoolScope {
- public:
- FrameAndConstantPoolScope(MacroAssembler* masm, StackFrame::Type type)
- : masm_(masm),
- type_(type),
- old_has_frame_(masm->has_frame()),
- old_constant_pool_available_(masm->is_constant_pool_available()) {
- // We only want to enable constant pool access for non-manual frame scopes
- // to ensure the constant pool pointer is valid throughout the scope.
- DCHECK(type_ != StackFrame::MANUAL && type_ != StackFrame::NONE);
- masm->set_has_frame(true);
- masm->set_constant_pool_available(true);
- masm->EnterFrame(type, !old_constant_pool_available_);
- }
-
- ~FrameAndConstantPoolScope() {
- masm_->LeaveFrame(type_);
- masm_->set_has_frame(old_has_frame_);
- masm_->set_constant_pool_available(old_constant_pool_available_);
- }
-
- // Normally we generate the leave-frame code when this object goes
- // out of scope. Sometimes we may need to generate the code somewhere else
- // in addition. Calling this will achieve that, but the object stays in
- // scope, the MacroAssembler is still marked as being in a frame scope, and
- // the code will be generated again when it goes out of scope.
- void GenerateLeaveFrame() {
- DCHECK(type_ != StackFrame::MANUAL && type_ != StackFrame::NONE);
- masm_->LeaveFrame(type_);
- }
-
- private:
- MacroAssembler* masm_;
- StackFrame::Type type_;
- bool old_has_frame_;
- bool old_constant_pool_available_;
-
- DISALLOW_IMPLICIT_CONSTRUCTORS(FrameAndConstantPoolScope);
-};
-
-
-// Class for scoping the the unavailability of constant pool access.
-class ConstantPoolUnavailableScope {
- public:
- explicit ConstantPoolUnavailableScope(MacroAssembler* masm)
- : masm_(masm),
- old_constant_pool_available_(masm->is_constant_pool_available()) {
- if (FLAG_enable_ool_constant_pool) {
- masm_->set_constant_pool_available(false);
- }
- }
- ~ConstantPoolUnavailableScope() {
- if (FLAG_enable_ool_constant_pool) {
- masm_->set_constant_pool_available(old_constant_pool_available_);
- }
- }
-
- private:
- MacroAssembler* masm_;
- int old_constant_pool_available_;
-
- DISALLOW_IMPLICIT_CONSTRUCTORS(ConstantPoolUnavailableScope);
-};
-
-
// -----------------------------------------------------------------------------
// Static helper functions.
« no previous file with comments | « src/arm/assembler-arm.cc ('k') | src/arm/macro-assembler-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698