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/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/base/division-by-constant.h" | 8 #include "src/base/division-by-constant.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 2093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2104 void MacroAssembler::InvokeFunction(Handle<JSFunction> function, | 2104 void MacroAssembler::InvokeFunction(Handle<JSFunction> function, |
2105 const ParameterCount& expected, | 2105 const ParameterCount& expected, |
2106 const ParameterCount& actual, | 2106 const ParameterCount& actual, |
2107 InvokeFlag flag, | 2107 InvokeFlag flag, |
2108 const CallWrapper& call_wrapper) { | 2108 const CallWrapper& call_wrapper) { |
2109 LoadHeapObject(edi, function); | 2109 LoadHeapObject(edi, function); |
2110 InvokeFunction(edi, expected, actual, flag, call_wrapper); | 2110 InvokeFunction(edi, expected, actual, flag, call_wrapper); |
2111 } | 2111 } |
2112 | 2112 |
2113 | 2113 |
2114 void MacroAssembler::InvokeBuiltin(int native_context_index, InvokeFlag flag, | |
2115 const CallWrapper& call_wrapper) { | |
2116 // You can't call a builtin without a valid frame. | |
2117 DCHECK(flag == JUMP_FUNCTION || has_frame()); | |
2118 | |
2119 // Fake a parameter count to avoid emitting code to do the check. | |
2120 ParameterCount expected(0); | |
2121 GetBuiltinFunction(edi, native_context_index); | |
2122 InvokeFunctionCode(edi, no_reg, expected, expected, flag, call_wrapper); | |
2123 } | |
2124 | |
2125 | |
2126 void MacroAssembler::GetBuiltinFunction(Register target, | 2114 void MacroAssembler::GetBuiltinFunction(Register target, |
2127 int native_context_index) { | 2115 int native_context_index) { |
2128 // Load the JavaScript builtin function from the builtins object. | 2116 // Load the JavaScript builtin function from the builtins object. |
2129 mov(target, NativeContextOperand()); | 2117 mov(target, NativeContextOperand()); |
2130 mov(target, ContextOperand(target, native_context_index)); | 2118 mov(target, ContextOperand(target, native_context_index)); |
2131 } | 2119 } |
2132 | 2120 |
2133 | 2121 |
2134 void MacroAssembler::LoadContext(Register dst, int context_chain_length) { | 2122 void MacroAssembler::LoadContext(Register dst, int context_chain_length) { |
2135 if (context_chain_length > 0) { | 2123 if (context_chain_length > 0) { |
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2988 mov(eax, dividend); | 2976 mov(eax, dividend); |
2989 shr(eax, 31); | 2977 shr(eax, 31); |
2990 add(edx, eax); | 2978 add(edx, eax); |
2991 } | 2979 } |
2992 | 2980 |
2993 | 2981 |
2994 } // namespace internal | 2982 } // namespace internal |
2995 } // namespace v8 | 2983 } // namespace v8 |
2996 | 2984 |
2997 #endif // V8_TARGET_ARCH_X87 | 2985 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |