OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 106 |
107 ProfileEntryHookStub::MaybeCallEntryHook(masm_); | 107 ProfileEntryHookStub::MaybeCallEntryHook(masm_); |
108 | 108 |
109 #ifdef DEBUG | 109 #ifdef DEBUG |
110 if (strlen(FLAG_stop_at) > 0 && | 110 if (strlen(FLAG_stop_at) > 0 && |
111 info->literal()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { | 111 info->literal()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { |
112 __ stop("stop-at"); | 112 __ stop("stop-at"); |
113 } | 113 } |
114 #endif | 114 #endif |
115 | 115 |
116 // Sloppy mode functions and builtins need to replace the receiver with the | 116 if (FLAG_debug_code && info->ExpectsJSReceiverAsReceiver()) { |
117 // global proxy when called as functions (without an explicit receiver | |
118 // object). | |
119 if (info->MustReplaceUndefinedReceiverWithGlobalProxy()) { | |
120 Label ok; | |
121 int receiver_offset = info->scope()->num_parameters() * kPointerSize; | 117 int receiver_offset = info->scope()->num_parameters() * kPointerSize; |
122 __ LoadP(r5, MemOperand(sp, receiver_offset), r0); | 118 __ LoadP(r5, MemOperand(sp, receiver_offset), r0); |
123 __ CompareRoot(r5, Heap::kUndefinedValueRootIndex); | 119 __ AssertNotSmi(r5); |
124 __ bne(&ok); | 120 __ CompareObjectType(r5, r5, no_reg, FIRST_SPEC_OBJECT_TYPE); |
125 | 121 __ Assert(ge, kSloppyFunctionExpectsJSReceiverReceiver); |
126 __ LoadP(r5, GlobalObjectOperand()); | |
127 __ LoadP(r5, FieldMemOperand(r5, JSGlobalObject::kGlobalProxyOffset)); | |
128 | |
129 __ StoreP(r5, MemOperand(sp, receiver_offset), r0); | |
130 | |
131 __ bind(&ok); | |
132 } | 122 } |
133 | 123 |
134 // Open a frame scope to indicate that there is a frame on the stack. The | 124 // Open a frame scope to indicate that there is a frame on the stack. The |
135 // MANUAL indicates that the scope shouldn't actually generate code to set up | 125 // MANUAL indicates that the scope shouldn't actually generate code to set up |
136 // the frame (that is done below). | 126 // the frame (that is done below). |
137 FrameScope frame_scope(masm_, StackFrame::MANUAL); | 127 FrameScope frame_scope(masm_, StackFrame::MANUAL); |
138 int prologue_offset = masm_->pc_offset(); | 128 int prologue_offset = masm_->pc_offset(); |
139 | 129 |
140 if (prologue_offset) { | 130 if (prologue_offset) { |
141 // Prologue logic requires it's starting address in ip and the | 131 // Prologue logic requires it's starting address in ip and the |
(...skipping 4907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5049 return ON_STACK_REPLACEMENT; | 5039 return ON_STACK_REPLACEMENT; |
5050 } | 5040 } |
5051 | 5041 |
5052 DCHECK(interrupt_address == | 5042 DCHECK(interrupt_address == |
5053 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5043 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5054 return OSR_AFTER_STACK_CHECK; | 5044 return OSR_AFTER_STACK_CHECK; |
5055 } | 5045 } |
5056 } // namespace internal | 5046 } // namespace internal |
5057 } // namespace v8 | 5047 } // namespace v8 |
5058 #endif // V8_TARGET_ARCH_PPC | 5048 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |