From a77dc151fee38abca1df544b79af0f4d8362a1aa Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Wed, 7 Jan 2009 14:14:51 -0800 Subject: [PATCH] Bug 472553 - Annotations required by jsstack.js analysis, r=jorendorff. --- js/src/jstracer.cpp | 18 +++++++++--------- js/src/jstracer.h | 16 ++++++++-------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/js/src/jstracer.cpp b/js/src/jstracer.cpp index 234ce854e20f..744afc3257b0 100644 --- a/js/src/jstracer.cpp +++ b/js/src/jstracer.cpp @@ -373,7 +373,7 @@ hash_accum(uintptr_t& h, uintptr_t i) } -static inline int +JS_REQUIRES_STACK static inline int stackSlotHash(JSContext* cx, unsigned slot) { uintptr_t h = 5381; @@ -383,7 +383,7 @@ stackSlotHash(JSContext* cx, unsigned slot) return int(h); } -static inline int +JS_REQUIRES_STACK static inline int globalSlotHash(JSContext* cx, unsigned slot) { uintptr_t h = 5381; @@ -401,28 +401,28 @@ globalSlotHash(JSContext* cx, unsigned slot) /* Tell the oracle that a certain global variable should not be demoted. */ -void +JS_REQUIRES_STACK void Oracle::markGlobalSlotUndemotable(JSContext* cx, unsigned slot) { _globalDontDemote.set(&gc, globalSlotHash(cx, slot)); } /* Consult with the oracle whether we shouldn't demote a certain global variable. */ -bool +JS_REQUIRES_STACK bool Oracle::isGlobalSlotUndemotable(JSContext* cx, unsigned slot) const { return _globalDontDemote.get(globalSlotHash(cx, slot)); } /* Tell the oracle that a certain slot at a certain bytecode location should not be demoted. */ -void +JS_REQUIRES_STACK void Oracle::markStackSlotUndemotable(JSContext* cx, unsigned slot) { _stackDontDemote.set(&gc, stackSlotHash(cx, slot)); } /* Consult with the oracle whether we shouldn't demote a certain slot. */ -bool +JS_REQUIRES_STACK bool Oracle::isStackSlotUndemotable(JSContext* cx, unsigned slot) const { return _stackDontDemote.get(stackSlotHash(cx, slot)); @@ -4318,7 +4318,7 @@ TraceRecorder::stack(int n, LIns* i) set(&stackval(n), i, n >= 0); } -LIns* +JS_REQUIRES_STACK LIns* TraceRecorder::alu(LOpcode v, jsdouble v0, jsdouble v1, LIns* s0, LIns* s1) { if (v == LIR_fadd || v == LIR_fsub) { @@ -4388,7 +4388,7 @@ TraceRecorder::makeNumberInt32(LIns* f) return x; } -LIns* +JS_REQUIRES_STACK LIns* TraceRecorder::stringify(jsval& v) { LIns* v_ins = get(&v); @@ -4410,7 +4410,7 @@ TraceRecorder::stringify(jsval& v) return v_ins; } -bool +JS_REQUIRES_STACK bool TraceRecorder::call_imacro(jsbytecode* imacro) { JSStackFrame* fp = cx->fp; diff --git a/js/src/jstracer.h b/js/src/jstracer.h index 24e73d32bfad..1b0131c5b90e 100644 --- a/js/src/jstracer.h +++ b/js/src/jstracer.h @@ -169,10 +169,10 @@ class Oracle { avmplus::BitSet _stackDontDemote; avmplus::BitSet _globalDontDemote; public: - void markGlobalSlotUndemotable(JSContext* cx, unsigned slot); - bool isGlobalSlotUndemotable(JSContext* cx, unsigned slot) const; - void markStackSlotUndemotable(JSContext* cx, unsigned slot); - bool isStackSlotUndemotable(JSContext* cx, unsigned slot) const; + JS_REQUIRES_STACK void markGlobalSlotUndemotable(JSContext* cx, unsigned slot); + JS_REQUIRES_STACK bool isGlobalSlotUndemotable(JSContext* cx, unsigned slot) const; + JS_REQUIRES_STACK void markStackSlotUndemotable(JSContext* cx, unsigned slot); + JS_REQUIRES_STACK bool isStackSlotUndemotable(JSContext* cx, unsigned slot) const; void clear(); }; @@ -354,13 +354,13 @@ class TraceRecorder : public avmplus::GCObject { JS_REQUIRES_STACK nanojit::LIns* stack(int n); JS_REQUIRES_STACK void stack(int n, nanojit::LIns* i); - nanojit::LIns* alu(nanojit::LOpcode op, jsdouble v0, jsdouble v1, - nanojit::LIns* s0, nanojit::LIns* s1); + JS_REQUIRES_STACK nanojit::LIns* alu(nanojit::LOpcode op, jsdouble v0, jsdouble v1, + nanojit::LIns* s0, nanojit::LIns* s1); nanojit::LIns* f2i(nanojit::LIns* f); JS_REQUIRES_STACK nanojit::LIns* makeNumberInt32(nanojit::LIns* f); - nanojit::LIns* stringify(jsval& v); + JS_REQUIRES_STACK nanojit::LIns* stringify(jsval& v); - bool call_imacro(jsbytecode* imacro); + JS_REQUIRES_STACK bool call_imacro(jsbytecode* imacro); JS_REQUIRES_STACK bool ifop(); JS_REQUIRES_STACK bool switchop();