summaryrefslogtreecommitdiff
path: root/deps/v8/src/macro-assembler.h
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2014-11-14 00:52:27 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2014-11-14 16:34:58 +0100
commit5d1b6d3e0fa4b97a490ef964be48aed9872e3ec1 (patch)
treeab5f510c4d83b175681de629395525bf7ec7cedb /deps/v8/src/macro-assembler.h
parent3b3d89bad26f5dfebe73fef6ae284ee78acbd5c9 (diff)
downloadnode-new-5d1b6d3e0fa4b97a490ef964be48aed9872e3ec1.tar.gz
deps: upgrade v8 to 3.30.37
Diffstat (limited to 'deps/v8/src/macro-assembler.h')
-rw-r--r--deps/v8/src/macro-assembler.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/deps/v8/src/macro-assembler.h b/deps/v8/src/macro-assembler.h
index 54cebca90f..2501f806c9 100644
--- a/deps/v8/src/macro-assembler.h
+++ b/deps/v8/src/macro-assembler.h
@@ -124,6 +124,74 @@ class FrameScope {
bool old_has_frame_;
};
+class FrameAndConstantPoolScope {
+ public:
+ FrameAndConstantPoolScope(MacroAssembler* masm, StackFrame::Type type)
+ : masm_(masm),
+ type_(type),
+ old_has_frame_(masm->has_frame()),
+ old_constant_pool_available_(FLAG_enable_ool_constant_pool &&
+ masm->is_ool_constant_pool_available()) {
+ masm->set_has_frame(true);
+ if (FLAG_enable_ool_constant_pool) {
+ masm->set_ool_constant_pool_available(true);
+ }
+ if (type_ != StackFrame::MANUAL && type_ != StackFrame::NONE) {
+ masm->EnterFrame(type, !old_constant_pool_available_);
+ }
+ }
+
+ ~FrameAndConstantPoolScope() {
+ masm_->LeaveFrame(type_);
+ masm_->set_has_frame(old_has_frame_);
+ if (FLAG_enable_ool_constant_pool) {
+ masm_->set_ool_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_(FLAG_enable_ool_constant_pool &&
+ masm->is_ool_constant_pool_available()) {
+ if (FLAG_enable_ool_constant_pool) {
+ masm_->set_ool_constant_pool_available(false);
+ }
+ }
+ ~ConstantPoolUnavailableScope() {
+ if (FLAG_enable_ool_constant_pool) {
+ masm_->set_ool_constant_pool_available(old_constant_pool_available_);
+ }
+ }
+
+ private:
+ MacroAssembler* masm_;
+ int old_constant_pool_available_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(ConstantPoolUnavailableScope);
+};
+
class AllowExternalCallThatCantCauseGC: public FrameScope {
public: