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 #include "test/cctest/compiler/function-tester.h" | 5 #include "test/cctest/compiler/function-tester.h" |
6 | 6 |
7 namespace v8 { | 7 namespace v8 { |
8 namespace internal { | 8 namespace internal { |
9 namespace compiler { | 9 namespace compiler { |
10 | 10 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 T.CheckFalse(T.NewObject("(/x/)")); | 129 T.CheckFalse(T.NewObject("(/x/)")); |
130 T.CheckFalse(T.undefined()); | 130 T.CheckFalse(T.undefined()); |
131 T.CheckTrue(T.Val(1)); | 131 T.CheckTrue(T.Val(1)); |
132 T.CheckFalse(T.Val(1.1)); | 132 T.CheckFalse(T.Val(1.1)); |
133 T.CheckFalse(T.Val(-0.0)); | 133 T.CheckFalse(T.Val(-0.0)); |
134 T.CheckTrue(T.Val(-2)); | 134 T.CheckTrue(T.Val(-2)); |
135 T.CheckFalse(T.Val(-2.3)); | 135 T.CheckFalse(T.Val(-2.3)); |
136 } | 136 } |
137 | 137 |
138 | 138 |
139 TEST(ObjectEquals) { | |
140 FunctionTester T("(function(a,b) { return %_ObjectEquals(a,b); })", flags); | |
141 CompileRun("var o = {}"); | |
142 | |
143 T.CheckTrue(T.NewObject("(o)"), T.NewObject("(o)")); | |
144 T.CheckTrue(T.Val("internal"), T.Val("internal")); | |
145 T.CheckTrue(T.true_value(), T.true_value()); | |
146 T.CheckFalse(T.true_value(), T.false_value()); | |
147 T.CheckFalse(T.NewObject("({})"), T.NewObject("({})")); | |
148 T.CheckFalse(T.Val("a"), T.Val("b")); | |
149 } | |
150 | |
151 | |
152 TEST(OneByteSeqStringGetChar) { | 139 TEST(OneByteSeqStringGetChar) { |
153 FunctionTester T("(function(a,b) { return %_OneByteSeqStringGetChar(a,b); })", | 140 FunctionTester T("(function(a,b) { return %_OneByteSeqStringGetChar(a,b); })", |
154 flags); | 141 flags); |
155 | 142 |
156 Handle<SeqOneByteString> string = | 143 Handle<SeqOneByteString> string = |
157 T.main_isolate()->factory()->NewRawOneByteString(3).ToHandleChecked(); | 144 T.main_isolate()->factory()->NewRawOneByteString(3).ToHandleChecked(); |
158 string->SeqOneByteStringSet(0, 'b'); | 145 string->SeqOneByteStringSet(0, 'b'); |
159 string->SeqOneByteStringSet(1, 'a'); | 146 string->SeqOneByteStringSet(1, 'a'); |
160 string->SeqOneByteStringSet(2, 'r'); | 147 string->SeqOneByteStringSet(2, 'r'); |
161 T.CheckCall(T.Val('b'), string, T.Val(0.0)); | 148 T.CheckCall(T.Val('b'), string, T.Val(0.0)); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 | 267 |
281 T.CheckCall(T.Val("a"), T.Val("a")); | 268 T.CheckCall(T.Val("a"), T.Val("a")); |
282 T.CheckCall(T.Val("b"), T.NewObject("(new String('b'))")); | 269 T.CheckCall(T.Val("b"), T.NewObject("(new String('b'))")); |
283 T.CheckCall(T.Val(123), T.Val(123)); | 270 T.CheckCall(T.Val(123), T.Val(123)); |
284 T.CheckCall(T.Val(456), T.NewObject("(new Number(456))")); | 271 T.CheckCall(T.Val(456), T.NewObject("(new Number(456))")); |
285 } | 272 } |
286 | 273 |
287 } // namespace compiler | 274 } // namespace compiler |
288 } // namespace internal | 275 } // namespace internal |
289 } // namespace v8 | 276 } // namespace v8 |
OLD | NEW |