OLD | NEW |
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(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 <utility> | 8 #include <utility> |
9 | 9 |
10 #include "src/compiler/pipeline.h" | 10 #include "src/compiler/pipeline.h" |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 BytecodeGraphTester::NewObject("({name : 'abc'})")}}, | 313 BytecodeGraphTester::NewObject("({name : 'abc'})")}}, |
314 {"'use strict'; return p1.val;", | 314 {"'use strict'; return p1.val;", |
315 {factory->NewNumberFromInt(10), | 315 {factory->NewNumberFromInt(10), |
316 BytecodeGraphTester::NewObject("({val : 10 })")}}, | 316 BytecodeGraphTester::NewObject("({val : 10 })")}}, |
317 {"'use strict'; return p1[\"val\"];", | 317 {"'use strict'; return p1[\"val\"];", |
318 {factory->NewNumberFromInt(10), | 318 {factory->NewNumberFromInt(10), |
319 BytecodeGraphTester::NewObject("({val : 10, name : 'abc'})")}}, | 319 BytecodeGraphTester::NewObject("({val : 10, name : 'abc'})")}}, |
320 {"var b;\n" REPEAT_127(SPACE, " b = p1.name; ") " return p1.name;\n", | 320 {"var b;\n" REPEAT_127(SPACE, " b = p1.name; ") " return p1.name;\n", |
321 {factory->NewStringFromStaticChars("abc"), | 321 {factory->NewStringFromStaticChars("abc"), |
322 BytecodeGraphTester::NewObject("({name : 'abc'})")}}, | 322 BytecodeGraphTester::NewObject("({name : 'abc'})")}}, |
323 {"'use strict'; var b;\n" | 323 {"'use strict'; var b;\n" REPEAT_127( |
324 REPEAT_127(SPACE, " b = p1.name; ") | 324 SPACE, " b = p1.name; ") "return p1.name;\n", |
325 "return p1.name;\n", | |
326 {factory->NewStringFromStaticChars("abc"), | 325 {factory->NewStringFromStaticChars("abc"), |
327 BytecodeGraphTester::NewObject("({ name : 'abc'})")}}, | 326 BytecodeGraphTester::NewObject("({ name : 'abc'})")}}, |
328 }; | 327 }; |
329 | 328 |
330 size_t num_snippets = sizeof(snippets) / sizeof(snippets[0]); | 329 size_t num_snippets = sizeof(snippets) / sizeof(snippets[0]); |
331 for (size_t i = 0; i < num_snippets; i++) { | 330 for (size_t i = 0; i < num_snippets; i++) { |
332 ScopedVector<char> script(2048); | 331 ScopedVector<char> script(2048); |
333 SNPrintF(script, "function %s(p1) { %s };\n%s(0);", kFunctionName, | 332 SNPrintF(script, "function %s(p1) { %s };\n%s(0);", kFunctionName, |
334 snippets[i].code_snippet, kFunctionName); | 333 snippets[i].code_snippet, kFunctionName); |
335 | 334 |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
947 } | 946 } |
948 | 947 |
949 | 948 |
950 TEST(BytecodeGraphBuilderTestInstanceOf) { | 949 TEST(BytecodeGraphBuilderTestInstanceOf) { |
951 // TODO(mythria): Add tests when CreateLiterals/CreateClousre are supported. | 950 // TODO(mythria): Add tests when CreateLiterals/CreateClousre are supported. |
952 } | 951 } |
953 | 952 |
954 } // namespace compiler | 953 } // namespace compiler |
955 } // namespace internal | 954 } // namespace internal |
956 } // namespace v8 | 955 } // namespace v8 |
OLD | NEW |