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

Side by Side Diff: test/cctest/interpreter/test-bytecode-generator.cc

Issue 2343633002: [interpreter] Add a fast path for dynamic local load (Closed)
Patch Set: Fix extension slot word size in equality test Created 4 years, 3 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <fstream> 5 #include <fstream>
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #include "src/interpreter/bytecode-array-iterator.h" 9 #include "src/interpreter/bytecode-array-iterator.h"
10 #include "src/interpreter/bytecode-generator.h" 10 #include "src/interpreter/bytecode-generator.h"
(...skipping 1781 matching lines...) Expand 10 before | Expand all | Expand 10 after
1792 "return eval('1;');\n", 1792 "return eval('1;');\n",
1793 }; 1793 };
1794 1794
1795 CHECK( 1795 CHECK(
1796 CompareTexts(BuildActual(printer, snippets), LoadGolden("Eval.golden"))); 1796 CompareTexts(BuildActual(printer, snippets), LoadGolden("Eval.golden")));
1797 } 1797 }
1798 1798
1799 TEST(LookupSlot) { 1799 TEST(LookupSlot) {
1800 InitializedIgnitionHandleScope scope; 1800 InitializedIgnitionHandleScope scope;
1801 BytecodeExpectationsPrinter printer(CcTest::isolate()); 1801 BytecodeExpectationsPrinter printer(CcTest::isolate());
1802 printer.set_test_function_name("f");
1802 1803
1804 // clang-format off
1803 const char* snippets[] = { 1805 const char* snippets[] = {
1804 "eval('var x = 10;'); return x;\n", 1806 "eval('var x = 10;'); return x;\n",
1805 1807
1806 "eval('var x = 10;'); return typeof x;\n", 1808 "eval('var x = 10;'); return typeof x;\n",
1807 1809
1808 "x = 20; return eval('');\n", 1810 "x = 20; return eval('');\n",
1811
1812 "var x = 20;\n"
1813 "f = function(){\n"
1814 " eval('var x = 10');\n"
1815 " return x;\n"
1816 "}\n"
1817 "f();\n"
1809 }; 1818 };
1819 // clang-format on
1810 1820
1811 CHECK(CompareTexts(BuildActual(printer, snippets), 1821 CHECK(CompareTexts(BuildActual(printer, snippets),
1812 LoadGolden("LookupSlot.golden"))); 1822 LoadGolden("LookupSlot.golden")));
1813 } 1823 }
1814 1824
1815 TEST(CallLookupSlot) { 1825 TEST(CallLookupSlot) {
1816 InitializedIgnitionHandleScope scope; 1826 InitializedIgnitionHandleScope scope;
1817 BytecodeExpectationsPrinter printer(CcTest::isolate()); 1827 BytecodeExpectationsPrinter printer(CcTest::isolate());
1818 const char* snippets[] = { 1828 const char* snippets[] = {
1819 "g = function(){}; eval(''); return g();\n", 1829 "g = function(){}; eval(''); return g();\n",
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
2184 "f();\n", 2194 "f();\n",
2185 }; 2195 };
2186 2196
2187 CHECK(CompareTexts(BuildActual(printer, snippets), 2197 CHECK(CompareTexts(BuildActual(printer, snippets),
2188 LoadGolden("Generators.golden"))); 2198 LoadGolden("Generators.golden")));
2189 } 2199 }
2190 2200
2191 } // namespace interpreter 2201 } // namespace interpreter
2192 } // namespace internal 2202 } // namespace internal
2193 } // namespace v8 2203 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/interpreter/bytecode_expectations/LookupSlot.golden ('k') | test/cctest/interpreter/test-interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698