From b100af61f17aad0ca3daaaadc312451798115a1b Mon Sep 17 00:00:00 2001 From: Sean Stangl Date: Wed, 12 Dec 2012 16:31:49 -0800 Subject: [PATCH] Bug 808245, Part 1/6 - Fix some nits, especially vim modelines. r=dvander --- js/src/assembler/assembler/MacroAssemblerCodeRef.h | 4 ++-- js/src/builtin/RegExp.cpp | 2 +- js/src/builtin/RegExp.h | 2 +- js/src/ion/MIR.h | 10 +++++----- js/src/jsapi.cpp | 4 ++-- js/src/jsstr.cpp | 4 ++-- js/src/jsstr.h | 3 ++- js/src/vm/MatchPairs.h | 2 +- js/src/vm/RegExpObject-inl.h | 2 +- js/src/vm/RegExpObject.cpp | 2 +- js/src/vm/RegExpObject.h | 2 +- js/src/vm/RegExpStatics-inl.h | 2 +- js/src/vm/RegExpStatics.cpp | 2 +- js/src/vm/RegExpStatics.h | 6 ++++-- js/src/yarr/YarrJIT.h | 8 ++++---- 15 files changed, 29 insertions(+), 26 deletions(-) diff --git a/js/src/assembler/assembler/MacroAssemblerCodeRef.h b/js/src/assembler/assembler/MacroAssemblerCodeRef.h index df279d58508..101ffcb098d 100644 --- a/js/src/assembler/assembler/MacroAssemblerCodeRef.h +++ b/js/src/assembler/assembler/MacroAssemblerCodeRef.h @@ -206,10 +206,10 @@ public: m_executablePool = NULL; } - MacroAssemblerCodePtr code() { + MacroAssemblerCodePtr code() const { return m_code; } - size_t size() { + size_t size() const { return m_size; } diff --git a/js/src/builtin/RegExp.cpp b/js/src/builtin/RegExp.cpp index a4a4110d3e3..0da00defe58 100644 --- a/js/src/builtin/RegExp.cpp +++ b/js/src/builtin/RegExp.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * vim: set ts=4 sw=4 et tw=99 ft=cpp: * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/js/src/builtin/RegExp.h b/js/src/builtin/RegExp.h index 0dc35237370..50239f0cc64 100644 --- a/js/src/builtin/RegExp.h +++ b/js/src/builtin/RegExp.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * vim: set ts=4 sw=4 et tw=99 ft=cpp: * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/js/src/ion/MIR.h b/js/src/ion/MIR.h index 467064d0f84..3143b24ffcf 100644 --- a/js/src/ion/MIR.h +++ b/js/src/ion/MIR.h @@ -3076,15 +3076,15 @@ class MRegExpTest return new MRegExpTest(regexp, string); } - TypePolicy *typePolicy() { - return this; + MDefinition *string() const { + return getOperand(0); } - MDefinition *regexp() const { return getOperand(1); } - MDefinition *string() const { - return getOperand(0); + + TypePolicy *typePolicy() { + return this; } }; diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index 6ddefe0e945..8bf8e8b02d6 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=78: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/js/src/jsstr.cpp b/js/src/jsstr.cpp index 8fa92c502f6..1ce4cae1c1b 100644 --- a/js/src/jsstr.cpp +++ b/js/src/jsstr.cpp @@ -1,5 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99: +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99: * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/js/src/jsstr.h b/js/src/jsstr.h index 3aec1841953..babb43d638d 100644 --- a/js/src/jsstr.h +++ b/js/src/jsstr.h @@ -1,4 +1,5 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=79 ft=cpp: * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/js/src/vm/MatchPairs.h b/js/src/vm/MatchPairs.h index 5c37b9dd66e..bc195d8766e 100644 --- a/js/src/vm/MatchPairs.h +++ b/js/src/vm/MatchPairs.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * vim: set ts=4 sw=4 et tw=99 ft=cpp: * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/js/src/vm/RegExpObject-inl.h b/js/src/vm/RegExpObject-inl.h index 0fa27b78323..97e06044cbb 100644 --- a/js/src/vm/RegExpObject-inl.h +++ b/js/src/vm/RegExpObject-inl.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * vim: set ts=4 sw=4 et tw=99 ft=cpp: * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp index 35aefb7fb79..5e406cda1eb 100644 --- a/js/src/vm/RegExpObject.cpp +++ b/js/src/vm/RegExpObject.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * vim: set ts=4 sw=4 et tw=99 ft=cpp: * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/js/src/vm/RegExpObject.h b/js/src/vm/RegExpObject.h index c3b580ec952..0adbb3be19c 100644 --- a/js/src/vm/RegExpObject.h +++ b/js/src/vm/RegExpObject.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * vim: set ts=4 sw=4 et tw=99 ft=cpp: * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/js/src/vm/RegExpStatics-inl.h b/js/src/vm/RegExpStatics-inl.h index 2a7e7c4433a..f72346c38db 100644 --- a/js/src/vm/RegExpStatics-inl.h +++ b/js/src/vm/RegExpStatics-inl.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * vim: set ts=4 sw=4 et tw=99 ft=cpp: * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/js/src/vm/RegExpStatics.cpp b/js/src/vm/RegExpStatics.cpp index 6bcfed2ad65..71571a92411 100644 --- a/js/src/vm/RegExpStatics.cpp +++ b/js/src/vm/RegExpStatics.cpp @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * vim: set ts=4 sw=4 et tw=99 ft=cpp: * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/js/src/vm/RegExpStatics.h b/js/src/vm/RegExpStatics.h index 36ab4bbda39..43d3362006d 100644 --- a/js/src/vm/RegExpStatics.h +++ b/js/src/vm/RegExpStatics.h @@ -1,5 +1,5 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * vim: set ts=8 sw=4 et tw=99 ft=cpp: + * vim: set ts=4 sw=4 et tw=99 ft=cpp: * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -209,6 +209,8 @@ class RegExpStatics void getLeftContext(JSSubString *out) const; void getRightContext(JSSubString *out) const; + /* PreserveRegExpStatics helpers. */ + class AutoRooter : private AutoGCRooter { public: @@ -253,4 +255,4 @@ size_t SizeOfRegExpStaticsData(const JSObject *obj, JSMallocSizeOfFun mallocSize } /* namespace js */ -#endif +#endif /* RegExpStatics_h__ */ diff --git a/js/src/yarr/YarrJIT.h b/js/src/yarr/YarrJIT.h index 15e5453d905..fad19adfdf4 100644 --- a/js/src/yarr/YarrJIT.h +++ b/js/src/yarr/YarrJIT.h @@ -80,16 +80,16 @@ public: bool isFallBack() { return m_needFallBack; } #ifdef YARR_8BIT_CHAR_SUPPORT - bool has8BitCode() { return m_ref8.size(); } + bool has8BitCode() const { return m_ref8.size(); } void set8BitCode(MacroAssemblerCodeRef ref) { m_ref8 = ref; } - bool has8BitCodeMatchOnly() { return m_matchOnly8.size(); } + bool has8BitCodeMatchOnly() const { return m_matchOnly8.size(); } void set8BitCodeMatchOnly(MacroAssemblerCodeRef matchOnly) { m_matchOnly8 = matchOnly; } #endif - bool has16BitCode() { return m_ref16.size(); } + bool has16BitCode() const { return m_ref16.size(); } void set16BitCode(MacroAssemblerCodeRef ref) { m_ref16 = ref; } - bool has16BitCodeMatchOnly() { return m_matchOnly16.size(); } + bool has16BitCodeMatchOnly() const { return m_matchOnly16.size(); } void set16BitCodeMatchOnly(MacroAssemblerCodeRef matchOnly) { m_matchOnly16 = matchOnly; } #if YARR_8BIT_CHAR_SUPPORT