Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Unified Diff: src/variables.cc

Issue 1481613002: Create ast/ and parsing/ subdirectories and move appropriate files (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/variables.h ('k') | src/x64/codegen-x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/variables.cc
diff --git a/src/variables.cc b/src/variables.cc
deleted file mode 100644
index b8bcbd03d196e84bf358f0863d4191dcca88a438..0000000000000000000000000000000000000000
--- a/src/variables.cc
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright 2011 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "src/variables.h"
-
-#include "src/ast.h"
-#include "src/scopes.h"
-
-namespace v8 {
-namespace internal {
-
-// ----------------------------------------------------------------------------
-// Implementation Variable.
-
-const char* Variable::Mode2String(VariableMode mode) {
- switch (mode) {
- case VAR: return "VAR";
- case CONST_LEGACY: return "CONST_LEGACY";
- case LET: return "LET";
- case CONST: return "CONST";
- case IMPORT: return "IMPORT";
- case DYNAMIC: return "DYNAMIC";
- case DYNAMIC_GLOBAL: return "DYNAMIC_GLOBAL";
- case DYNAMIC_LOCAL: return "DYNAMIC_LOCAL";
- case TEMPORARY: return "TEMPORARY";
- }
- UNREACHABLE();
- return NULL;
-}
-
-
-Variable::Variable(Scope* scope, const AstRawString* name, VariableMode mode,
- Kind kind, InitializationFlag initialization_flag,
- MaybeAssignedFlag maybe_assigned_flag)
- : scope_(scope),
- name_(name),
- mode_(mode),
- kind_(kind),
- location_(VariableLocation::UNALLOCATED),
- index_(-1),
- initializer_position_(RelocInfo::kNoPosition),
- has_strong_mode_reference_(false),
- strong_mode_reference_start_position_(RelocInfo::kNoPosition),
- strong_mode_reference_end_position_(RelocInfo::kNoPosition),
- local_if_not_shadowed_(NULL),
- is_from_eval_(false),
- force_context_allocation_(false),
- is_used_(false),
- initialization_flag_(initialization_flag),
- maybe_assigned_(maybe_assigned_flag) {
- // Var declared variables never need initialization.
- DCHECK(!(mode == VAR && initialization_flag == kNeedsInitialization));
-}
-
-
-bool Variable::IsGlobalObjectProperty() const {
- // Temporaries are never global, they must always be allocated in the
- // activation frame.
- return (IsDynamicVariableMode(mode_) ||
- (IsDeclaredVariableMode(mode_) && !IsLexicalVariableMode(mode_))) &&
- scope_ != NULL && scope_->is_script_scope() && !is_this();
-}
-
-
-bool Variable::IsStaticGlobalObjectProperty() const {
- // Temporaries are never global, they must always be allocated in the
- // activation frame.
- return (IsDeclaredVariableMode(mode_) && !IsLexicalVariableMode(mode_)) &&
- scope_ != NULL && scope_->is_script_scope() && !is_this();
-}
-
-
-int Variable::CompareIndex(Variable* const* v, Variable* const* w) {
- int x = (*v)->index();
- int y = (*w)->index();
- // Consider sorting them according to type as well?
- return x - y;
-}
-
-} // namespace internal
-} // namespace v8
« no previous file with comments | « src/variables.h ('k') | src/x64/codegen-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698