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 3947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3958 instr, | 3958 instr, |
3959 CALL_AS_FUNCTION, | 3959 CALL_AS_FUNCTION, |
3960 A1_UNINITIALIZED); | 3960 A1_UNINITIALIZED); |
3961 } | 3961 } |
3962 | 3962 |
3963 | 3963 |
3964 void LCodeGen::DoCallNew(LCallNew* instr) { | 3964 void LCodeGen::DoCallNew(LCallNew* instr) { |
3965 ASSERT(ToRegister(instr->constructor()).is(a1)); | 3965 ASSERT(ToRegister(instr->constructor()).is(a1)); |
3966 ASSERT(ToRegister(instr->result()).is(v0)); | 3966 ASSERT(ToRegister(instr->result()).is(v0)); |
3967 | 3967 |
| 3968 __ li(a0, Operand(instr->arity())); |
| 3969 if (FLAG_optimize_constructed_arrays) { |
| 3970 // No cell in a2 for construct type feedback in optimized code |
| 3971 Handle<Object> undefined_value(isolate()->heap()->undefined_value(), |
| 3972 isolate()); |
| 3973 __ li(a2, Operand(undefined_value)); |
| 3974 } |
3968 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS); | 3975 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS); |
| 3976 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
| 3977 } |
| 3978 |
| 3979 |
| 3980 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
| 3981 ASSERT(ToRegister(instr->constructor()).is(a1)); |
| 3982 ASSERT(ToRegister(instr->result()).is(v0)); |
| 3983 ASSERT(FLAG_optimize_constructed_arrays); |
| 3984 |
3969 __ li(a0, Operand(instr->arity())); | 3985 __ li(a0, Operand(instr->arity())); |
3970 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 3986 __ li(a2, Operand(instr->hydrogen()->property_cell())); |
| 3987 Handle<Code> array_construct_code = |
| 3988 isolate()->builtins()->ArrayConstructCode(); |
| 3989 |
| 3990 CallCode(array_construct_code, RelocInfo::CONSTRUCT_CALL, instr); |
3971 } | 3991 } |
3972 | 3992 |
3973 | 3993 |
3974 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { | 3994 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { |
3975 CallRuntime(instr->function(), instr->arity(), instr); | 3995 CallRuntime(instr->function(), instr->arity(), instr); |
3976 } | 3996 } |
3977 | 3997 |
3978 | 3998 |
3979 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { | 3999 void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
3980 Register object = ToRegister(instr->object()); | 4000 Register object = ToRegister(instr->object()); |
(...skipping 2083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6064 __ Subu(scratch, result, scratch); | 6084 __ Subu(scratch, result, scratch); |
6065 __ lw(result, FieldMemOperand(scratch, | 6085 __ lw(result, FieldMemOperand(scratch, |
6066 FixedArray::kHeaderSize - kPointerSize)); | 6086 FixedArray::kHeaderSize - kPointerSize)); |
6067 __ bind(&done); | 6087 __ bind(&done); |
6068 } | 6088 } |
6069 | 6089 |
6070 | 6090 |
6071 #undef __ | 6091 #undef __ |
6072 | 6092 |
6073 } } // namespace v8::internal | 6093 } } // namespace v8::internal |
OLD | NEW |