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 1509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1520 __ mov(ebx, eax); | 1520 __ mov(ebx, eax); |
1521 __ IncrementCounter(counters->string_ctor_string_value(), 1); | 1521 __ IncrementCounter(counters->string_ctor_string_value(), 1); |
1522 __ jmp(&argument_is_string); | 1522 __ jmp(&argument_is_string); |
1523 | 1523 |
1524 // Invoke the conversion builtin and put the result into ebx. | 1524 // Invoke the conversion builtin and put the result into ebx. |
1525 __ bind(&convert_argument); | 1525 __ bind(&convert_argument); |
1526 __ IncrementCounter(counters->string_ctor_conversions(), 1); | 1526 __ IncrementCounter(counters->string_ctor_conversions(), 1); |
1527 { | 1527 { |
1528 FrameScope scope(masm, StackFrame::INTERNAL); | 1528 FrameScope scope(masm, StackFrame::INTERNAL); |
1529 __ push(edi); // Preserve the function. | 1529 __ push(edi); // Preserve the function. |
1530 __ push(eax); | 1530 ToStringStub stub(masm->isolate()); |
1531 __ InvokeBuiltin(Context::TO_STRING_BUILTIN_INDEX, CALL_FUNCTION); | 1531 __ CallStub(&stub); |
1532 __ pop(edi); | 1532 __ pop(edi); |
1533 } | 1533 } |
1534 __ mov(ebx, eax); | 1534 __ mov(ebx, eax); |
1535 __ jmp(&argument_is_string); | 1535 __ jmp(&argument_is_string); |
1536 | 1536 |
1537 // Load the empty string into ebx, remove the receiver from the | 1537 // Load the empty string into ebx, remove the receiver from the |
1538 // stack, and jump back to the case where the argument is a string. | 1538 // stack, and jump back to the case where the argument is a string. |
1539 __ bind(&no_arguments); | 1539 __ bind(&no_arguments); |
1540 __ Move(ebx, Immediate(factory->empty_string())); | 1540 __ Move(ebx, Immediate(factory->empty_string())); |
1541 __ pop(ecx); | 1541 __ pop(ecx); |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1789 | 1789 |
1790 __ bind(&ok); | 1790 __ bind(&ok); |
1791 __ ret(0); | 1791 __ ret(0); |
1792 } | 1792 } |
1793 | 1793 |
1794 #undef __ | 1794 #undef __ |
1795 } // namespace internal | 1795 } // namespace internal |
1796 } // namespace v8 | 1796 } // namespace v8 |
1797 | 1797 |
1798 #endif // V8_TARGET_ARCH_X87 | 1798 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |