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

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

Issue 1531273002: [Interpreter] Allocates new temporary register outside the reservation for consecutive registers. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixing mjsunit.status again. one test is failing on bots. Created 5 years 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 3075 matching lines...) Expand 10 before | Expand all | Expand 10 after
3086 std::string source( 3086 std::string source(
3087 InterpreterTester::SourceForBody(to_name_tests[i].first)); 3087 InterpreterTester::SourceForBody(to_name_tests[i].first));
3088 InterpreterTester tester(handles.main_isolate(), source.c_str()); 3088 InterpreterTester tester(handles.main_isolate(), source.c_str());
3089 auto callable = tester.GetCallable<>(); 3089 auto callable = tester.GetCallable<>();
3090 3090
3091 Handle<i::Object> return_value = callable().ToHandleChecked(); 3091 Handle<i::Object> return_value = callable().ToHandleChecked();
3092 CHECK(return_value->SameValue(*to_name_tests[i].second)); 3092 CHECK(return_value->SameValue(*to_name_tests[i].second));
3093 } 3093 }
3094 } 3094 }
3095 3095
3096
3097 TEST(TemporaryRegisterAllocation) {
3098 HandleAndZoneScope handles;
3099 i::Isolate* isolate = handles.main_isolate();
3100 i::Factory* factory = isolate->factory();
3101
3102 std::pair<const char*, Handle<Object>> reg_tests[] = {
3103 {"function add(a, b, c) {"
3104 " return a + b + c;"
3105 "}"
3106 "function f() {"
3107 " var a = 10, b = 10;"
3108 " return add(a, b++, b);"
3109 "}",
3110 factory->NewNumberFromInt(31)},
3111 {"function add(a, b, c, d) {"
3112 " return a + b + c + d;"
3113 "}"
3114 "function f() {"
3115 " var x = 10, y = 20, z = 30;"
3116 " return x + add(x, (y= x++), x, z);"
3117 "}",
3118 factory->NewNumberFromInt(71)},
3119 };
3120
3121 for (size_t i = 0; i < arraysize(reg_tests); i++) {
3122 InterpreterTester tester(handles.main_isolate(), reg_tests[i].first);
3123 auto callable = tester.GetCallable<>();
3124
3125 Handle<i::Object> return_value = callable().ToHandleChecked();
3126 CHECK(return_value->SameValue(*reg_tests[i].second));
3127 }
3128 }
3129
3096 } // namespace interpreter 3130 } // namespace interpreter
3097 } // namespace internal 3131 } // namespace internal
3098 } // namespace v8 3132 } // 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