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

Side by Side Diff: src/builtins/x87/builtins-x87.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, 10 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/x64/builtins-x64.cc ('k') | test/mjsunit/es6/spread-call.js » ('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/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 2704 matching lines...) Expand 10 before | Expand all | Expand 10 after
2715 Register argc = eax; 2715 Register argc = eax;
2716 2716
2717 Register scratch = ecx; 2717 Register scratch = ecx;
2718 Register scratch2 = edi; 2718 Register scratch2 = edi;
2719 2719
2720 Register spread = ebx; 2720 Register spread = ebx;
2721 Register spread_map = edx; 2721 Register spread_map = edx;
2722 2722
2723 Register spread_len = edx; 2723 Register spread_len = edx;
2724 2724
2725 Label runtime_call, push_args;
2725 __ mov(spread, Operand(esp, kPointerSize)); 2726 __ mov(spread, Operand(esp, kPointerSize));
2727 __ JumpIfSmi(spread, &runtime_call);
2726 __ mov(spread_map, FieldOperand(spread, HeapObject::kMapOffset)); 2728 __ mov(spread_map, FieldOperand(spread, HeapObject::kMapOffset));
2727 2729
2728 Label runtime_call, push_args;
2729 // Check that the spread is an array. 2730 // Check that the spread is an array.
2730 __ CmpInstanceType(spread_map, JS_ARRAY_TYPE); 2731 __ CmpInstanceType(spread_map, JS_ARRAY_TYPE);
2731 __ j(not_equal, &runtime_call); 2732 __ j(not_equal, &runtime_call);
2732 2733
2733 // Check that we have the original ArrayPrototype. 2734 // Check that we have the original ArrayPrototype.
2734 __ mov(scratch, FieldOperand(spread_map, Map::kPrototypeOffset)); 2735 __ mov(scratch, FieldOperand(spread_map, Map::kPrototypeOffset));
2735 __ mov(scratch2, NativeContextOperand()); 2736 __ mov(scratch2, NativeContextOperand());
2736 __ cmp(scratch, 2737 __ cmp(scratch,
2737 ContextOperand(scratch2, Context::INITIAL_ARRAY_PROTOTYPE_INDEX)); 2738 ContextOperand(scratch2, Context::INITIAL_ARRAY_PROTOTYPE_INDEX));
2738 __ j(not_equal, &runtime_call); 2739 __ j(not_equal, &runtime_call);
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
3342 3343
3343 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) { 3344 void Builtins::Generate_InterpreterOnStackReplacement(MacroAssembler* masm) {
3344 Generate_OnStackReplacementHelper(masm, true); 3345 Generate_OnStackReplacementHelper(masm, true);
3345 } 3346 }
3346 3347
3347 #undef __ 3348 #undef __
3348 } // namespace internal 3349 } // namespace internal
3349 } // namespace v8 3350 } // namespace v8
3350 3351
3351 #endif // V8_TARGET_ARCH_X87 3352 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/builtins/x64/builtins-x64.cc ('k') | test/mjsunit/es6/spread-call.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698