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

Side by Side Diff: src/crankshaft/x64/lithium-codegen-x64.cc

Issue 2041103007: [es6] Fix prototype chain walk for instanceof. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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/crankshaft/s390/lithium-codegen-s390.cc ('k') | src/crankshaft/x87/lithium-codegen-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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/crankshaft/x64/lithium-codegen-x64.h" 7 #include "src/crankshaft/x64/lithium-codegen-x64.h"
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 2439 matching lines...) Expand 10 before | Expand all | Expand 10 after
2450 if (instr->hydrogen()->ObjectNeedsSmiCheck()) { 2450 if (instr->hydrogen()->ObjectNeedsSmiCheck()) {
2451 Condition is_smi = __ CheckSmi(object); 2451 Condition is_smi = __ CheckSmi(object);
2452 EmitFalseBranch(instr, is_smi); 2452 EmitFalseBranch(instr, is_smi);
2453 } 2453 }
2454 2454
2455 // Loop through the {object}s prototype chain looking for the {prototype}. 2455 // Loop through the {object}s prototype chain looking for the {prototype}.
2456 __ movp(object_map, FieldOperand(object, HeapObject::kMapOffset)); 2456 __ movp(object_map, FieldOperand(object, HeapObject::kMapOffset));
2457 Label loop; 2457 Label loop;
2458 __ bind(&loop); 2458 __ bind(&loop);
2459 2459
2460
2461 // Deoptimize if the object needs to be access checked. 2460 // Deoptimize if the object needs to be access checked.
2462 __ testb(FieldOperand(object_map, Map::kBitFieldOffset), 2461 __ testb(FieldOperand(object_map, Map::kBitFieldOffset),
2463 Immediate(1 << Map::kIsAccessCheckNeeded)); 2462 Immediate(1 << Map::kIsAccessCheckNeeded));
2464 DeoptimizeIf(not_zero, instr, Deoptimizer::kAccessCheck); 2463 DeoptimizeIf(not_zero, instr, Deoptimizer::kAccessCheck);
2465 // Deoptimize for proxies. 2464 // Deoptimize for proxies.
2466 __ CmpInstanceType(object_map, JS_PROXY_TYPE); 2465 __ CmpInstanceType(object_map, JS_PROXY_TYPE);
2467 DeoptimizeIf(equal, instr, Deoptimizer::kProxy); 2466 DeoptimizeIf(equal, instr, Deoptimizer::kProxy);
2468 2467
2469 __ movp(object_prototype, FieldOperand(object_map, Map::kPrototypeOffset)); 2468 __ movp(object_prototype, FieldOperand(object_map, Map::kPrototypeOffset));
2469 __ CompareRoot(object_prototype, Heap::kNullValueRootIndex);
2470 EmitFalseBranch(instr, equal);
2470 __ cmpp(object_prototype, prototype); 2471 __ cmpp(object_prototype, prototype);
2471 EmitTrueBranch(instr, equal); 2472 EmitTrueBranch(instr, equal);
2472 __ CompareRoot(object_prototype, Heap::kNullValueRootIndex);
2473 EmitFalseBranch(instr, equal);
2474 __ movp(object_map, FieldOperand(object_prototype, HeapObject::kMapOffset)); 2473 __ movp(object_map, FieldOperand(object_prototype, HeapObject::kMapOffset));
2475 __ jmp(&loop); 2474 __ jmp(&loop);
2476 } 2475 }
2477 2476
2478 2477
2479 void LCodeGen::DoCmpT(LCmpT* instr) { 2478 void LCodeGen::DoCmpT(LCmpT* instr) {
2480 DCHECK(ToRegister(instr->context()).is(rsi)); 2479 DCHECK(ToRegister(instr->context()).is(rsi));
2481 Token::Value op = instr->op(); 2480 Token::Value op = instr->op();
2482 2481
2483 Handle<Code> ic = CodeFactory::CompareIC(isolate(), op).code(); 2482 Handle<Code> ic = CodeFactory::CompareIC(isolate(), op).code();
(...skipping 3141 matching lines...) Expand 10 before | Expand all | Expand 10 after
5625 __ bind(deferred->exit()); 5624 __ bind(deferred->exit());
5626 __ bind(&done); 5625 __ bind(&done);
5627 } 5626 }
5628 5627
5629 #undef __ 5628 #undef __
5630 5629
5631 } // namespace internal 5630 } // namespace internal
5632 } // namespace v8 5631 } // namespace v8
5633 5632
5634 #endif // V8_TARGET_ARCH_X64 5633 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/crankshaft/s390/lithium-codegen-s390.cc ('k') | src/crankshaft/x87/lithium-codegen-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698