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 2618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2629 RecordPosition(pointers->position()); | 2629 RecordPosition(pointers->position()); |
2630 | 2630 |
2631 // Invoke function. | 2631 // Invoke function. |
2632 __ SetCallKind(rcx, call_kind); | 2632 __ SetCallKind(rcx, call_kind); |
2633 if (*function == *info()->closure()) { | 2633 if (*function == *info()->closure()) { |
2634 __ CallSelf(); | 2634 __ CallSelf(); |
2635 } else { | 2635 } else { |
2636 __ call(FieldOperand(rdi, JSFunction::kCodeEntryOffset)); | 2636 __ call(FieldOperand(rdi, JSFunction::kCodeEntryOffset)); |
2637 } | 2637 } |
2638 | 2638 |
2639 // Setup deoptimization. | 2639 // Set up deoptimization. |
2640 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT, 0); | 2640 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT, 0); |
2641 | 2641 |
2642 // Restore context. | 2642 // Restore context. |
2643 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); | 2643 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
2644 } | 2644 } |
2645 | 2645 |
2646 | 2646 |
2647 void LCodeGen::DoCallConstantFunction(LCallConstantFunction* instr) { | 2647 void LCodeGen::DoCallConstantFunction(LCallConstantFunction* instr) { |
2648 ASSERT(ToRegister(instr->result()).is(rax)); | 2648 ASSERT(ToRegister(instr->result()).is(rax)); |
2649 __ LoadHeapObject(rdi, instr->function()); | 2649 __ LoadHeapObject(rdi, instr->function()); |
(...skipping 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3856 __ movq(rbx, FieldOperand(rax, HeapObject::kMapOffset)); | 3856 __ movq(rbx, FieldOperand(rax, HeapObject::kMapOffset)); |
3857 // Load the map's "bit field 2". | 3857 // Load the map's "bit field 2". |
3858 __ movb(rbx, FieldOperand(rbx, Map::kBitField2Offset)); | 3858 __ movb(rbx, FieldOperand(rbx, Map::kBitField2Offset)); |
3859 // Retrieve elements_kind from bit field 2. | 3859 // Retrieve elements_kind from bit field 2. |
3860 __ and_(rbx, Immediate(Map::kElementsKindMask)); | 3860 __ and_(rbx, Immediate(Map::kElementsKindMask)); |
3861 __ cmpb(rbx, Immediate(boilerplate_elements_kind << | 3861 __ cmpb(rbx, Immediate(boilerplate_elements_kind << |
3862 Map::kElementsKindShift)); | 3862 Map::kElementsKindShift)); |
3863 DeoptimizeIf(not_equal, instr->environment()); | 3863 DeoptimizeIf(not_equal, instr->environment()); |
3864 } | 3864 } |
3865 | 3865 |
3866 // Setup the parameters to the stub/runtime call. | 3866 // Set up the parameters to the stub/runtime call. |
3867 __ movq(rax, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | 3867 __ movq(rax, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
3868 __ push(FieldOperand(rax, JSFunction::kLiteralsOffset)); | 3868 __ push(FieldOperand(rax, JSFunction::kLiteralsOffset)); |
3869 __ Push(Smi::FromInt(instr->hydrogen()->literal_index())); | 3869 __ Push(Smi::FromInt(instr->hydrogen()->literal_index())); |
3870 // Boilerplate already exists, constant elements are never accessed. | 3870 // Boilerplate already exists, constant elements are never accessed. |
3871 // Pass an empty fixed array. | 3871 // Pass an empty fixed array. |
3872 __ Push(Handle<FixedArray>(heap->empty_fixed_array())); | 3872 __ Push(Handle<FixedArray>(heap->empty_fixed_array())); |
3873 | 3873 |
3874 // Pick the right runtime function or stub to call. | 3874 // Pick the right runtime function or stub to call. |
3875 int length = instr->hydrogen()->length(); | 3875 int length = instr->hydrogen()->length(); |
3876 if (instr->hydrogen()->IsCopyOnWrite()) { | 3876 if (instr->hydrogen()->IsCopyOnWrite()) { |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3957 __ LoadHeapObject(rbx, instr->hydrogen()->boilerplate()); | 3957 __ LoadHeapObject(rbx, instr->hydrogen()->boilerplate()); |
3958 EmitDeepCopy(instr->hydrogen()->boilerplate(), rax, rbx, &offset); | 3958 EmitDeepCopy(instr->hydrogen()->boilerplate(), rax, rbx, &offset); |
3959 ASSERT_EQ(size, offset); | 3959 ASSERT_EQ(size, offset); |
3960 } | 3960 } |
3961 | 3961 |
3962 | 3962 |
3963 void LCodeGen::DoObjectLiteralGeneric(LObjectLiteralGeneric* instr) { | 3963 void LCodeGen::DoObjectLiteralGeneric(LObjectLiteralGeneric* instr) { |
3964 Handle<FixedArray> constant_properties = | 3964 Handle<FixedArray> constant_properties = |
3965 instr->hydrogen()->constant_properties(); | 3965 instr->hydrogen()->constant_properties(); |
3966 | 3966 |
3967 // Setup the parameters to the stub/runtime call. | 3967 // Set up the parameters to the stub/runtime call. |
3968 __ movq(rax, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | 3968 __ movq(rax, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
3969 __ push(FieldOperand(rax, JSFunction::kLiteralsOffset)); | 3969 __ push(FieldOperand(rax, JSFunction::kLiteralsOffset)); |
3970 __ Push(Smi::FromInt(instr->hydrogen()->literal_index())); | 3970 __ Push(Smi::FromInt(instr->hydrogen()->literal_index())); |
3971 __ Push(constant_properties); | 3971 __ Push(constant_properties); |
3972 int flags = instr->hydrogen()->fast_elements() | 3972 int flags = instr->hydrogen()->fast_elements() |
3973 ? ObjectLiteral::kFastElements | 3973 ? ObjectLiteral::kFastElements |
3974 : ObjectLiteral::kNoFlags; | 3974 : ObjectLiteral::kNoFlags; |
3975 flags |= instr->hydrogen()->has_function() | 3975 flags |= instr->hydrogen()->has_function() |
3976 ? ObjectLiteral::kHasFunction | 3976 ? ObjectLiteral::kHasFunction |
3977 : ObjectLiteral::kNoFlags; | 3977 : ObjectLiteral::kNoFlags; |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4337 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); | 4337 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); |
4338 ASSERT(osr_pc_offset_ == -1); | 4338 ASSERT(osr_pc_offset_ == -1); |
4339 osr_pc_offset_ = masm()->pc_offset(); | 4339 osr_pc_offset_ = masm()->pc_offset(); |
4340 } | 4340 } |
4341 | 4341 |
4342 #undef __ | 4342 #undef __ |
4343 | 4343 |
4344 } } // namespace v8::internal | 4344 } } // namespace v8::internal |
4345 | 4345 |
4346 #endif // V8_TARGET_ARCH_X64 | 4346 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |