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

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

Issue 1810953002: InstanceOfStub incorrectly interprets the hole as a prototype. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | src/arm64/code-stubs-arm64.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_ARM 5 #if V8_TARGET_ARCH_ARM
6 6
7 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/api-arguments.h" 8 #include "src/api-arguments.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after
1364 __ b(ne, &slow_case); 1364 __ b(ne, &slow_case);
1365 __ LoadRoot(r0, Heap::kFalseValueRootIndex); 1365 __ LoadRoot(r0, Heap::kFalseValueRootIndex);
1366 __ Ret(); 1366 __ Ret();
1367 1367
1368 // Fast-case: The {function} must be a valid JSFunction. 1368 // Fast-case: The {function} must be a valid JSFunction.
1369 __ bind(&fast_case); 1369 __ bind(&fast_case);
1370 __ JumpIfSmi(function, &slow_case); 1370 __ JumpIfSmi(function, &slow_case);
1371 __ CompareObjectType(function, function_map, scratch, JS_FUNCTION_TYPE); 1371 __ CompareObjectType(function, function_map, scratch, JS_FUNCTION_TYPE);
1372 __ b(ne, &slow_case); 1372 __ b(ne, &slow_case);
1373 1373
1374 // Go to the runtime if the function is not a constructor.
1375 __ ldrb(scratch, FieldMemOperand(function_map, Map::kBitFieldOffset));
1376 __ tst(scratch, Operand(1 << Map::kIsConstructor));
1377 __ b(eq, &slow_case);
1378
1374 // Ensure that {function} has an instance prototype. 1379 // Ensure that {function} has an instance prototype.
1375 __ ldrb(scratch, FieldMemOperand(function_map, Map::kBitFieldOffset));
1376 __ tst(scratch, Operand(1 << Map::kHasNonInstancePrototype)); 1380 __ tst(scratch, Operand(1 << Map::kHasNonInstancePrototype));
1377 __ b(ne, &slow_case); 1381 __ b(ne, &slow_case);
1378 1382
1379 // Get the "prototype" (or initial map) of the {function}. 1383 // Get the "prototype" (or initial map) of the {function}.
1380 __ ldr(function_prototype, 1384 __ ldr(function_prototype,
1381 FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); 1385 FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset));
1382 __ AssertNotSmi(function_prototype); 1386 __ AssertNotSmi(function_prototype);
1383 1387
1384 // Resolve the prototype if the {function} has an initial map. Afterwards the 1388 // Resolve the prototype if the {function} has an initial map. Afterwards the
1385 // {function_prototype} will be either the JSReceiver prototype object or the 1389 // {function_prototype} will be either the JSReceiver prototype object or the
(...skipping 4180 matching lines...) Expand 10 before | Expand all | Expand 10 after
5566 kStackUnwindSpace, NULL, return_value_operand, NULL); 5570 kStackUnwindSpace, NULL, return_value_operand, NULL);
5567 } 5571 }
5568 5572
5569 5573
5570 #undef __ 5574 #undef __
5571 5575
5572 } // namespace internal 5576 } // namespace internal
5573 } // namespace v8 5577 } // namespace v8
5574 5578
5575 #endif // V8_TARGET_ARCH_ARM 5579 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm64/code-stubs-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698