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

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

Issue 1406253008: [Interpreter] Add support for VisitThisFunction. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_jsruntime
Patch Set: Add tests Created 5 years, 1 month 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') | no next file » | 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 // TODO(rmcilroy): Remove this define after this flag is turned on globally 5 // TODO(rmcilroy): Remove this define after this flag is turned on globally
6 #define V8_IMMINENT_DEPRECATION_WARNINGS 6 #define V8_IMMINENT_DEPRECATION_WARNINGS
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/execution.h" 10 #include "src/execution.h"
(...skipping 2867 matching lines...) Expand 10 before | Expand all | Expand 10 after
2878 for (size_t i = 0; i < arraysize(switch_ops); i++) { 2878 for (size_t i = 0; i < arraysize(switch_ops); i++) {
2879 std::string source(InterpreterTester::SourceForBody(switch_ops[i].first)); 2879 std::string source(InterpreterTester::SourceForBody(switch_ops[i].first));
2880 InterpreterTester tester(handles.main_isolate(), source.c_str()); 2880 InterpreterTester tester(handles.main_isolate(), source.c_str());
2881 auto callable = tester.GetCallable<>(); 2881 auto callable = tester.GetCallable<>();
2882 2882
2883 Handle<i::Object> return_value = callable().ToHandleChecked(); 2883 Handle<i::Object> return_value = callable().ToHandleChecked();
2884 CHECK(return_value->SameValue(*switch_ops[i].second)); 2884 CHECK(return_value->SameValue(*switch_ops[i].second));
2885 } 2885 }
2886 } 2886 }
2887 2887
2888
2889 TEST(InterpreterThisFunction) {
2890 HandleAndZoneScope handles;
2891 i::Isolate* isolate = handles.main_isolate();
2892 i::Factory* factory = isolate->factory();
2893
2894 InterpreterTester tester(handles.main_isolate(),
2895 "var f;\n f = function f() { return f.name; }");
2896 auto callable = tester.GetCallable<>();
2897
2898 Handle<i::Object> return_value = callable().ToHandleChecked();
2899 CHECK(return_value->SameValue(*factory->NewStringFromStaticChars("f")));
2900 }
2901
2888 } // namespace interpreter 2902 } // namespace interpreter
2889 } // namespace internal 2903 } // namespace internal
2890 } // namespace v8 2904 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/interpreter/test-bytecode-generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698