Added experimental API support for allocating V8 symbols as external strings.

Fixed bugs in debugging support on ARM.

Changed eval implementation to correctly detect whether or not a call to eval is aliased.

Fixed bug caused by a combination of the compilation cache and dictionary probing in native code.  The bug caused us to sometimes call functions that had not yet been compiled.

Added platform support for FreeBSD.

Added support for building V8 on Windows with either the shared or static version of MSVCRT
        
Added the v8::jscre namespace around the jscre functions to avoid link errors (duplicate symbols) when building Google Chrome.

Added support for calling a JavaScript function with the current debugger execution context as its argument to the debugger interface.

Changed the type of names of counters from wchar_t to char.

Changed the Windows system call used to compute daylight savings time.  The system call that we used to use became four times slower on WinXP SP3.

Added support in the d8 developer shell for memory-mapped counters and added a stats-viewer tool.

Fixed bug in upper/lower case mappings (issue 149).


git-svn-id: http://v8.googlecode.com/svn/trunk@911 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/scopes.cc b/src/scopes.cc
index 4f84bbb..fcdc577 100644
--- a/src/scopes.cc
+++ b/src/scopes.cc
@@ -184,11 +184,22 @@
 
 
 
-Variable* Scope::Lookup(Handle<String> name) {
+Variable* Scope::LookupLocal(Handle<String> name) {
   return locals_.Lookup(name);
 }
 
 
+Variable* Scope::Lookup(Handle<String> name) {
+  for (Scope* scope = this;
+       scope != NULL;
+       scope = scope->outer_scope()) {
+    Variable* var = scope->LookupLocal(name);
+    if (var != NULL) return var;
+  }
+  return NULL;
+}
+
+
 Variable* Scope::DeclareFunctionVar(Handle<String> name) {
   ASSERT(is_function_scope() && function_ == NULL);
   function_ = new Variable(this, name, Variable::CONST, true, false);
@@ -207,7 +218,7 @@
 
 void Scope::AddParameter(Variable* var) {
   ASSERT(is_function_scope());
-  ASSERT(Lookup(var->name()) == var);
+  ASSERT(LookupLocal(var->name()) == var);
   params_.Add(var);
 }
 
@@ -258,7 +269,7 @@
 }
 
 
-void Scope::VisitIllegalRedeclaration(Visitor* visitor) {
+void Scope::VisitIllegalRedeclaration(AstVisitor* visitor) {
   ASSERT(HasIllegalRedeclaration());
   illegal_redecl_->Accept(visitor);
 }
@@ -513,7 +524,7 @@
   bool guess = scope_calls_eval_;
 
   // Try to find the variable in this scope.
-  Variable* var = Lookup(name);
+  Variable* var = LookupLocal(name);
 
   if (var != NULL) {
     // We found a variable. If this is not an inner lookup, we are done.
@@ -707,7 +718,7 @@
 
 void Scope::AllocateParameterLocals() {
   ASSERT(is_function_scope());
-  Variable* arguments = Lookup(Factory::arguments_symbol());
+  Variable* arguments = LookupLocal(Factory::arguments_symbol());
   ASSERT(arguments != NULL);  // functions have 'arguments' declared implicitly
   if (MustAllocate(arguments) && !HasArgumentsParameter()) {
     // 'arguments' is used. Unless there is also a parameter called