| 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 #include "src/api.h" | 5 #include "src/api.h" |
| 6 #include "src/base/utils/random-number-generator.h" | 6 #include "src/base/utils/random-number-generator.h" |
| 7 #include "src/builtins/builtins-promise-gen.h" | 7 #include "src/builtins/builtins-promise-gen.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/code-stub-assembler.h" | 9 #include "src/code-stub-assembler.h" |
| 10 #include "src/compiler/node.h" | 10 #include "src/compiler/node.h" |
| (...skipping 1645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1656 JSObject::SetElement(isolate, array, 0, | 1656 JSObject::SetElement(isolate, array, 0, |
| 1657 Handle<Smi>(Smi::FromInt(1), isolate), SLOPPY) | 1657 Handle<Smi>(Smi::FromInt(1), isolate), SLOPPY) |
| 1658 .Check(); | 1658 .Check(); |
| 1659 JSObject::SetElement(isolate, array, 1, | 1659 JSObject::SetElement(isolate, array, 1, |
| 1660 Handle<Smi>(Smi::FromInt(2), isolate), SLOPPY) | 1660 Handle<Smi>(Smi::FromInt(2), isolate), SLOPPY) |
| 1661 .Check(); | 1661 .Check(); |
| 1662 CodeStubArguments args(this, IntPtrConstant(kNumParams)); | 1662 CodeStubArguments args(this, IntPtrConstant(kNumParams)); |
| 1663 Variable arg_index(this, MachineType::PointerRepresentation()); | 1663 Variable arg_index(this, MachineType::PointerRepresentation()); |
| 1664 Label bailout(this); | 1664 Label bailout(this); |
| 1665 arg_index.Bind(IntPtrConstant(0)); | 1665 arg_index.Bind(IntPtrConstant(0)); |
| 1666 Node* length = BuildAppendJSArray( | 1666 Node* length = BuildAppendJSArray(kind_, HeapConstant(array), args, |
| 1667 kind_, HeapConstant(Handle<HeapObject>(isolate->context(), isolate)), | 1667 arg_index, &bailout); |
| 1668 HeapConstant(array), args, arg_index, &bailout); | |
| 1669 Return(length); | 1668 Return(length); |
| 1670 | 1669 |
| 1671 Bind(&bailout); | 1670 Bind(&bailout); |
| 1672 Return(SmiTag(IntPtrAdd(arg_index.value(), IntPtrConstant(2)))); | 1671 Return(SmiTag(IntPtrAdd(arg_index.value(), IntPtrConstant(2)))); |
| 1673 | 1672 |
| 1674 Handle<Code> code = tester->GenerateCode(); | 1673 Handle<Code> code = tester->GenerateCode(); |
| 1675 CHECK(!code.is_null()); | 1674 CHECK(!code.is_null()); |
| 1676 | 1675 |
| 1677 FunctionTester ft(code, kNumParams); | 1676 FunctionTester ft(code, kNumParams); |
| 1678 | 1677 |
| (...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2496 m.Return(m.SmiConstant(0)); | 2495 m.Return(m.SmiConstant(0)); |
| 2497 | 2496 |
| 2498 Handle<Code> code = data.GenerateCode(); | 2497 Handle<Code> code = data.GenerateCode(); |
| 2499 CHECK(!code.is_null()); | 2498 CHECK(!code.is_null()); |
| 2500 FunctionTester ft(code, kNumParams); | 2499 FunctionTester ft(code, kNumParams); |
| 2501 CHECK_EQ(1, Handle<Smi>::cast(ft.Call().ToHandleChecked())->value()); | 2500 CHECK_EQ(1, Handle<Smi>::cast(ft.Call().ToHandleChecked())->value()); |
| 2502 } | 2501 } |
| 2503 | 2502 |
| 2504 } // namespace internal | 2503 } // namespace internal |
| 2505 } // namespace v8 | 2504 } // namespace v8 |
| OLD | NEW |