| 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/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| 11 #include "src/debug/debug.h" | 11 #include "src/debug/debug.h" |
| 12 #include "src/full-codegen/full-codegen.h" | 12 #include "src/full-codegen/full-codegen.h" |
| 13 #include "src/ic/ic.h" | 13 #include "src/ic/ic.h" |
| 14 #include "src/parsing/parser.h" | 14 #include "src/parsing/parser.h" |
| 15 #include "src/x87/frames-x87.h" | 15 #include "src/x87/frames-x87.h" |
| 16 | 16 |
| 17 namespace v8 { | 17 namespace v8 { |
| 18 namespace internal { | 18 namespace internal { |
| 19 | 19 |
| 20 #define __ ACCESS_MASM(masm_) | 20 #define __ ACCESS_MASM(masm()) |
| 21 | |
| 22 | 21 |
| 23 class JumpPatchSite BASE_EMBEDDED { | 22 class JumpPatchSite BASE_EMBEDDED { |
| 24 public: | 23 public: |
| 25 explicit JumpPatchSite(MacroAssembler* masm) : masm_(masm) { | 24 explicit JumpPatchSite(MacroAssembler* masm) : masm_(masm) { |
| 26 #ifdef DEBUG | 25 #ifdef DEBUG |
| 27 info_emitted_ = false; | 26 info_emitted_ = false; |
| 28 #endif | 27 #endif |
| 29 } | 28 } |
| 30 | 29 |
| 31 ~JumpPatchSite() { | 30 ~JumpPatchSite() { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 61 | 60 |
| 62 private: | 61 private: |
| 63 // jc will be patched with jz, jnc will become jnz. | 62 // jc will be patched with jz, jnc will become jnz. |
| 64 void EmitJump(Condition cc, Label* target, Label::Distance distance) { | 63 void EmitJump(Condition cc, Label* target, Label::Distance distance) { |
| 65 DCHECK(!patch_site_.is_bound() && !info_emitted_); | 64 DCHECK(!patch_site_.is_bound() && !info_emitted_); |
| 66 DCHECK(cc == carry || cc == not_carry); | 65 DCHECK(cc == carry || cc == not_carry); |
| 67 __ bind(&patch_site_); | 66 __ bind(&patch_site_); |
| 68 __ j(cc, target, distance); | 67 __ j(cc, target, distance); |
| 69 } | 68 } |
| 70 | 69 |
| 70 MacroAssembler* masm() { return masm_; } |
| 71 MacroAssembler* masm_; | 71 MacroAssembler* masm_; |
| 72 Label patch_site_; | 72 Label patch_site_; |
| 73 #ifdef DEBUG | 73 #ifdef DEBUG |
| 74 bool info_emitted_; | 74 bool info_emitted_; |
| 75 #endif | 75 #endif |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 | 78 |
| 79 // Generate code for a JS function. On entry to the function the receiver | 79 // Generate code for a JS function. On entry to the function the receiver |
| 80 // and arguments have been pushed on the stack left to right, with the | 80 // and arguments have been pushed on the stack left to right, with the |
| (...skipping 1785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1866 EmitReturnSequence(); | 1866 EmitReturnSequence(); |
| 1867 | 1867 |
| 1868 __ bind(&resume); | 1868 __ bind(&resume); |
| 1869 context()->Plug(result_register()); | 1869 context()->Plug(result_register()); |
| 1870 break; | 1870 break; |
| 1871 } | 1871 } |
| 1872 | 1872 |
| 1873 case Yield::kFinal: { | 1873 case Yield::kFinal: { |
| 1874 // Pop value from top-of-stack slot, box result into result register. | 1874 // Pop value from top-of-stack slot, box result into result register. |
| 1875 EmitCreateIteratorResult(true); | 1875 EmitCreateIteratorResult(true); |
| 1876 EmitUnwindBeforeReturn(); | 1876 EmitUnwindAndReturn(); |
| 1877 EmitReturnSequence(); | |
| 1878 break; | 1877 break; |
| 1879 } | 1878 } |
| 1880 | 1879 |
| 1881 case Yield::kDelegating: { | 1880 case Yield::kDelegating: { |
| 1882 VisitForStackValue(expr->generator_object()); | 1881 VisitForStackValue(expr->generator_object()); |
| 1883 | 1882 |
| 1884 // Initial stack layout is as follows: | 1883 // Initial stack layout is as follows: |
| 1885 // [sp + 1 * kPointerSize] iter | 1884 // [sp + 1 * kPointerSize] iter |
| 1886 // [sp + 0 * kPointerSize] g | 1885 // [sp + 0 * kPointerSize] g |
| 1887 | 1886 |
| (...skipping 2817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4705 Assembler::target_address_at(call_target_address, | 4704 Assembler::target_address_at(call_target_address, |
| 4706 unoptimized_code)); | 4705 unoptimized_code)); |
| 4707 return OSR_AFTER_STACK_CHECK; | 4706 return OSR_AFTER_STACK_CHECK; |
| 4708 } | 4707 } |
| 4709 | 4708 |
| 4710 | 4709 |
| 4711 } // namespace internal | 4710 } // namespace internal |
| 4712 } // namespace v8 | 4711 } // namespace v8 |
| 4713 | 4712 |
| 4714 #endif // V8_TARGET_ARCH_X87 | 4713 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |