OLD | NEW |
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 // TODO(jochen): Remove this after the setting is turned on globally. | 5 // TODO(jochen): Remove this after the setting is turned on globally. |
6 #define V8_IMMINENT_DEPRECATION_WARNINGS | 6 #define V8_IMMINENT_DEPRECATION_WARNINGS |
7 | 7 |
8 #include "test/cctest/compiler/function-tester.h" | 8 #include "test/cctest/compiler/function-tester.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 FLAG_allow_natives_syntax = true; | 138 FLAG_allow_natives_syntax = true; |
139 FunctionTester T("(function(a,b) { return %NumberImul(a, b); })"); | 139 FunctionTester T("(function(a,b) { return %NumberImul(a, b); })"); |
140 | 140 |
141 T.CheckCall(T.Val(2730), T.Val(42), T.Val(65)); | 141 T.CheckCall(T.Val(2730), T.Val(42), T.Val(65)); |
142 T.CheckCall(T.Val(798), T.Val(42), T.Val(19)); | 142 T.CheckCall(T.Val(798), T.Val(42), T.Val(19)); |
143 } | 143 } |
144 | 144 |
145 | 145 |
146 TEST(RuntimeCallInline) { | 146 TEST(RuntimeCallInline) { |
147 FLAG_allow_natives_syntax = true; | 147 FLAG_allow_natives_syntax = true; |
148 FunctionTester T("(function(a) { return %_IsSpecObject(a); })"); | 148 FunctionTester T("(function(a) { return %_IsJSReceiver(a); })"); |
149 | 149 |
150 T.CheckCall(T.false_value(), T.Val(23), T.undefined()); | 150 T.CheckCall(T.false_value(), T.Val(23), T.undefined()); |
151 T.CheckCall(T.false_value(), T.Val(4.2), T.undefined()); | 151 T.CheckCall(T.false_value(), T.Val(4.2), T.undefined()); |
152 T.CheckCall(T.false_value(), T.Val("str"), T.undefined()); | 152 T.CheckCall(T.false_value(), T.Val("str"), T.undefined()); |
153 T.CheckCall(T.false_value(), T.true_value(), T.undefined()); | 153 T.CheckCall(T.false_value(), T.true_value(), T.undefined()); |
154 T.CheckCall(T.false_value(), T.false_value(), T.undefined()); | 154 T.CheckCall(T.false_value(), T.false_value(), T.undefined()); |
155 T.CheckCall(T.false_value(), T.undefined(), T.undefined()); | 155 T.CheckCall(T.false_value(), T.undefined(), T.undefined()); |
156 T.CheckCall(T.true_value(), T.NewObject("({})"), T.undefined()); | 156 T.CheckCall(T.true_value(), T.NewObject("({})"), T.undefined()); |
157 T.CheckCall(T.true_value(), T.NewObject("([])"), T.undefined()); | 157 T.CheckCall(T.true_value(), T.NewObject("([])"), T.undefined()); |
158 } | 158 } |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 CHECK(context->Global() | 244 CHECK(context->Global() |
245 ->Set(context, v8_str("foo"), v8::Utils::CallableToLocal(jsfun)) | 245 ->Set(context, v8_str("foo"), v8::Utils::CallableToLocal(jsfun)) |
246 .FromJust()); | 246 .FromJust()); |
247 CompileRun("var x = 24;"); | 247 CompileRun("var x = 24;"); |
248 ExpectObject("foo()", context->Global()); | 248 ExpectObject("foo()", context->Global()); |
249 } | 249 } |
250 | 250 |
251 } // namespace compiler | 251 } // namespace compiler |
252 } // namespace internal | 252 } // namespace internal |
253 } // namespace v8 | 253 } // namespace v8 |
OLD | NEW |