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

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

Issue 1811013002: PPC: 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 | 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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_PPC 5 #if V8_TARGET_ARCH_PPC
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 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after
1414 __ bne(&slow_case); 1414 __ bne(&slow_case);
1415 __ LoadRoot(r3, Heap::kFalseValueRootIndex); 1415 __ LoadRoot(r3, Heap::kFalseValueRootIndex);
1416 __ Ret(); 1416 __ Ret();
1417 1417
1418 // Fast-case: The {function} must be a valid JSFunction. 1418 // Fast-case: The {function} must be a valid JSFunction.
1419 __ bind(&fast_case); 1419 __ bind(&fast_case);
1420 __ JumpIfSmi(function, &slow_case); 1420 __ JumpIfSmi(function, &slow_case);
1421 __ CompareObjectType(function, function_map, scratch, JS_FUNCTION_TYPE); 1421 __ CompareObjectType(function, function_map, scratch, JS_FUNCTION_TYPE);
1422 __ bne(&slow_case); 1422 __ bne(&slow_case);
1423 1423
1424 // Go to the runtime if the function is not a constructor.
1425 __ lbz(scratch, FieldMemOperand(function_map, Map::kBitFieldOffset));
1426 __ TestBit(scratch, Map::kIsConstructor, r0);
1427 __ beq(&slow_case, cr0);
1428
1424 // Ensure that {function} has an instance prototype. 1429 // Ensure that {function} has an instance prototype.
1425 __ lbz(scratch, FieldMemOperand(function_map, Map::kBitFieldOffset));
1426 __ TestBit(scratch, Map::kHasNonInstancePrototype, r0); 1430 __ TestBit(scratch, Map::kHasNonInstancePrototype, r0);
1427 __ bne(&slow_case, cr0); 1431 __ bne(&slow_case, cr0);
1428 1432
1429 // Get the "prototype" (or initial map) of the {function}. 1433 // Get the "prototype" (or initial map) of the {function}.
1430 __ LoadP(function_prototype, 1434 __ LoadP(function_prototype,
1431 FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); 1435 FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset));
1432 __ AssertNotSmi(function_prototype); 1436 __ AssertNotSmi(function_prototype);
1433 1437
1434 // Resolve the prototype if the {function} has an initial map. Afterwards the 1438 // Resolve the prototype if the {function} has an initial map. Afterwards the
1435 // {function_prototype} will be either the JSReceiver prototype object or the 1439 // {function_prototype} will be either the JSReceiver prototype object or the
(...skipping 4372 matching lines...) Expand 10 before | Expand all | Expand 10 after
5808 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, 5812 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref,
5809 kStackUnwindSpace, NULL, return_value_operand, NULL); 5813 kStackUnwindSpace, NULL, return_value_operand, NULL);
5810 } 5814 }
5811 5815
5812 5816
5813 #undef __ 5817 #undef __
5814 } // namespace internal 5818 } // namespace internal
5815 } // namespace v8 5819 } // namespace v8
5816 5820
5817 #endif // V8_TARGET_ARCH_PPC 5821 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698