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

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

Issue 1587033002: [Interpreter] Ensure we always have an outer register allocation scope. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_mythri
Patch Set: Similarity 20 Created 4 years, 11 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
« no previous file with comments | « test/cctest/interpreter/test-bytecode-generator.cc ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/execution.h" 7 #include "src/execution.h"
8 #include "src/handles.h" 8 #include "src/handles.h"
9 #include "src/interpreter/bytecode-array-builder.h" 9 #include "src/interpreter/bytecode-array-builder.h"
10 #include "src/interpreter/interpreter.h" 10 #include "src/interpreter/interpreter.h"
(...skipping 2213 matching lines...) Expand 10 before | Expand all | Expand 10 after
2224 std::make_pair("var a = { val: 11 }; return ++a.val;", 2224 std::make_pair("var a = { val: 11 }; return ++a.val;",
2225 handle(Smi::FromInt(12), isolate)), 2225 handle(Smi::FromInt(12), isolate)),
2226 std::make_pair("var name = 'val'; var a = { val: 22 }; return --a[name];", 2226 std::make_pair("var name = 'val'; var a = { val: 22 }; return --a[name];",
2227 handle(Smi::FromInt(21), isolate)), 2227 handle(Smi::FromInt(21), isolate)),
2228 std::make_pair("var name = 'val'; var a = { val: 22 }; return a[name]++;", 2228 std::make_pair("var name = 'val'; var a = { val: 22 }; return a[name]++;",
2229 handle(Smi::FromInt(22), isolate)), 2229 handle(Smi::FromInt(22), isolate)),
2230 std::make_pair("var a = 1; (function() { a = 2 })(); return ++a;", 2230 std::make_pair("var a = 1; (function() { a = 2 })(); return ++a;",
2231 handle(Smi::FromInt(3), isolate)), 2231 handle(Smi::FromInt(3), isolate)),
2232 std::make_pair("var a = 1; (function() { a = 2 })(); return a--;", 2232 std::make_pair("var a = 1; (function() { a = 2 })(); return a--;",
2233 handle(Smi::FromInt(2), isolate)), 2233 handle(Smi::FromInt(2), isolate)),
2234 std::make_pair("var i = 5; while(i--) {}; return i;",
2235 handle(Smi::FromInt(-1), isolate)),
2236 std::make_pair("var i = 1; if(i--) { return 1; } else { return 2; };",
2237 handle(Smi::FromInt(1), isolate)),
2238 std::make_pair("var i = -2; do {} while(i++) {}; return i;",
2239 handle(Smi::FromInt(1), isolate)),
2240 std::make_pair("var i = -1; for(; i++; ) {}; return i",
2241 handle(Smi::FromInt(1), isolate)),
2242 std::make_pair("var i = 20; switch(i++) {\n"
2243 " case 20: return 1;\n"
2244 " default: return 2;\n"
2245 "}",
2246 handle(Smi::FromInt(1), isolate)),
2234 }; 2247 };
2235 2248
2236 for (size_t i = 0; i < arraysize(count_ops); i++) { 2249 for (size_t i = 0; i < arraysize(count_ops); i++) {
2237 std::string source(InterpreterTester::SourceForBody(count_ops[i].first)); 2250 std::string source(InterpreterTester::SourceForBody(count_ops[i].first));
2238 InterpreterTester tester(handles.main_isolate(), source.c_str()); 2251 InterpreterTester tester(handles.main_isolate(), source.c_str());
2239 auto callable = tester.GetCallable<>(); 2252 auto callable = tester.GetCallable<>();
2240 2253
2241 Handle<i::Object> return_value = callable().ToHandleChecked(); 2254 Handle<i::Object> return_value = callable().ToHandleChecked();
2242 CHECK(return_value->SameValue(*count_ops[i].second)); 2255 CHECK(return_value->SameValue(*count_ops[i].second));
2243 } 2256 }
(...skipping 1301 matching lines...) Expand 10 before | Expand all | Expand 10 after
3545 auto callable = tester.GetCallable<>(); 3558 auto callable = tester.GetCallable<>();
3546 3559
3547 Handle<i::Object> return_value = callable().ToHandleChecked(); 3560 Handle<i::Object> return_value = callable().ToHandleChecked();
3548 CHECK(return_value->SameValue(*eval_global[i].second)); 3561 CHECK(return_value->SameValue(*eval_global[i].second));
3549 } 3562 }
3550 } 3563 }
3551 3564
3552 } // namespace interpreter 3565 } // namespace interpreter
3553 } // namespace internal 3566 } // namespace internal
3554 } // namespace v8 3567 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/interpreter/test-bytecode-generator.cc ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698