Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: src/x87/code-stubs-x87.cc

Issue 1316943002: Move (uppercase) JS builtins from js builtins object to native context. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove Isolate::js_builtins_object Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/x87/builtins-x87.cc ('k') | src/x87/macro-assembler-x87.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 1585 matching lines...) Expand 10 before | Expand all | Expand 10 after
1596 // Push arguments below the return address. 1596 // Push arguments below the return address.
1597 __ pop(ecx); 1597 __ pop(ecx);
1598 __ push(edx); 1598 __ push(edx);
1599 __ push(eax); 1599 __ push(eax);
1600 1600
1601 // Figure out which native to call and setup the arguments. 1601 // Figure out which native to call and setup the arguments.
1602 if (cc == equal && strict()) { 1602 if (cc == equal && strict()) {
1603 __ push(ecx); 1603 __ push(ecx);
1604 __ TailCallRuntime(Runtime::kStrictEquals, 2, 1); 1604 __ TailCallRuntime(Runtime::kStrictEquals, 2, 1);
1605 } else { 1605 } else {
1606 Builtins::JavaScript builtin; 1606 int context_index;
1607 if (cc == equal) { 1607 if (cc == equal) {
1608 builtin = Builtins::EQUALS; 1608 context_index = Context::EQUALS_BUILTIN_INDEX;
1609 } else { 1609 } else {
1610 builtin = 1610 context_index = is_strong(strength())
1611 is_strong(strength()) ? Builtins::COMPARE_STRONG : Builtins::COMPARE; 1611 ? Context::COMPARE_STRONG_BUILTIN_INDEX
1612 : Context::COMPARE_BUILTIN_INDEX;
1612 __ push(Immediate(Smi::FromInt(NegativeComparisonResult(cc)))); 1613 __ push(Immediate(Smi::FromInt(NegativeComparisonResult(cc))));
1613 } 1614 }
1614 1615
1615 // Restore return address on the stack. 1616 // Restore return address on the stack.
1616 __ push(ecx); 1617 __ push(ecx);
1617 1618
1618 // Call the native; it returns -1 (less), 0 (equal), or 1 (greater) 1619 // Call the native; it returns -1 (less), 0 (equal), or 1 (greater)
1619 // tagged as a small integer. 1620 // tagged as a small integer.
1620 __ InvokeBuiltin(builtin, JUMP_FUNCTION); 1621 __ InvokeBuiltin(context_index, JUMP_FUNCTION);
1621 } 1622 }
1622 1623
1623 __ bind(&miss); 1624 __ bind(&miss);
1624 GenerateMiss(masm); 1625 GenerateMiss(masm);
1625 } 1626 }
1626 1627
1627 1628
1628 static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub, 1629 static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub,
1629 bool is_super) { 1630 bool is_super) {
1630 // eax : number of arguments to the construct function 1631 // eax : number of arguments to the construct function
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1775 int argc, 1776 int argc,
1776 Label* non_function) { 1777 Label* non_function) {
1777 // Check for function proxy. 1778 // Check for function proxy.
1778 __ CmpInstanceType(ecx, JS_FUNCTION_PROXY_TYPE); 1779 __ CmpInstanceType(ecx, JS_FUNCTION_PROXY_TYPE);
1779 __ j(not_equal, non_function); 1780 __ j(not_equal, non_function);
1780 __ pop(ecx); 1781 __ pop(ecx);
1781 __ push(edi); // put proxy as additional argument under return address 1782 __ push(edi); // put proxy as additional argument under return address
1782 __ push(ecx); 1783 __ push(ecx);
1783 __ Move(eax, Immediate(argc + 1)); 1784 __ Move(eax, Immediate(argc + 1));
1784 __ Move(ebx, Immediate(0)); 1785 __ Move(ebx, Immediate(0));
1785 __ GetBuiltinEntry(edx, Builtins::CALL_FUNCTION_PROXY); 1786 __ GetBuiltinEntry(edx, Context::CALL_FUNCTION_PROXY_BUILTIN_INDEX);
1786 { 1787 {
1787 Handle<Code> adaptor = isolate->builtins()->ArgumentsAdaptorTrampoline(); 1788 Handle<Code> adaptor = isolate->builtins()->ArgumentsAdaptorTrampoline();
1788 __ jmp(adaptor, RelocInfo::CODE_TARGET); 1789 __ jmp(adaptor, RelocInfo::CODE_TARGET);
1789 } 1790 }
1790 1791
1791 // CALL_NON_FUNCTION expects the non-function callee as receiver (instead 1792 // CALL_NON_FUNCTION expects the non-function callee as receiver (instead
1792 // of the original receiver from the call site). 1793 // of the original receiver from the call site).
1793 __ bind(non_function); 1794 __ bind(non_function);
1794 __ mov(Operand(esp, (argc + 1) * kPointerSize), edi); 1795 __ mov(Operand(esp, (argc + 1) * kPointerSize), edi);
1795 __ Move(eax, Immediate(argc)); 1796 __ Move(eax, Immediate(argc));
1796 __ Move(ebx, Immediate(0)); 1797 __ Move(ebx, Immediate(0));
1797 __ GetBuiltinEntry(edx, Builtins::CALL_NON_FUNCTION); 1798 __ GetBuiltinEntry(edx, Context::CALL_NON_FUNCTION_BUILTIN_INDEX);
1798 Handle<Code> adaptor = isolate->builtins()->ArgumentsAdaptorTrampoline(); 1799 Handle<Code> adaptor = isolate->builtins()->ArgumentsAdaptorTrampoline();
1799 __ jmp(adaptor, RelocInfo::CODE_TARGET); 1800 __ jmp(adaptor, RelocInfo::CODE_TARGET);
1800 } 1801 }
1801 1802
1802 1803
1803 static void EmitWrapCase(MacroAssembler* masm, int argc, Label* cont) { 1804 static void EmitWrapCase(MacroAssembler* masm, int argc, Label* cont) {
1804 // Wrap the receiver and patch it back onto the stack. 1805 // Wrap the receiver and patch it back onto the stack.
1805 { FrameScope frame_scope(masm, StackFrame::INTERNAL); 1806 { FrameScope frame_scope(masm, StackFrame::INTERNAL);
1806 __ push(edi); 1807 __ push(edi);
1807 ToObjectStub stub(masm->isolate()); 1808 ToObjectStub stub(masm->isolate());
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
1931 __ jmp(jmp_reg); 1932 __ jmp(jmp_reg);
1932 1933
1933 // edi: called object 1934 // edi: called object
1934 // eax: number of arguments 1935 // eax: number of arguments
1935 // ecx: object map 1936 // ecx: object map
1936 // esp[0]: original receiver (for IsSuperConstructorCall) 1937 // esp[0]: original receiver (for IsSuperConstructorCall)
1937 Label do_call; 1938 Label do_call;
1938 __ bind(&slow); 1939 __ bind(&slow);
1939 __ CmpInstanceType(ecx, JS_FUNCTION_PROXY_TYPE); 1940 __ CmpInstanceType(ecx, JS_FUNCTION_PROXY_TYPE);
1940 __ j(not_equal, &non_function_call); 1941 __ j(not_equal, &non_function_call);
1941 __ GetBuiltinEntry(edx, Builtins::CALL_FUNCTION_PROXY_AS_CONSTRUCTOR); 1942 __ GetBuiltinEntry(edx,
1943 Context::CALL_FUNCTION_PROXY_AS_CONSTRUCTOR_BUILTIN_INDEX);
1942 __ jmp(&do_call); 1944 __ jmp(&do_call);
1943 1945
1944 __ bind(&non_function_call); 1946 __ bind(&non_function_call);
1945 __ GetBuiltinEntry(edx, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR); 1947 __ GetBuiltinEntry(edx,
1948 Context::CALL_NON_FUNCTION_AS_CONSTRUCTOR_BUILTIN_INDEX);
1946 __ bind(&do_call); 1949 __ bind(&do_call);
1947 if (IsSuperConstructorCall()) { 1950 if (IsSuperConstructorCall()) {
1948 __ Drop(1); 1951 __ Drop(1);
1949 } 1952 }
1950 // Set expected number of arguments to zero (not changing eax). 1953 // Set expected number of arguments to zero (not changing eax).
1951 __ Move(ebx, Immediate(0)); 1954 __ Move(ebx, Immediate(0));
1952 Handle<Code> arguments_adaptor = 1955 Handle<Code> arguments_adaptor =
1953 isolate()->builtins()->ArgumentsAdaptorTrampoline(); 1956 isolate()->builtins()->ArgumentsAdaptorTrampoline();
1954 __ jmp(arguments_adaptor, RelocInfo::CODE_TARGET); 1957 __ jmp(arguments_adaptor, RelocInfo::CODE_TARGET);
1955 } 1958 }
(...skipping 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after
2971 Label not_oddball; 2974 Label not_oddball;
2972 __ CmpInstanceType(edi, ODDBALL_TYPE); 2975 __ CmpInstanceType(edi, ODDBALL_TYPE);
2973 __ j(not_equal, &not_oddball, Label::kNear); 2976 __ j(not_equal, &not_oddball, Label::kNear);
2974 __ mov(eax, FieldOperand(eax, Oddball::kToNumberOffset)); 2977 __ mov(eax, FieldOperand(eax, Oddball::kToNumberOffset));
2975 __ Ret(); 2978 __ Ret();
2976 __ bind(&not_oddball); 2979 __ bind(&not_oddball);
2977 2980
2978 __ pop(ecx); // Pop return address. 2981 __ pop(ecx); // Pop return address.
2979 __ push(eax); // Push argument. 2982 __ push(eax); // Push argument.
2980 __ push(ecx); // Push return address. 2983 __ push(ecx); // Push return address.
2981 __ InvokeBuiltin(Builtins::TO_NUMBER, JUMP_FUNCTION); 2984 __ InvokeBuiltin(Context::TO_NUMBER_BUILTIN_INDEX, JUMP_FUNCTION);
2982 } 2985 }
2983 2986
2984 2987
2985 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, 2988 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm,
2986 Register left, 2989 Register left,
2987 Register right, 2990 Register right,
2988 Register scratch1, 2991 Register scratch1,
2989 Register scratch2) { 2992 Register scratch2) {
2990 Register length = scratch1; 2993 Register length = scratch1;
2991 2994
(...skipping 2221 matching lines...) Expand 10 before | Expand all | Expand 10 after
5213 Operand(ebp, 7 * kPointerSize), NULL); 5216 Operand(ebp, 7 * kPointerSize), NULL);
5214 } 5217 }
5215 5218
5216 5219
5217 #undef __ 5220 #undef __
5218 5221
5219 } // namespace internal 5222 } // namespace internal
5220 } // namespace v8 5223 } // namespace v8
5221 5224
5222 #endif // V8_TARGET_ARCH_X87 5225 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/x87/builtins-x87.cc ('k') | src/x87/macro-assembler-x87.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698