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

Side by Side Diff: src/builtins/x64/builtins-x64.cc

Issue 2655013002: [Builtins] Smi-check the spread and go to runtime in CheckSpreadAndPushToStack. (Closed)
Patch Set: Put a try/catch in the regression test so it doesn't fail Created 3 years, 11 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/builtins/mips64/builtins-mips64.cc ('k') | src/builtins/x87/builtins-x87.cc » ('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_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 2746 matching lines...) Expand 10 before | Expand all | Expand 10 after
2757 // 3. Call to something that is not callable. 2757 // 3. Call to something that is not callable.
2758 __ bind(&non_callable); 2758 __ bind(&non_callable);
2759 { 2759 {
2760 FrameScope scope(masm, StackFrame::INTERNAL); 2760 FrameScope scope(masm, StackFrame::INTERNAL);
2761 __ Push(rdi); 2761 __ Push(rdi);
2762 __ CallRuntime(Runtime::kThrowCalledNonCallable); 2762 __ CallRuntime(Runtime::kThrowCalledNonCallable);
2763 } 2763 }
2764 } 2764 }
2765 2765
2766 static void CheckSpreadAndPushToStack(MacroAssembler* masm) { 2766 static void CheckSpreadAndPushToStack(MacroAssembler* masm) {
2767 Label runtime_call, push_args;
2767 // Load the spread argument into rbx. 2768 // Load the spread argument into rbx.
2768 __ movp(rbx, Operand(rsp, kPointerSize)); 2769 __ movp(rbx, Operand(rsp, kPointerSize));
2770 __ JumpIfSmi(rbx, &runtime_call);
2769 // Load the map of the spread into r15. 2771 // Load the map of the spread into r15.
2770 __ movp(r15, FieldOperand(rbx, HeapObject::kMapOffset)); 2772 __ movp(r15, FieldOperand(rbx, HeapObject::kMapOffset));
2771 // Load native context into r14. 2773 // Load native context into r14.
2772 __ movp(r14, NativeContextOperand()); 2774 __ movp(r14, NativeContextOperand());
2773 2775
2774 Label runtime_call, push_args;
2775 // Check that the spread is an array. 2776 // Check that the spread is an array.
2776 __ CmpInstanceType(r15, JS_ARRAY_TYPE); 2777 __ CmpInstanceType(r15, JS_ARRAY_TYPE);
2777 __ j(not_equal, &runtime_call); 2778 __ j(not_equal, &runtime_call);
2778 2779
2779 // Check that we have the original ArrayPrototype. 2780 // Check that we have the original ArrayPrototype.
2780 __ movp(rcx, FieldOperand(r15, Map::kPrototypeOffset)); 2781 __ movp(rcx, FieldOperand(r15, Map::kPrototypeOffset));
2781 __ cmpp(rcx, ContextOperand(r14, Context::INITIAL_ARRAY_PROTOTYPE_INDEX)); 2782 __ cmpp(rcx, ContextOperand(r14, Context::INITIAL_ARRAY_PROTOTYPE_INDEX));
2782 __ j(not_equal, &runtime_call); 2783 __ j(not_equal, &runtime_call);
2783 2784
2784 // Check that the ArrayPrototype hasn't been modified in a way that would 2785 // Check that the ArrayPrototype hasn't been modified in a way that would
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
3200 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { 3201 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) {
3201 Generate_OnStackReplacementHelper(masm, true); 3202 Generate_OnStackReplacementHelper(masm, true);
3202 } 3203 }
3203 3204
3204 #undef __ 3205 #undef __
3205 3206
3206 } // namespace internal 3207 } // namespace internal
3207 } // namespace v8 3208 } // namespace v8
3208 3209
3209 #endif // V8_TARGET_ARCH_X64 3210 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/builtins/mips64/builtins-mips64.cc ('k') | src/builtins/x87/builtins-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698