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

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

Issue 1521953002: [proxies] fix access issue when having proxies on the prototype-chain of global objects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: ppc code mess Created 5 years 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
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 2581 matching lines...) Expand 10 before | Expand all | Expand 10 after
2592 // will be ruled out below. 2592 // will be ruled out below.
2593 if (instr->hydrogen()->ObjectNeedsSmiCheck()) { 2593 if (instr->hydrogen()->ObjectNeedsSmiCheck()) {
2594 Condition is_smi = __ CheckSmi(object); 2594 Condition is_smi = __ CheckSmi(object);
2595 EmitFalseBranch(instr, is_smi); 2595 EmitFalseBranch(instr, is_smi);
2596 } 2596 }
2597 2597
2598 // Loop through the {object}s prototype chain looking for the {prototype}. 2598 // Loop through the {object}s prototype chain looking for the {prototype}.
2599 __ movp(object_map, FieldOperand(object, HeapObject::kMapOffset)); 2599 __ movp(object_map, FieldOperand(object, HeapObject::kMapOffset));
2600 Label loop; 2600 Label loop;
2601 __ bind(&loop); 2601 __ bind(&loop);
2602
2603
2604 // Deoptimize if the object needs to be access checked.
2605 __ testb(FieldOperand(object_map, Map::kBitFieldOffset),
2606 Immediate(1 << Map::kIsAccessCheckNeeded));
2607 DeoptimizeIf(not_zero, instr, Deoptimizer::kAccessCheck);
2608 // Deoptimize for proxies.
2602 __ CmpInstanceType(object_map, JS_PROXY_TYPE); 2609 __ CmpInstanceType(object_map, JS_PROXY_TYPE);
2603 DeoptimizeIf(equal, instr, Deoptimizer::kProxy); 2610 DeoptimizeIf(equal, instr, Deoptimizer::kProxy);
2611
2604 __ movp(object_prototype, FieldOperand(object_map, Map::kPrototypeOffset)); 2612 __ movp(object_prototype, FieldOperand(object_map, Map::kPrototypeOffset));
2605 __ cmpp(object_prototype, prototype); 2613 __ cmpp(object_prototype, prototype);
2606 EmitTrueBranch(instr, equal); 2614 EmitTrueBranch(instr, equal);
2607 __ CompareRoot(object_prototype, Heap::kNullValueRootIndex); 2615 __ CompareRoot(object_prototype, Heap::kNullValueRootIndex);
2608 EmitFalseBranch(instr, equal); 2616 EmitFalseBranch(instr, equal);
2609 __ movp(object_map, FieldOperand(object_prototype, HeapObject::kMapOffset)); 2617 __ movp(object_map, FieldOperand(object_prototype, HeapObject::kMapOffset));
2610 __ jmp(&loop); 2618 __ jmp(&loop);
2611 } 2619 }
2612 2620
2613 2621
(...skipping 3093 matching lines...) Expand 10 before | Expand all | Expand 10 after
5707 RecordSafepoint(Safepoint::kNoLazyDeopt); 5715 RecordSafepoint(Safepoint::kNoLazyDeopt);
5708 } 5716 }
5709 5717
5710 5718
5711 #undef __ 5719 #undef __
5712 5720
5713 } // namespace internal 5721 } // namespace internal
5714 } // namespace v8 5722 } // namespace v8
5715 5723
5716 #endif // V8_TARGET_ARCH_X64 5724 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/crankshaft/ia32/lithium-codegen-ia32.cc ('k') | src/deoptimizer.h » ('j') | src/prototype.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698