| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 __ movq(args.GetReceiverOperand(), kScratchRegister); | 145 __ movq(args.GetReceiverOperand(), kScratchRegister); |
| 146 __ bind(&ok); | 146 __ bind(&ok); |
| 147 } | 147 } |
| 148 | 148 |
| 149 // Open a frame scope to indicate that there is a frame on the stack. The | 149 // Open a frame scope to indicate that there is a frame on the stack. The |
| 150 // MANUAL indicates that the scope shouldn't actually generate code to set up | 150 // MANUAL indicates that the scope shouldn't actually generate code to set up |
| 151 // the frame (that is done below). | 151 // the frame (that is done below). |
| 152 FrameScope frame_scope(masm_, StackFrame::MANUAL); | 152 FrameScope frame_scope(masm_, StackFrame::MANUAL); |
| 153 | 153 |
| 154 info->set_prologue_offset(masm_->pc_offset()); | 154 info->set_prologue_offset(masm_->pc_offset()); |
| 155 __ push(rbp); // Caller's frame pointer. | 155 __ Prologue(BUILD_FUNCTION_FRAME); |
| 156 __ movq(rbp, rsp); | |
| 157 __ push(rsi); // Callee's context. | |
| 158 __ push(rdi); // Callee's JS Function. | |
| 159 info->AddNoFrameRange(0, masm_->pc_offset()); | 156 info->AddNoFrameRange(0, masm_->pc_offset()); |
| 160 | 157 |
| 161 { Comment cmnt(masm_, "[ Allocate locals"); | 158 { Comment cmnt(masm_, "[ Allocate locals"); |
| 162 int locals_count = info->scope()->num_stack_slots(); | 159 int locals_count = info->scope()->num_stack_slots(); |
| 163 // Generators allocate locals, if any, in context slots. | 160 // Generators allocate locals, if any, in context slots. |
| 164 ASSERT(!info->function()->is_generator() || locals_count == 0); | 161 ASSERT(!info->function()->is_generator() || locals_count == 0); |
| 165 if (locals_count == 1) { | 162 if (locals_count == 1) { |
| 166 __ PushRoot(Heap::kUndefinedValueRootIndex); | 163 __ PushRoot(Heap::kUndefinedValueRootIndex); |
| 167 } else if (locals_count > 1) { | 164 } else if (locals_count > 1) { |
| 168 __ LoadRoot(rdx, Heap::kUndefinedValueRootIndex); | 165 __ LoadRoot(rdx, Heap::kUndefinedValueRootIndex); |
| (...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1122 __ jmp(&exit); | 1119 __ jmp(&exit); |
| 1123 | 1120 |
| 1124 // We got a fixed array in register rax. Iterate through that. | 1121 // We got a fixed array in register rax. Iterate through that. |
| 1125 Label non_proxy; | 1122 Label non_proxy; |
| 1126 __ bind(&fixed_array); | 1123 __ bind(&fixed_array); |
| 1127 | 1124 |
| 1128 Handle<Cell> cell = isolate()->factory()->NewCell( | 1125 Handle<Cell> cell = isolate()->factory()->NewCell( |
| 1129 Handle<Object>(Smi::FromInt(TypeFeedbackCells::kForInFastCaseMarker), | 1126 Handle<Object>(Smi::FromInt(TypeFeedbackCells::kForInFastCaseMarker), |
| 1130 isolate())); | 1127 isolate())); |
| 1131 RecordTypeFeedbackCell(stmt->ForInFeedbackId(), cell); | 1128 RecordTypeFeedbackCell(stmt->ForInFeedbackId(), cell); |
| 1132 __ LoadHeapObject(rbx, cell); | 1129 __ Move(rbx, cell); |
| 1133 __ Move(FieldOperand(rbx, Cell::kValueOffset), | 1130 __ Move(FieldOperand(rbx, Cell::kValueOffset), |
| 1134 Smi::FromInt(TypeFeedbackCells::kForInSlowCaseMarker)); | 1131 Smi::FromInt(TypeFeedbackCells::kForInSlowCaseMarker)); |
| 1135 | 1132 |
| 1136 __ Move(rbx, Smi::FromInt(1)); // Smi indicates slow check | 1133 __ Move(rbx, Smi::FromInt(1)); // Smi indicates slow check |
| 1137 __ movq(rcx, Operand(rsp, 0 * kPointerSize)); // Get enumerated object | 1134 __ movq(rcx, Operand(rsp, 0 * kPointerSize)); // Get enumerated object |
| 1138 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); | 1135 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); |
| 1139 __ CmpObjectType(rcx, LAST_JS_PROXY_TYPE, rcx); | 1136 __ CmpObjectType(rcx, LAST_JS_PROXY_TYPE, rcx); |
| 1140 __ j(above, &non_proxy); | 1137 __ j(above, &non_proxy); |
| 1141 __ Move(rbx, Smi::FromInt(0)); // Zero indicates proxy | 1138 __ Move(rbx, Smi::FromInt(0)); // Zero indicates proxy |
| 1142 __ bind(&non_proxy); | 1139 __ bind(&non_proxy); |
| (...skipping 3804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4947 | 4944 |
| 4948 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 4945 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
| 4949 Assembler::target_address_at(call_target_address)); | 4946 Assembler::target_address_at(call_target_address)); |
| 4950 return OSR_AFTER_STACK_CHECK; | 4947 return OSR_AFTER_STACK_CHECK; |
| 4951 } | 4948 } |
| 4952 | 4949 |
| 4953 | 4950 |
| 4954 } } // namespace v8::internal | 4951 } } // namespace v8::internal |
| 4955 | 4952 |
| 4956 #endif // V8_TARGET_ARCH_X64 | 4953 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |