| 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 Immediate(isolate()->factory()->undefined_value())); | 151 Immediate(isolate()->factory()->undefined_value())); |
| 152 __ bind(&ok); | 152 __ bind(&ok); |
| 153 } | 153 } |
| 154 | 154 |
| 155 // Open a frame scope to indicate that there is a frame on the stack. The | 155 // Open a frame scope to indicate that there is a frame on the stack. The |
| 156 // MANUAL indicates that the scope shouldn't actually generate code to set up | 156 // MANUAL indicates that the scope shouldn't actually generate code to set up |
| 157 // the frame (that is done below). | 157 // the frame (that is done below). |
| 158 FrameScope frame_scope(masm_, StackFrame::MANUAL); | 158 FrameScope frame_scope(masm_, StackFrame::MANUAL); |
| 159 | 159 |
| 160 info->set_prologue_offset(masm_->pc_offset()); | 160 info->set_prologue_offset(masm_->pc_offset()); |
| 161 __ push(ebp); // Caller's frame pointer. | 161 { |
| 162 __ mov(ebp, esp); | 162 PredictableCodeSizeScope predictible_code_size_scope( |
| 163 __ push(esi); // Callee's context. | 163 masm_, kNoCodeAgeSequenceLength); |
| 164 __ push(edi); // Callee's JS Function. | 164 if (FLAG_optimize_for_size && FLAG_age_code) { |
| 165 // Pre-age the code. |
| 166 __ call(isolate()->builtins()->MarkCodeAsExecutedOnce(), |
| 167 RelocInfo::CODE_AGE_SEQUENCE); |
| 168 __ Nop(kNoCodeAgeSequenceLength - Assembler::kCallInstructionLength); |
| 169 } else { |
| 170 __ push(ebp); // Caller's frame pointer. |
| 171 __ mov(ebp, esp); |
| 172 __ push(esi); // Callee's context. |
| 173 __ push(edi); // Callee's JS Function. |
| 174 } |
| 175 } |
| 165 info->AddNoFrameRange(0, masm_->pc_offset()); | 176 info->AddNoFrameRange(0, masm_->pc_offset()); |
| 166 | 177 |
| 167 { Comment cmnt(masm_, "[ Allocate locals"); | 178 { Comment cmnt(masm_, "[ Allocate locals"); |
| 168 int locals_count = info->scope()->num_stack_slots(); | 179 int locals_count = info->scope()->num_stack_slots(); |
| 169 // Generators allocate locals, if any, in context slots. | 180 // Generators allocate locals, if any, in context slots. |
| 170 ASSERT(!info->function()->is_generator() || locals_count == 0); | 181 ASSERT(!info->function()->is_generator() || locals_count == 0); |
| 171 if (locals_count == 1) { | 182 if (locals_count == 1) { |
| 172 __ push(Immediate(isolate()->factory()->undefined_value())); | 183 __ push(Immediate(isolate()->factory()->undefined_value())); |
| 173 } else if (locals_count > 1) { | 184 } else if (locals_count > 1) { |
| 174 __ mov(eax, Immediate(isolate()->factory()->undefined_value())); | 185 __ mov(eax, Immediate(isolate()->factory()->undefined_value())); |
| (...skipping 4785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4960 | 4971 |
| 4961 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 4972 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
| 4962 Assembler::target_address_at(call_target_address)); | 4973 Assembler::target_address_at(call_target_address)); |
| 4963 return OSR_AFTER_STACK_CHECK; | 4974 return OSR_AFTER_STACK_CHECK; |
| 4964 } | 4975 } |
| 4965 | 4976 |
| 4966 | 4977 |
| 4967 } } // namespace v8::internal | 4978 } } // namespace v8::internal |
| 4968 | 4979 |
| 4969 #endif // V8_TARGET_ARCH_IA32 | 4980 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |