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_X87 | 5 #if V8_TARGET_ARCH_X87 |
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/debug/debug.h" | 10 #include "src/debug/debug.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 | 98 |
99 ProfileEntryHookStub::MaybeCallEntryHook(masm_); | 99 ProfileEntryHookStub::MaybeCallEntryHook(masm_); |
100 | 100 |
101 #ifdef DEBUG | 101 #ifdef DEBUG |
102 if (strlen(FLAG_stop_at) > 0 && | 102 if (strlen(FLAG_stop_at) > 0 && |
103 literal()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { | 103 literal()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { |
104 __ int3(); | 104 __ int3(); |
105 } | 105 } |
106 #endif | 106 #endif |
107 | 107 |
108 // Sloppy mode functions and builtins need to replace the receiver with the | 108 if (FLAG_debug_code && info->ExpectsJSReceiverAsReceiver()) { |
109 // global proxy when called as functions (without an explicit receiver | |
110 // object). | |
111 if (info->MustReplaceUndefinedReceiverWithGlobalProxy()) { | |
112 Label ok; | |
113 // +1 for return address. | |
114 int receiver_offset = (info->scope()->num_parameters() + 1) * kPointerSize; | 109 int receiver_offset = (info->scope()->num_parameters() + 1) * kPointerSize; |
115 __ mov(ecx, Operand(esp, receiver_offset)); | 110 __ mov(ecx, Operand(esp, receiver_offset)); |
116 | 111 __ AssertNotSmi(ecx); |
117 __ cmp(ecx, isolate()->factory()->undefined_value()); | 112 __ CmpObjectType(ecx, FIRST_SPEC_OBJECT_TYPE, ecx); |
118 __ j(not_equal, &ok, Label::kNear); | 113 __ Assert(above_equal, kSloppyFunctionExpectsJSReceiverReceiver); |
119 | |
120 __ mov(ecx, GlobalObjectOperand()); | |
121 __ mov(ecx, FieldOperand(ecx, JSGlobalObject::kGlobalProxyOffset)); | |
122 | |
123 __ mov(Operand(esp, receiver_offset), ecx); | |
124 | |
125 __ bind(&ok); | |
126 } | 114 } |
127 | 115 |
128 // Open a frame scope to indicate that there is a frame on the stack. The | 116 // Open a frame scope to indicate that there is a frame on the stack. The |
129 // MANUAL indicates that the scope shouldn't actually generate code to set up | 117 // MANUAL indicates that the scope shouldn't actually generate code to set up |
130 // the frame (that is done below). | 118 // the frame (that is done below). |
131 FrameScope frame_scope(masm_, StackFrame::MANUAL); | 119 FrameScope frame_scope(masm_, StackFrame::MANUAL); |
132 | 120 |
133 info->set_prologue_offset(masm_->pc_offset()); | 121 info->set_prologue_offset(masm_->pc_offset()); |
134 __ Prologue(info->IsCodePreAgingActive()); | 122 __ Prologue(info->IsCodePreAgingActive()); |
135 | 123 |
(...skipping 4825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4961 Assembler::target_address_at(call_target_address, | 4949 Assembler::target_address_at(call_target_address, |
4962 unoptimized_code)); | 4950 unoptimized_code)); |
4963 return OSR_AFTER_STACK_CHECK; | 4951 return OSR_AFTER_STACK_CHECK; |
4964 } | 4952 } |
4965 | 4953 |
4966 | 4954 |
4967 } // namespace internal | 4955 } // namespace internal |
4968 } // namespace v8 | 4956 } // namespace v8 |
4969 | 4957 |
4970 #endif // V8_TARGET_ARCH_X87 | 4958 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |