| Index: src/x64/full-codegen-x64.cc
|
| ===================================================================
|
| --- src/x64/full-codegen-x64.cc (revision 9568)
|
| +++ src/x64/full-codegen-x64.cc (working copy)
|
| @@ -254,7 +254,7 @@
|
| // constant.
|
| if (scope()->is_function_scope() && scope()->function() != NULL) {
|
| int ignored = 0;
|
| - EmitDeclaration(scope()->function(), Variable::CONST, NULL, &ignored);
|
| + EmitDeclaration(scope()->function(), CONST, NULL, &ignored);
|
| }
|
| VisitDeclarations(scope()->declarations());
|
| }
|
| @@ -677,7 +677,7 @@
|
|
|
|
|
| void FullCodeGenerator::EmitDeclaration(VariableProxy* proxy,
|
| - Variable::Mode mode,
|
| + VariableMode mode,
|
| FunctionLiteral* function,
|
| int* global_count) {
|
| // If it was not possible to allocate the variable at compile time, we
|
| @@ -695,7 +695,7 @@
|
| Comment cmnt(masm_, "[ Declaration");
|
| VisitForAccumulatorValue(function);
|
| __ movq(StackOperand(variable), result_register());
|
| - } else if (mode == Variable::CONST || mode == Variable::LET) {
|
| + } else if (mode == CONST || mode == LET) {
|
| Comment cmnt(masm_, "[ Declaration");
|
| __ LoadRoot(kScratchRegister, Heap::kTheHoleValueRootIndex);
|
| __ movq(StackOperand(variable), kScratchRegister);
|
| @@ -728,7 +728,7 @@
|
| EMIT_REMEMBERED_SET,
|
| OMIT_SMI_CHECK);
|
| PrepareForBailoutForId(proxy->id(), NO_REGISTERS);
|
| - } else if (mode == Variable::CONST || mode == Variable::LET) {
|
| + } else if (mode == CONST || mode == LET) {
|
| Comment cmnt(masm_, "[ Declaration");
|
| __ LoadRoot(kScratchRegister, Heap::kTheHoleValueRootIndex);
|
| __ movq(ContextOperand(rsi, variable->index()), kScratchRegister);
|
| @@ -742,10 +742,8 @@
|
| __ push(rsi);
|
| __ Push(variable->name());
|
| // Declaration nodes are always introduced in one of three modes.
|
| - ASSERT(mode == Variable::VAR ||
|
| - mode == Variable::CONST ||
|
| - mode == Variable::LET);
|
| - PropertyAttributes attr = (mode == Variable::CONST) ? READ_ONLY : NONE;
|
| + ASSERT(mode == VAR || mode == CONST || mode == LET);
|
| + PropertyAttributes attr = (mode == CONST) ? READ_ONLY : NONE;
|
| __ Push(Smi::FromInt(attr));
|
| // Push initial value, if any.
|
| // Note: For variables we must not push an initial value (such as
|
| @@ -753,7 +751,7 @@
|
| // must not destroy the current value.
|
| if (function != NULL) {
|
| VisitForStackValue(function);
|
| - } else if (mode == Variable::CONST || mode == Variable::LET) {
|
| + } else if (mode == CONST || mode == LET) {
|
| __ PushRoot(Heap::kTheHoleValueRootIndex);
|
| } else {
|
| __ Push(Smi::FromInt(0)); // Indicates no initial value.
|
| @@ -1178,19 +1176,18 @@
|
| // introducing variables. In those cases, we do not want to
|
| // perform a runtime call for all variables in the scope
|
| // containing the eval.
|
| - if (var->mode() == Variable::DYNAMIC_GLOBAL) {
|
| + if (var->mode() == DYNAMIC_GLOBAL) {
|
| EmitLoadGlobalCheckExtensions(var, typeof_state, slow);
|
| __ jmp(done);
|
| - } else if (var->mode() == Variable::DYNAMIC_LOCAL) {
|
| + } else if (var->mode() == DYNAMIC_LOCAL) {
|
| Variable* local = var->local_if_not_shadowed();
|
| __ movq(rax, ContextSlotOperandCheckExtensions(local, slow));
|
| - if (local->mode() == Variable::CONST ||
|
| - local->mode() == Variable::LET) {
|
| + if (local->mode() == CONST || local->mode() == LET) {
|
| __ CompareRoot(rax, Heap::kTheHoleValueRootIndex);
|
| __ j(not_equal, done);
|
| - if (local->mode() == Variable::CONST) {
|
| + if (local->mode() == CONST) {
|
| __ LoadRoot(rax, Heap::kUndefinedValueRootIndex);
|
| - } else { // Variable::LET
|
| + } else { // LET
|
| __ Push(var->name());
|
| __ CallRuntime(Runtime::kThrowReferenceError, 1);
|
| }
|
| @@ -1224,7 +1221,7 @@
|
| case Variable::LOCAL:
|
| case Variable::CONTEXT: {
|
| Comment cmnt(masm_, var->IsContextSlot() ? "Context slot" : "Stack slot");
|
| - if (var->mode() != Variable::LET && var->mode() != Variable::CONST) {
|
| + if (var->mode() != LET && var->mode() != CONST) {
|
| context()->Plug(var);
|
| } else {
|
| // Let and const need a read barrier.
|
| @@ -1232,10 +1229,10 @@
|
| GetVar(rax, var);
|
| __ CompareRoot(rax, Heap::kTheHoleValueRootIndex);
|
| __ j(not_equal, &done, Label::kNear);
|
| - if (var->mode() == Variable::LET) {
|
| + if (var->mode() == LET) {
|
| __ Push(var->name());
|
| __ CallRuntime(Runtime::kThrowReferenceError, 1);
|
| - } else { // Variable::CONST
|
| + } else { // CONST
|
| __ LoadRoot(rax, Heap::kUndefinedValueRootIndex);
|
| }
|
| __ bind(&done);
|
| @@ -1782,7 +1779,7 @@
|
| __ CallRuntime(Runtime::kInitializeConstContextSlot, 3);
|
| }
|
|
|
| - } else if (var->mode() == Variable::LET && op != Token::INIT_LET) {
|
| + } else if (var->mode() == LET && op != Token::INIT_LET) {
|
| // Non-initializing assignment to let variable needs a write barrier.
|
| if (var->IsLookupSlot()) {
|
| __ push(rax); // Value.
|
| @@ -1808,7 +1805,7 @@
|
| }
|
| }
|
|
|
| - } else if (var->mode() != Variable::CONST) {
|
| + } else if (var->mode() != CONST) {
|
| // Assignment to var or initializing assignment to let.
|
| if (var->IsStackAllocated() || var->IsContextSlot()) {
|
| MemOperand location = VarOperand(var, rcx);
|
| @@ -2077,7 +2074,7 @@
|
| // context lookup in the runtime system.
|
| Label done;
|
| Variable* var = proxy->var();
|
| - if (!var->IsUnallocated() && var->mode() == Variable::DYNAMIC_GLOBAL) {
|
| + if (!var->IsUnallocated() && var->mode() == DYNAMIC_GLOBAL) {
|
| Label slow;
|
| EmitLoadGlobalCheckExtensions(var, NOT_INSIDE_TYPEOF, &slow);
|
| // Push the function and resolve eval.
|
|
|