| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #if V8_TARGET_ARCH_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/compiler.h" | |
| 11 #include "src/debug/debug.h" | 10 #include "src/debug/debug.h" |
| 12 #include "src/full-codegen/full-codegen.h" | 11 #include "src/full-codegen/full-codegen.h" |
| 13 #include "src/ia32/frames-ia32.h" | 12 #include "src/ia32/frames-ia32.h" |
| 14 #include "src/ic/ic.h" | 13 #include "src/ic/ic.h" |
| 15 #include "src/parser.h" | 14 #include "src/parser.h" |
| 16 #include "src/scopes.h" | 15 #include "src/scopes.h" |
| 17 | 16 |
| 18 namespace v8 { | 17 namespace v8 { |
| 19 namespace internal { | 18 namespace internal { |
| 20 | 19 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 __ bind(&ok); | 125 __ bind(&ok); |
| 127 } | 126 } |
| 128 | 127 |
| 129 // Open a frame scope to indicate that there is a frame on the stack. The | 128 // Open a frame scope to indicate that there is a frame on the stack. The |
| 130 // MANUAL indicates that the scope shouldn't actually generate code to set up | 129 // MANUAL indicates that the scope shouldn't actually generate code to set up |
| 131 // the frame (that is done below). | 130 // the frame (that is done below). |
| 132 FrameScope frame_scope(masm_, StackFrame::MANUAL); | 131 FrameScope frame_scope(masm_, StackFrame::MANUAL); |
| 133 | 132 |
| 134 info->set_prologue_offset(masm_->pc_offset()); | 133 info->set_prologue_offset(masm_->pc_offset()); |
| 135 __ Prologue(info->IsCodePreAgingActive()); | 134 __ Prologue(info->IsCodePreAgingActive()); |
| 136 info->AddNoFrameRange(0, masm_->pc_offset()); | |
| 137 | 135 |
| 138 { Comment cmnt(masm_, "[ Allocate locals"); | 136 { Comment cmnt(masm_, "[ Allocate locals"); |
| 139 int locals_count = info->scope()->num_stack_slots(); | 137 int locals_count = info->scope()->num_stack_slots(); |
| 140 // Generators allocate locals, if any, in context slots. | 138 // Generators allocate locals, if any, in context slots. |
| 141 DCHECK(!IsGeneratorFunction(literal()->kind()) || locals_count == 0); | 139 DCHECK(!IsGeneratorFunction(literal()->kind()) || locals_count == 0); |
| 142 if (locals_count == 1) { | 140 if (locals_count == 1) { |
| 143 __ push(Immediate(isolate()->factory()->undefined_value())); | 141 __ push(Immediate(isolate()->factory()->undefined_value())); |
| 144 } else if (locals_count > 1) { | 142 } else if (locals_count > 1) { |
| 145 if (locals_count >= 128) { | 143 if (locals_count >= 128) { |
| 146 Label ok; | 144 Label ok; |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 Label ok; | 427 Label ok; |
| 430 __ j(positive, &ok, Label::kNear); | 428 __ j(positive, &ok, Label::kNear); |
| 431 __ push(eax); | 429 __ push(eax); |
| 432 __ call(isolate()->builtins()->InterruptCheck(), | 430 __ call(isolate()->builtins()->InterruptCheck(), |
| 433 RelocInfo::CODE_TARGET); | 431 RelocInfo::CODE_TARGET); |
| 434 __ pop(eax); | 432 __ pop(eax); |
| 435 EmitProfilingCounterReset(); | 433 EmitProfilingCounterReset(); |
| 436 __ bind(&ok); | 434 __ bind(&ok); |
| 437 | 435 |
| 438 SetReturnPosition(literal()); | 436 SetReturnPosition(literal()); |
| 439 int no_frame_start = masm_->pc_offset(); | |
| 440 __ leave(); | 437 __ leave(); |
| 441 | 438 |
| 442 int arg_count = info_->scope()->num_parameters() + 1; | 439 int arg_count = info_->scope()->num_parameters() + 1; |
| 443 int arguments_bytes = arg_count * kPointerSize; | 440 int arguments_bytes = arg_count * kPointerSize; |
| 444 __ Ret(arguments_bytes, ecx); | 441 __ Ret(arguments_bytes, ecx); |
| 445 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); | |
| 446 } | 442 } |
| 447 } | 443 } |
| 448 | 444 |
| 449 | 445 |
| 450 void FullCodeGenerator::StackValueContext::Plug(Variable* var) const { | 446 void FullCodeGenerator::StackValueContext::Plug(Variable* var) const { |
| 451 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); | 447 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
| 452 MemOperand operand = codegen()->VarOperand(var, result_register()); | 448 MemOperand operand = codegen()->VarOperand(var, result_register()); |
| 453 // Memory operands can be pushed directly. | 449 // Memory operands can be pushed directly. |
| 454 __ push(operand); | 450 __ push(operand); |
| 455 } | 451 } |
| (...skipping 4686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5142 Assembler::target_address_at(call_target_address, | 5138 Assembler::target_address_at(call_target_address, |
| 5143 unoptimized_code)); | 5139 unoptimized_code)); |
| 5144 return OSR_AFTER_STACK_CHECK; | 5140 return OSR_AFTER_STACK_CHECK; |
| 5145 } | 5141 } |
| 5146 | 5142 |
| 5147 | 5143 |
| 5148 } // namespace internal | 5144 } // namespace internal |
| 5149 } // namespace v8 | 5145 } // namespace v8 |
| 5150 | 5146 |
| 5151 #endif // V8_TARGET_ARCH_IA32 | 5147 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |