Reviewers: Lasse Reichstein, Mads Ager,
Message:
Couple renames that I missed earlier. It makes sense that strict mode
identifiers contain "mode" to prevent confusion with the strict null
comparison
which already uses strict word.
Thanks!
Martin
Description:
Strict mode renamings.
BUG=
TEST=
Please review this at http://codereview.chromium.org/6804024/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/arm/lithium-codegen-arm.cc
M src/compiler.h
M src/compiler.cc
M src/ia32/lithium-codegen-ia32.h
M src/ia32/lithium-codegen-ia32.cc
M src/x64/lithium-codegen-x64.cc
Index: src/arm/lithium-codegen-arm.cc
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc
index
b21416993cfea9fed2cdb389cdf9eaddd1e909fe..0adb0af90ce7b74dfea34ad038bf5a91a125f64a
100644
--- a/src/arm/lithium-codegen-arm.cc
+++ b/src/arm/lithium-codegen-arm.cc
@@ -3071,7 +3071,7 @@ void
LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
// Name is always in r2.
__ mov(r2, Operand(instr->name()));
- Handle<Code> ic = info_->is_strict()
+ Handle<Code> ic = info_->is_strict_mode()
? isolate()->builtins()->StoreIC_Initialize_Strict()
: isolate()->builtins()->StoreIC_Initialize();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
@@ -3129,7 +3129,7 @@ void
LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
ASSERT(ToRegister(instr->key()).is(r1));
ASSERT(ToRegister(instr->value()).is(r0));
- Handle<Code> ic = info_->is_strict()
+ Handle<Code> ic = info_->is_strict_mode()
? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
: isolate()->builtins()->KeyedStoreIC_Initialize();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index
4d90c97aba2a2ba1f2ffcd108c0798919a353487..edb1853954c7935796bcf01196eca2ab0550d70b
100755
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -567,7 +567,7 @@ Handle<SharedFunctionInfo>
Compiler::CompileEval(Handle<String> source,
CompilationInfo info(script);
info.MarkAsEval();
if (is_global) info.MarkAsGlobal();
- if (strict_mode == kStrictMode) info.MarkAsStrict();
+ if (strict_mode == kStrictMode) info.MarkAsStrictMode();
info.SetCallingContext(context);
result = MakeFunctionInfo(&info);
if (!result.is_null()) {
Index: src/compiler.h
diff --git a/src/compiler.h b/src/compiler.h
index
3cc249098ad24604730a26d916b672164b0508dc..d3a47ba6f02d62b22e3bf5ad14788843c32d30be
100644
--- a/src/compiler.h
+++ b/src/compiler.h
@@ -53,7 +53,7 @@ class CompilationInfo BASE_EMBEDDED {
bool is_lazy() const { return (flags_ & IsLazy::mask()) != 0; }
bool is_eval() const { return (flags_ & IsEval::mask()) != 0; }
bool is_global() const { return (flags_ & IsGlobal::mask()) != 0; }
- bool is_strict() const { return (flags_ & IsStrict::mask()) != 0; }
+ bool is_strict_mode() const { return (flags_ & IsStrictMode::mask()) !=
0; }
bool is_in_loop() const { return (flags_ & IsInLoop::mask()) != 0; }
FunctionLiteral* function() const { return function_; }
Scope* scope() const { return scope_; }
@@ -74,11 +74,11 @@ class CompilationInfo BASE_EMBEDDED {
ASSERT(!is_lazy());
flags_ |= IsGlobal::encode(true);
}
- void MarkAsStrict() {
- flags_ |= IsStrict::encode(true);
+ void MarkAsStrictMode() {
+ flags_ |= IsStrictMode::encode(true);
}
StrictModeFlag StrictMode() {
- return is_strict() ? kStrictMode : kNonStrictMode;
+ return is_strict_mode() ? kStrictMode : kNonStrictMode;
}
void MarkAsInLoop() {
ASSERT(is_lazy());
@@ -165,7 +165,7 @@ class CompilationInfo BASE_EMBEDDED {
void Initialize(Mode mode) {
mode_ = V8::UseCrankshaft() ? mode : NONOPT;
if (!shared_info_.is_null() && shared_info_->strict_mode()) {
- MarkAsStrict();
+ MarkAsStrictMode();
}
}
@@ -185,7 +185,7 @@ class CompilationInfo BASE_EMBEDDED {
// Flags that can be set for lazy compilation.
class IsInLoop: public BitField<bool, 3, 1> {};
// Strict mode - used in eager compilation.
- class IsStrict: public BitField<bool, 4, 1> {};
+ class IsStrictMode: public BitField<bool, 4, 1> {};
// Native syntax (%-stuff) allowed?
class IsNativesSyntaxAllowed: public BitField<bool, 5, 1> {};
Index: src/ia32/lithium-codegen-ia32.cc
diff --git a/src/ia32/lithium-codegen-ia32.cc
b/src/ia32/lithium-codegen-ia32.cc
index
2c5541b024e47d8c8ab8c2ef45965c672a8a8299..6ca22154cde7446faf52df4bb2fda040724c873c
100644
--- a/src/ia32/lithium-codegen-ia32.cc
+++ b/src/ia32/lithium-codegen-ia32.cc
@@ -2971,7 +2971,7 @@ void
LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
ASSERT(ToRegister(instr->value()).is(eax));
__ mov(ecx, instr->name());
- Handle<Code> ic = info_->is_strict()
+ Handle<Code> ic = info_->is_strict_mode()
? isolate()->builtins()->StoreIC_Initialize_Strict()
: isolate()->builtins()->StoreIC_Initialize();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
@@ -3071,7 +3071,7 @@ void
LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
ASSERT(ToRegister(instr->key()).is(ecx));
ASSERT(ToRegister(instr->value()).is(eax));
- Handle<Code> ic = info_->is_strict()
+ Handle<Code> ic = info_->is_strict_mode()
? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
: isolate()->builtins()->KeyedStoreIC_Initialize();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
Index: src/ia32/lithium-codegen-ia32.h
diff --git a/src/ia32/lithium-codegen-ia32.h
b/src/ia32/lithium-codegen-ia32.h
index
4414e6a26c779d3423363305e0dd6dea4c3fba3a..73af478ef1483a6ac6665093e3d720457e125391
100644
--- a/src/ia32/lithium-codegen-ia32.h
+++ b/src/ia32/lithium-codegen-ia32.h
@@ -129,7 +129,7 @@ class LCodeGen BASE_EMBEDDED {
bool is_aborted() const { return status_ == ABORTED; }
int strict_mode_flag() const {
- return info()->is_strict() ? kStrictMode : kNonStrictMode;
+ return info()->is_strict_mode() ? kStrictMode : kNonStrictMode;
}
LChunk* chunk() const { return chunk_; }
Index: src/x64/lithium-codegen-x64.cc
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
index
7ceff76e148f70efd55d40c898b00e50a628ced0..87f691cfbd8f59b6dc9c1d5807a4b64e10dd53e9
100644
--- a/src/x64/lithium-codegen-x64.cc
+++ b/src/x64/lithium-codegen-x64.cc
@@ -2942,7 +2942,7 @@ void
LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
ASSERT(ToRegister(instr->value()).is(rax));
__ Move(rcx, instr->hydrogen()->name());
- Handle<Code> ic = info_->is_strict()
+ Handle<Code> ic = info_->is_strict_mode()
? isolate()->builtins()->StoreIC_Initialize_Strict()
: isolate()->builtins()->StoreIC_Initialize();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
@@ -3038,7 +3038,7 @@ void
LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
ASSERT(ToRegister(instr->key()).is(rcx));
ASSERT(ToRegister(instr->value()).is(rax));
- Handle<Code> ic = info_->is_strict()
+ Handle<Code> ic = info_->is_strict_mode()
? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
: isolate()->builtins()->KeyedStoreIC_Initialize();
CallCode(ic, RelocInfo::CODE_TARGET, instr);
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev