Import Cobalt 16.154703
diff --git a/src/v8/test/debugger/debug/debug-evaluate-arguments.js b/src/v8/test/debugger/debug/debug-evaluate-arguments.js
new file mode 100644
index 0000000..8cf18d7
--- /dev/null
+++ b/src/v8/test/debugger/debug/debug-evaluate-arguments.js
@@ -0,0 +1,60 @@
+// Copyright 2017 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.
+
+// Flags: --allow-natives-syntax
+
+Debug = debug.Debug;
+var listened = false;
+
+function listener(event, exec_state, event_data, data) {
+  if (event != Debug.DebugEvent.Break) return;
+  try {
+    var foo_arguments = exec_state.frame(1).evaluate("arguments").value();
+    var bar_arguments = exec_state.frame(0).evaluate("arguments").value();
+    assertArrayEquals(foo_expected, foo_arguments);
+    assertArrayEquals(bar_expected, bar_arguments);
+    listened = true;
+  } catch (e) {
+    print(e);
+    print(e.stack);
+  }
+}
+
+Debug.setListener(listener);
+
+function foo(a) {
+  function bar(a,b,c) {
+    debugger;
+    return a + b + c;
+  }
+  return bar(1,2,a);
+}
+
+listened = false;
+foo_expected = [3];
+bar_expected = [1,2,3];
+assertEquals(6, foo(3));
+assertTrue(listened);
+
+listened = false;
+foo_expected = [3];
+bar_expected = [1,2,3];
+assertEquals(6, foo(3));
+assertTrue(listened);
+
+listened = false;
+foo_expected = [3];
+bar_expected = [1,2,3];
+%OptimizeFunctionOnNextCall(foo);
+assertEquals(6, foo(3));
+assertTrue(listened);
+
+listened = false;
+foo_expected = [3,4,5];
+bar_expected = [1,2,3];
+%OptimizeFunctionOnNextCall(foo);
+assertEquals(6, foo(3,4,5));
+assertTrue(listened);
+
+Debug.setListener(null);
diff --git a/src/v8/test/debugger/debug/debug-modules-set-variable-value.js b/src/v8/test/debugger/debug/debug-modules-set-variable-value.js
index 61c032f..1d1c6d5 100644
--- a/src/v8/test/debugger/debug/debug-modules-set-variable-value.js
+++ b/src/v8/test/debugger/debug/debug-modules-set-variable-value.js
@@ -271,7 +271,7 @@
   function listener(event, exec_state) {
     if (event == Debug.DebugEvent.Break) {
       let scope_count = exec_state.frame().scopeCount();
-      let module_scope = exec_state.frame().scope(2);
+      let module_scope = exec_state.frame().scope(1);
       assertEquals(debug.ScopeType.Module, module_scope.scopeType());
       module_scope.setVariableValue('salad', 42);
     }
@@ -311,7 +311,7 @@
   function listener(event, exec_state) {
     if (event == Debug.DebugEvent.Break) {
       let scope_count = exec_state.frame().scopeCount();
-      let module_scope = exec_state.frame().scope(2);
+      let module_scope = exec_state.frame().scope(1);
       assertEquals(debug.ScopeType.Module, module_scope.scopeType());
       module_scope.setVariableValue('ham', 2);
     }
diff --git a/src/v8/test/debugger/debug/debug-script.js b/src/v8/test/debugger/debug/debug-script.js
index 98aa555..342f619 100644
--- a/src/v8/test/debugger/debug/debug-script.js
+++ b/src/v8/test/debugger/debug/debug-script.js
@@ -28,10 +28,11 @@
 // Flags: --expose-gc --send-idle-notification
 // Flags: --expose-natives-as natives
 // Flags: --noharmony-shipping
-// Flags: --nostress-opt
+// Flags: --nostress-opt --nostress-background-compile
 
-// --nostress-opt is specified because in stress mode the compilation cache
-// may hold on to old copies of scripts (see bug 1641).
+// --nostress-opt and --nostress-background-compilation is specified because in
+// stress mode the compilation cache may hold on to old copies of scripts (see
+// bug 1641).
 
 // Note: this test checks that that the number of scripts reported as native
 // by Debug.scripts() is the same as a number of core native scripts.
diff --git a/src/v8/test/debugger/debug/harmony/modules-debug-scopes2.js b/src/v8/test/debugger/debug/harmony/modules-debug-scopes2.js
index 8b9b9e8..cc1091e 100644
--- a/src/v8/test/debugger/debug/harmony/modules-debug-scopes2.js
+++ b/src/v8/test/debugger/debug/harmony/modules-debug-scopes2.js
@@ -139,10 +139,10 @@
                    debug.ScopeType.Script,
                    debug.ScopeType.Global], exec_state);
   CheckScopeContent(
-      {local_var: undefined, exported_var: undefined, imported_var: undefined},
+      {exported_var: undefined, imported_var: undefined},
       0, exec_state);
   CheckScopeDoesNotHave(
-      ["doesnotexist", "local_let", "exported_let", "imported_let"],
+      ["local_var", "doesntexist", "local_let", "exported_let", "imported_let"],
       0, exec_state);
 };
 debugger;
@@ -161,8 +161,9 @@
                    debug.ScopeType.Script,
                    debug.ScopeType.Global], exec_state);
   CheckScopeContent(
-      {local_let: 1, local_var: 2, exported_let: 3, exported_var: 4,
+      {exported_let: 3, exported_var: 4,
        imported_let: 3, imported_var: 4}, 0, exec_state);
+  CheckScopeDoesNotHave(["local_var", "local_let"], 0, exec_state);
 };
 debugger;
 EndTest();
@@ -178,8 +179,9 @@
                    debug.ScopeType.Script,
                    debug.ScopeType.Global], exec_state);
   CheckScopeContent(
-      {local_let: 11, local_var: 12, exported_let: 13, exported_var: 14,
+      {exported_let: 13, exported_var: 14,
        imported_let: 13, imported_var: 14}, 0, exec_state);
+  CheckScopeDoesNotHave(["local_var", "local_let"], 0, exec_state);
 };
 debugger;
 EndTest();
diff --git a/src/v8/test/debugger/debug/regress/regress-1853.js b/src/v8/test/debugger/debug/regress/regress-1853.js
index 8c6e940..4cd069f 100644
--- a/src/v8/test/debugger/debug/regress/regress-1853.js
+++ b/src/v8/test/debugger/debug/regress/regress-1853.js
@@ -25,10 +25,11 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-
+// Flags: --expose-gc
 // Test whether scripts compiled after setting the break point are
 // updated correctly.
 
+gc();
 Debug = debug.Debug;
 
 var break_count = 0;
diff --git a/src/v8/test/debugger/debug/regress/regress-crbug-481896.js b/src/v8/test/debugger/debug/regress/regress-crbug-481896.js
index d123980..751b62a 100644
--- a/src/v8/test/debugger/debug/regress/regress-crbug-481896.js
+++ b/src/v8/test/debugger/debug/regress/regress-crbug-481896.js
@@ -1,8 +1,8 @@
 // Copyright 2015 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.
-
-
+// Flags: --expose-gc
+gc();
 function static() {
   print("> static");  // Break
 }
diff --git a/src/v8/test/debugger/debug/regress/regress-crbug-517592.js b/src/v8/test/debugger/debug/regress/regress-crbug-517592.js
index e4a905d..57e96a2 100644
--- a/src/v8/test/debugger/debug/regress/regress-crbug-517592.js
+++ b/src/v8/test/debugger/debug/regress/regress-crbug-517592.js
@@ -4,7 +4,7 @@
 
 var source =
   "var foo = function foo() {\n" +
-  "  return 1;\n" +
+  "  var a = 1;\n" +
   "}\n" +
   "//@ sourceURL=test";