| 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_X64 | 5 #if V8_TARGET_ARCH_X64 |
| 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 2199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2210 // -- rdx : message_id as Smi | 2210 // -- rdx : message_id as Smi |
| 2211 // -- rsp[0] : return address | 2211 // -- rsp[0] : return address |
| 2212 // ----------------------------------- | 2212 // ----------------------------------- |
| 2213 __ PopReturnAddressTo(rcx); | 2213 __ PopReturnAddressTo(rcx); |
| 2214 __ Push(rdx); | 2214 __ Push(rdx); |
| 2215 __ PushReturnAddressFrom(rcx); | 2215 __ PushReturnAddressFrom(rcx); |
| 2216 __ Move(rsi, Smi::FromInt(0)); | 2216 __ Move(rsi, Smi::FromInt(0)); |
| 2217 __ TailCallRuntime(Runtime::kAbort); | 2217 __ TailCallRuntime(Runtime::kAbort); |
| 2218 } | 2218 } |
| 2219 | 2219 |
| 2220 // static | |
| 2221 void Builtins::Generate_ToNumber(MacroAssembler* masm) { | |
| 2222 // The ToNumber stub takes one argument in rax. | |
| 2223 Label not_smi; | |
| 2224 __ JumpIfNotSmi(rax, ¬_smi, Label::kNear); | |
| 2225 __ Ret(); | |
| 2226 __ bind(¬_smi); | |
| 2227 | |
| 2228 Label not_heap_number; | |
| 2229 __ CompareRoot(FieldOperand(rax, HeapObject::kMapOffset), | |
| 2230 Heap::kHeapNumberMapRootIndex); | |
| 2231 __ j(not_equal, ¬_heap_number, Label::kNear); | |
| 2232 __ Ret(); | |
| 2233 __ bind(¬_heap_number); | |
| 2234 | |
| 2235 __ Jump(masm->isolate()->builtins()->NonNumberToNumber(), | |
| 2236 RelocInfo::CODE_TARGET); | |
| 2237 } | |
| 2238 | |
| 2239 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { | 2220 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
| 2240 // ----------- S t a t e ------------- | 2221 // ----------- S t a t e ------------- |
| 2241 // -- rax : actual number of arguments | 2222 // -- rax : actual number of arguments |
| 2242 // -- rbx : expected number of arguments | 2223 // -- rbx : expected number of arguments |
| 2243 // -- rdx : new target (passed through to callee) | 2224 // -- rdx : new target (passed through to callee) |
| 2244 // -- rdi : function (passed through to callee) | 2225 // -- rdi : function (passed through to callee) |
| 2245 // ----------------------------------- | 2226 // ----------------------------------- |
| 2246 | 2227 |
| 2247 Label invoke, dont_adapt_arguments, stack_overflow; | 2228 Label invoke, dont_adapt_arguments, stack_overflow; |
| 2248 Counters* counters = masm->isolate()->counters(); | 2229 Counters* counters = masm->isolate()->counters(); |
| (...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3134 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { | 3115 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { |
| 3135 Generate_OnStackReplacementHelper(masm, true); | 3116 Generate_OnStackReplacementHelper(masm, true); |
| 3136 } | 3117 } |
| 3137 | 3118 |
| 3138 #undef __ | 3119 #undef __ |
| 3139 | 3120 |
| 3140 } // namespace internal | 3121 } // namespace internal |
| 3141 } // namespace v8 | 3122 } // namespace v8 |
| 3142 | 3123 |
| 3143 #endif // V8_TARGET_ARCH_X64 | 3124 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |