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

Side by Side Diff: test/cctest/compiler/test-linkage.cc

Issue 1423723002: Map v8::Function to JSReceiver + IsCallable (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates 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/compiler/function-tester.h ('k') | test/cctest/compiler/test-pipeline.cc » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/compiler.h" 8 #include "src/compiler.h"
9 #include "src/parser.h" 9 #include "src/parser.h"
10 #include "src/zone.h" 10 #include "src/zone.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 CHECK(descriptor); 49 CHECK(descriptor);
50 } 50 }
51 51
52 52
53 TEST(TestLinkageJSFunctionIncoming) { 53 TEST(TestLinkageJSFunctionIncoming) {
54 const char* sources[] = {"(function() { })", "(function(a) { })", 54 const char* sources[] = {"(function() { })", "(function(a) { })",
55 "(function(a,b) { })", "(function(a,b,c) { })"}; 55 "(function(a,b) { })", "(function(a,b,c) { })"};
56 56
57 for (int i = 0; i < 3; i++) { 57 for (int i = 0; i < 3; i++) {
58 HandleAndZoneScope handles; 58 HandleAndZoneScope handles;
59 Handle<JSFunction> function = v8::Utils::OpenHandle( 59 Handle<JSFunction> function =
60 *v8::Handle<v8::Function>::Cast(CompileRun(sources[i]))); 60 Handle<JSFunction>::cast(v8::Utils::OpenHandle(
61 *v8::Handle<v8::Function>::Cast(CompileRun(sources[i]))));
61 ParseInfo parse_info(handles.main_zone(), function); 62 ParseInfo parse_info(handles.main_zone(), function);
62 CompilationInfo info(&parse_info); 63 CompilationInfo info(&parse_info);
63 CallDescriptor* descriptor = Linkage::ComputeIncoming(info.zone(), &info); 64 CallDescriptor* descriptor = Linkage::ComputeIncoming(info.zone(), &info);
64 CHECK(descriptor); 65 CHECK(descriptor);
65 66
66 CHECK_EQ(1 + i, static_cast<int>(descriptor->JSParameterCount())); 67 CHECK_EQ(1 + i, static_cast<int>(descriptor->JSParameterCount()));
67 CHECK_EQ(1, static_cast<int>(descriptor->ReturnCount())); 68 CHECK_EQ(1, static_cast<int>(descriptor->ReturnCount()));
68 CHECK_EQ(Operator::kNoProperties, descriptor->properties()); 69 CHECK_EQ(Operator::kNoProperties, descriptor->properties());
69 CHECK_EQ(true, descriptor->IsJSFunctionCall()); 70 CHECK_EQ(true, descriptor->IsJSFunctionCall());
70 } 71 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 105
105 106
106 TEST(TestLinkageRuntimeCall) { 107 TEST(TestLinkageRuntimeCall) {
107 // TODO(titzer): test linkage creation for outgoing runtime calls. 108 // TODO(titzer): test linkage creation for outgoing runtime calls.
108 } 109 }
109 110
110 111
111 TEST(TestLinkageStubCall) { 112 TEST(TestLinkageStubCall) {
112 // TODO(titzer): test linkage creation for outgoing stub calls. 113 // TODO(titzer): test linkage creation for outgoing stub calls.
113 } 114 }
OLDNEW
« no previous file with comments | « test/cctest/compiler/function-tester.h ('k') | test/cctest/compiler/test-pipeline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698