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

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

Issue 1341233002: X87: [stubs] Simplify the non-function case of CallConstructStub. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/full-codegen/x87/full-codegen-x87.cc ('k') | no next file » | 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 1867 matching lines...) Expand 10 before | Expand all | Expand 10 after
1878 __ mov(jmp_reg, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); 1878 __ mov(jmp_reg, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
1879 __ mov(jmp_reg, FieldOperand(jmp_reg, 1879 __ mov(jmp_reg, FieldOperand(jmp_reg,
1880 SharedFunctionInfo::kConstructStubOffset)); 1880 SharedFunctionInfo::kConstructStubOffset));
1881 __ lea(jmp_reg, FieldOperand(jmp_reg, Code::kHeaderSize)); 1881 __ lea(jmp_reg, FieldOperand(jmp_reg, Code::kHeaderSize));
1882 __ jmp(jmp_reg); 1882 __ jmp(jmp_reg);
1883 1883
1884 // edi: called object 1884 // edi: called object
1885 // eax: number of arguments 1885 // eax: number of arguments
1886 // ecx: object map 1886 // ecx: object map
1887 // esp[0]: original receiver (for IsSuperConstructorCall) 1887 // esp[0]: original receiver (for IsSuperConstructorCall)
1888 Label do_call;
1889 __ bind(&slow); 1888 __ bind(&slow);
1890 __ CmpInstanceType(ecx, JS_FUNCTION_PROXY_TYPE); 1889 {
1891 __ j(not_equal, &non_function_call); 1890 __ CmpInstanceType(ecx, JS_FUNCTION_PROXY_TYPE);
1892 __ GetBuiltinEntry(edx, 1891 __ j(not_equal, &non_function_call, Label::kNear);
1893 Context::CALL_FUNCTION_PROXY_AS_CONSTRUCTOR_BUILTIN_INDEX); 1892 if (IsSuperConstructorCall()) __ Drop(1);
1894 __ jmp(&do_call); 1893 // TODO(neis): This doesn't match the ES6 spec for [[Construct]] on proxies.
1894 __ mov(edi, FieldOperand(edi, JSFunctionProxy::kConstructTrapOffset));
1895 __ Jump(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
1895 1896
1896 __ bind(&non_function_call); 1897 __ bind(&non_function_call);
1897 __ GetBuiltinEntry(edx, 1898 if (IsSuperConstructorCall()) __ Drop(1);
1898 Context::CALL_NON_FUNCTION_AS_CONSTRUCTOR_BUILTIN_INDEX); 1899 {
1899 __ bind(&do_call); 1900 // Determine the delegate for the target (if any).
1900 if (IsSuperConstructorCall()) { 1901 FrameScope scope(masm, StackFrame::INTERNAL);
1901 __ Drop(1); 1902 __ SmiTag(eax);
1903 __ Push(eax);
1904 __ Push(edi);
1905 __ CallRuntime(Runtime::kGetConstructorDelegate, 1);
1906 __ mov(edi, eax);
1907 __ Pop(eax);
1908 __ SmiUntag(eax);
1909 }
1910 // The delegate is always a regular function.
1911 __ AssertFunction(edi);
1912 __ Jump(isolate()->builtins()->CallFunction(), RelocInfo::CODE_TARGET);
1902 } 1913 }
1903 // Set expected number of arguments to zero (not changing eax).
1904 __ Move(ebx, Immediate(0));
1905 Handle<Code> arguments_adaptor =
1906 isolate()->builtins()->ArgumentsAdaptorTrampoline();
1907 __ jmp(arguments_adaptor, RelocInfo::CODE_TARGET);
1908 } 1914 }
1909 1915
1910 1916
1911 static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) { 1917 static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) {
1912 __ mov(vector, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); 1918 __ mov(vector, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
1913 __ mov(vector, FieldOperand(vector, JSFunction::kSharedFunctionInfoOffset)); 1919 __ mov(vector, FieldOperand(vector, JSFunction::kSharedFunctionInfoOffset));
1914 __ mov(vector, FieldOperand(vector, 1920 __ mov(vector, FieldOperand(vector,
1915 SharedFunctionInfo::kFeedbackVectorOffset)); 1921 SharedFunctionInfo::kFeedbackVectorOffset));
1916 } 1922 }
1917 1923
(...skipping 3562 matching lines...) Expand 10 before | Expand all | Expand 10 after
5480 Operand(ebp, 7 * kPointerSize), NULL); 5486 Operand(ebp, 7 * kPointerSize), NULL);
5481 } 5487 }
5482 5488
5483 5489
5484 #undef __ 5490 #undef __
5485 5491
5486 } // namespace internal 5492 } // namespace internal
5487 } // namespace v8 5493 } // namespace v8
5488 5494
5489 #endif // V8_TARGET_ARCH_X87 5495 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/full-codegen/x87/full-codegen-x87.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698