| 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(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/compiler.h" | 10 #include "src/compiler.h" |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 helper.MakeBytecodeForFunctionBody(snippets[i].code_snippet); | 393 helper.MakeBytecodeForFunctionBody(snippets[i].code_snippet); |
| 394 CheckBytecodeArrayEqual(snippets[i], bytecode_array); | 394 CheckBytecodeArrayEqual(snippets[i], bytecode_array); |
| 395 } | 395 } |
| 396 } | 396 } |
| 397 | 397 |
| 398 | 398 |
| 399 TEST(LogicalExpressions) { | 399 TEST(LogicalExpressions) { |
| 400 InitializedHandleScope handle_scope; | 400 InitializedHandleScope handle_scope; |
| 401 BytecodeGeneratorHelper helper; | 401 BytecodeGeneratorHelper helper; |
| 402 | 402 |
| 403 | |
| 404 ExpectedSnippet<int> snippets[] = { | 403 ExpectedSnippet<int> snippets[] = { |
| 405 {"var x = 0; return x || 3;", | 404 {"var x = 0; return x || 3;", |
| 406 1 * kPointerSize, | 405 1 * kPointerSize, |
| 407 1, | 406 1, |
| 408 8, | 407 8, |
| 409 {B(LdaZero), // | 408 {B(LdaZero), // |
| 410 B(Star), R(0), // | 409 B(Star), R(0), // |
| 411 B(JumpIfToBooleanTrue), U8(4), // | 410 B(JumpIfToBooleanTrue), U8(4), // |
| 412 B(LdaSmi8), U8(3), // | 411 B(LdaSmi8), U8(3), // |
| 413 B(Return)}, | 412 B(Return)}, |
| (...skipping 4847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5261 for (size_t i = 0; i < arraysize(snippets); i++) { | 5260 for (size_t i = 0; i < arraysize(snippets); i++) { |
| 5262 Handle<BytecodeArray> bytecode_array = | 5261 Handle<BytecodeArray> bytecode_array = |
| 5263 helper.MakeBytecodeForFunctionBody(snippets[i].code_snippet); | 5262 helper.MakeBytecodeForFunctionBody(snippets[i].code_snippet); |
| 5264 CheckBytecodeArrayEqual(snippets[i], bytecode_array); | 5263 CheckBytecodeArrayEqual(snippets[i], bytecode_array); |
| 5265 } | 5264 } |
| 5266 } | 5265 } |
| 5267 | 5266 |
| 5268 } // namespace interpreter | 5267 } // namespace interpreter |
| 5269 } // namespace internal | 5268 } // namespace internal |
| 5270 } // namespace v8 | 5269 } // namespace v8 |
| OLD | NEW |