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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X87 | 7 #if V8_TARGET_ARCH_X87 |
8 | 8 |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 // Insert extra arguments. | 36 // Insert extra arguments. |
37 int num_extra_args = 0; | 37 int num_extra_args = 0; |
38 if (extra_args == NEEDS_CALLED_FUNCTION) { | 38 if (extra_args == NEEDS_CALLED_FUNCTION) { |
39 num_extra_args = 1; | 39 num_extra_args = 1; |
40 Register scratch = ebx; | 40 Register scratch = ebx; |
41 __ pop(scratch); // Save return address. | 41 __ pop(scratch); // Save return address. |
42 __ push(edi); | 42 __ push(edi); |
43 __ push(scratch); // Restore return address. | 43 __ push(scratch); // Restore return address. |
44 } else { | 44 } else { |
45 ASSERT(extra_args == NO_EXTRA_ARGUMENTS); | 45 DCHECK(extra_args == NO_EXTRA_ARGUMENTS); |
46 } | 46 } |
47 | 47 |
48 // JumpToExternalReference expects eax to contain the number of arguments | 48 // JumpToExternalReference expects eax to contain the number of arguments |
49 // including the receiver and the extra arguments. | 49 // including the receiver and the extra arguments. |
50 __ add(eax, Immediate(num_extra_args + 1)); | 50 __ add(eax, Immediate(num_extra_args + 1)); |
51 __ JumpToExternalReference(ExternalReference(id, masm->isolate())); | 51 __ JumpToExternalReference(ExternalReference(id, masm->isolate())); |
52 } | 52 } |
53 | 53 |
54 | 54 |
55 static void CallRuntimePassFunction( | 55 static void CallRuntimePassFunction( |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 static void Generate_JSConstructStubHelper(MacroAssembler* masm, | 103 static void Generate_JSConstructStubHelper(MacroAssembler* masm, |
104 bool is_api_function, | 104 bool is_api_function, |
105 bool create_memento) { | 105 bool create_memento) { |
106 // ----------- S t a t e ------------- | 106 // ----------- S t a t e ------------- |
107 // -- eax: number of arguments | 107 // -- eax: number of arguments |
108 // -- edi: constructor function | 108 // -- edi: constructor function |
109 // -- ebx: allocation site or undefined | 109 // -- ebx: allocation site or undefined |
110 // ----------------------------------- | 110 // ----------------------------------- |
111 | 111 |
112 // Should never create mementos for api functions. | 112 // Should never create mementos for api functions. |
113 ASSERT(!is_api_function || !create_memento); | 113 DCHECK(!is_api_function || !create_memento); |
114 | 114 |
115 // Enter a construct frame. | 115 // Enter a construct frame. |
116 { | 116 { |
117 FrameScope scope(masm, StackFrame::CONSTRUCT); | 117 FrameScope scope(masm, StackFrame::CONSTRUCT); |
118 | 118 |
119 if (create_memento) { | 119 if (create_memento) { |
120 __ AssertUndefinedOrAllocationSite(ebx); | 120 __ AssertUndefinedOrAllocationSite(ebx); |
121 __ push(ebx); | 121 __ push(ebx); |
122 } | 122 } |
123 | 123 |
(...skipping 1324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1448 | 1448 |
1449 __ bind(&ok); | 1449 __ bind(&ok); |
1450 __ ret(0); | 1450 __ ret(0); |
1451 } | 1451 } |
1452 | 1452 |
1453 #undef __ | 1453 #undef __ |
1454 } | 1454 } |
1455 } // namespace v8::internal | 1455 } // namespace v8::internal |
1456 | 1456 |
1457 #endif // V8_TARGET_ARCH_X87 | 1457 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |