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/codegen.h" | 8 #include "src/codegen.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
(...skipping 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1267 } | 1267 } |
1268 __ ret(1 * kPointerSize); | 1268 __ ret(1 * kPointerSize); |
1269 | 1269 |
1270 // 3. Raise a TypeError if the receiver is not a date. | 1270 // 3. Raise a TypeError if the receiver is not a date. |
1271 __ bind(&receiver_not_date); | 1271 __ bind(&receiver_not_date); |
1272 { | 1272 { |
1273 FrameScope scope(masm, StackFrame::MANUAL); | 1273 FrameScope scope(masm, StackFrame::MANUAL); |
1274 __ Move(ebx, Immediate(0)); | 1274 __ Move(ebx, Immediate(0)); |
1275 __ EnterBuiltinFrame(esi, edi, ebx); | 1275 __ EnterBuiltinFrame(esi, edi, ebx); |
1276 __ CallRuntime(Runtime::kThrowNotDateError); | 1276 __ CallRuntime(Runtime::kThrowNotDateError); |
| 1277 |
| 1278 // It's far from obvious, but this final trailing instruction after the call |
| 1279 // is required for StackFrame::LookupCode to work correctly. To illustrate |
| 1280 // why: if call were the final instruction in the code object, then the pc |
| 1281 // (== return address) would point beyond the code object when the stack is |
| 1282 // traversed. When we then try to look up the code object through |
| 1283 // StackFrame::LookupCode, we actually return the next code object that |
| 1284 // happens to be on the same page in memory. |
| 1285 // TODO(jgruber): A proper fix for this would be nice. |
| 1286 __ nop(); |
1277 } | 1287 } |
1278 } | 1288 } |
1279 | 1289 |
1280 // static | 1290 // static |
1281 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { | 1291 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { |
1282 // ----------- S t a t e ------------- | 1292 // ----------- S t a t e ------------- |
1283 // -- eax : argc | 1293 // -- eax : argc |
1284 // -- esp[0] : return address | 1294 // -- esp[0] : return address |
1285 // -- esp[4] : argArray | 1295 // -- esp[4] : argArray |
1286 // -- esp[8] : thisArg | 1296 // -- esp[8] : thisArg |
(...skipping 1768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3055 | 3065 |
3056 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { | 3066 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { |
3057 Generate_OnStackReplacementHelper(masm, true); | 3067 Generate_OnStackReplacementHelper(masm, true); |
3058 } | 3068 } |
3059 | 3069 |
3060 #undef __ | 3070 #undef __ |
3061 } // namespace internal | 3071 } // namespace internal |
3062 } // namespace v8 | 3072 } // namespace v8 |
3063 | 3073 |
3064 #endif // V8_TARGET_ARCH_X87 | 3074 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |