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

Side by Side Diff: src/ia32/code-stubs-ia32.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 | « src/arm64/code-stubs-arm64.cc ('k') | src/mips/code-stubs-mips.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_IA32 5 #if V8_TARGET_ARCH_IA32
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 2119 matching lines...) Expand 10 before | Expand all | Expand 10 after
2130 __ j(not_equal, &slow_case); 2130 __ j(not_equal, &slow_case);
2131 __ LoadRoot(eax, Heap::kFalseValueRootIndex); 2131 __ LoadRoot(eax, Heap::kFalseValueRootIndex);
2132 __ ret(0); 2132 __ ret(0);
2133 2133
2134 // Fast-case: The {function} must be a valid JSFunction. 2134 // Fast-case: The {function} must be a valid JSFunction.
2135 __ bind(&fast_case); 2135 __ bind(&fast_case);
2136 __ JumpIfSmi(function, &slow_case); 2136 __ JumpIfSmi(function, &slow_case);
2137 __ CmpObjectType(function, JS_FUNCTION_TYPE, function_map); 2137 __ CmpObjectType(function, JS_FUNCTION_TYPE, function_map);
2138 __ j(not_equal, &slow_case); 2138 __ j(not_equal, &slow_case);
2139 2139
2140 // Go to the runtime if the function is not a constructor.
2141 __ test_b(FieldOperand(function_map, Map::kBitFieldOffset),
2142 static_cast<uint8_t>(1 << Map::kIsConstructor));
2143 __ j(zero, &slow_case);
2144
2140 // Ensure that {function} has an instance prototype. 2145 // Ensure that {function} has an instance prototype.
2141 __ test_b(FieldOperand(function_map, Map::kBitFieldOffset), 2146 __ test_b(FieldOperand(function_map, Map::kBitFieldOffset),
2142 static_cast<uint8_t>(1 << Map::kHasNonInstancePrototype)); 2147 static_cast<uint8_t>(1 << Map::kHasNonInstancePrototype));
2143 __ j(not_zero, &slow_case); 2148 __ j(not_zero, &slow_case);
2144 2149
2145 // Get the "prototype" (or initial map) of the {function}. 2150 // Get the "prototype" (or initial map) of the {function}.
2146 __ mov(function_prototype, 2151 __ mov(function_prototype,
2147 FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); 2152 FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset));
2148 __ AssertNotSmi(function_prototype); 2153 __ AssertNotSmi(function_prototype);
2149 2154
(...skipping 3708 matching lines...) Expand 10 before | Expand all | Expand 10 after
5858 return_value_operand, NULL); 5863 return_value_operand, NULL);
5859 } 5864 }
5860 5865
5861 5866
5862 #undef __ 5867 #undef __
5863 5868
5864 } // namespace internal 5869 } // namespace internal
5865 } // namespace v8 5870 } // namespace v8
5866 5871
5867 #endif // V8_TARGET_ARCH_IA32 5872 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/arm64/code-stubs-arm64.cc ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698