| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1517 | 1517 |
| 1518 // Initial map for the builtin Array function should be a map. | 1518 // Initial map for the builtin Array function should be a map. |
| 1519 __ movq(rcx, FieldOperand(rdi, JSFunction::kPrototypeOrInitialMapOffset)); | 1519 __ movq(rcx, FieldOperand(rdi, JSFunction::kPrototypeOrInitialMapOffset)); |
| 1520 // Will both indicate a NULL and a Smi. | 1520 // Will both indicate a NULL and a Smi. |
| 1521 STATIC_ASSERT(kSmiTag == 0); | 1521 STATIC_ASSERT(kSmiTag == 0); |
| 1522 Condition not_smi = NegateCondition(masm->CheckSmi(rcx)); | 1522 Condition not_smi = NegateCondition(masm->CheckSmi(rcx)); |
| 1523 __ Check(not_smi, "Unexpected initial map for Array function"); | 1523 __ Check(not_smi, "Unexpected initial map for Array function"); |
| 1524 __ CmpObjectType(rcx, MAP_TYPE, rcx); | 1524 __ CmpObjectType(rcx, MAP_TYPE, rcx); |
| 1525 __ Check(equal, "Unexpected initial map for Array function"); | 1525 __ Check(equal, "Unexpected initial map for Array function"); |
| 1526 | 1526 |
| 1527 // We should either have undefined in ebx or a valid jsglobalpropertycell | 1527 if (FLAG_optimize_constructed_arrays) { |
| 1528 Label okay_here; | 1528 // We should either have undefined in ebx or a valid jsglobalpropertycell |
| 1529 Handle<Object> undefined_sentinel( | 1529 Label okay_here; |
| 1530 masm->isolate()->factory()->undefined_value()); | 1530 Handle<Object> undefined_sentinel( |
| 1531 Handle<Map> global_property_cell_map( | 1531 masm->isolate()->factory()->undefined_value()); |
| 1532 masm->isolate()->heap()->global_property_cell_map()); | 1532 Handle<Map> global_property_cell_map( |
| 1533 __ Cmp(rbx, undefined_sentinel); | 1533 masm->isolate()->heap()->global_property_cell_map()); |
| 1534 __ j(equal, &okay_here); | 1534 __ Cmp(rbx, undefined_sentinel); |
| 1535 __ Cmp(FieldOperand(rbx, 0), global_property_cell_map); | 1535 __ j(equal, &okay_here); |
| 1536 __ Assert(equal, "Expected property cell in register rbx"); | 1536 __ Cmp(FieldOperand(rbx, 0), global_property_cell_map); |
| 1537 __ bind(&okay_here); | 1537 __ Assert(equal, "Expected property cell in register rbx"); |
| 1538 __ bind(&okay_here); |
| 1539 } |
| 1538 } | 1540 } |
| 1539 | 1541 |
| 1540 if (FLAG_optimize_constructed_arrays) { | 1542 if (FLAG_optimize_constructed_arrays) { |
| 1541 Label not_zero_case, not_one_case; | 1543 Label not_zero_case, not_one_case; |
| 1542 __ testq(rax, rax); | 1544 __ testq(rax, rax); |
| 1543 __ j(not_zero, ¬_zero_case); | 1545 __ j(not_zero, ¬_zero_case); |
| 1544 ArrayNoArgumentConstructorStub no_argument_stub; | 1546 ArrayNoArgumentConstructorStub no_argument_stub; |
| 1545 __ TailCallStub(&no_argument_stub); | 1547 __ TailCallStub(&no_argument_stub); |
| 1546 | 1548 |
| 1547 __ bind(¬_zero_case); | 1549 __ bind(¬_zero_case); |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1873 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); | 1875 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); |
| 1874 generator.Generate(); | 1876 generator.Generate(); |
| 1875 } | 1877 } |
| 1876 | 1878 |
| 1877 | 1879 |
| 1878 #undef __ | 1880 #undef __ |
| 1879 | 1881 |
| 1880 } } // namespace v8::internal | 1882 } } // namespace v8::internal |
| 1881 | 1883 |
| 1882 #endif // V8_TARGET_ARCH_X64 | 1884 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |