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

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

Issue 1526253006: MIPS: Fix `[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: 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
« no previous file with comments | « no previous file | src/crankshaft/mips64/lithium-codegen-mips64.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.7 1 // Copyright 2012 the V8 project authors. All rights reserved.7
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2528 matching lines...) Expand 10 before | Expand all | Expand 10 after
2539 Register const object_prototype = object_map; 2539 Register const object_prototype = object_map;
2540 Register const prototype = ToRegister(instr->prototype()); 2540 Register const prototype = ToRegister(instr->prototype());
2541 2541
2542 // The {object} must be a spec object. It's sufficient to know that {object} 2542 // The {object} must be a spec object. It's sufficient to know that {object}
2543 // is not a smi, since all other non-spec objects have {null} prototypes and 2543 // is not a smi, since all other non-spec objects have {null} prototypes and
2544 // will be ruled out below. 2544 // will be ruled out below.
2545 if (instr->hydrogen()->ObjectNeedsSmiCheck()) { 2545 if (instr->hydrogen()->ObjectNeedsSmiCheck()) {
2546 __ SmiTst(object, at); 2546 __ SmiTst(object, at);
2547 EmitFalseBranch(instr, eq, at, Operand(zero_reg)); 2547 EmitFalseBranch(instr, eq, at, Operand(zero_reg));
2548 } 2548 }
2549
2549 // Loop through the {object}s prototype chain looking for the {prototype}. 2550 // Loop through the {object}s prototype chain looking for the {prototype}.
2550 __ lw(object_map, FieldMemOperand(object, HeapObject::kMapOffset)); 2551 __ lw(object_map, FieldMemOperand(object, HeapObject::kMapOffset));
2551 Label loop; 2552 Label loop;
2552 __ bind(&loop); 2553 __ bind(&loop);
2554
2555 // Deoptimize if the object needs to be access checked.
2556 __ lbu(object_instance_type,
2557 FieldMemOperand(object_map, Map::kBitFieldOffset));
2558 __ And(object_instance_type, object_instance_type,
2559 Operand(1 << Map::kIsAccessCheckNeeded));
2560 DeoptimizeIf(ne, instr, Deoptimizer::kAccessCheck, object_instance_type,
2561 Operand(zero_reg));
2562 // Deoptimize for proxies.
2553 __ lbu(object_instance_type, 2563 __ lbu(object_instance_type,
2554 FieldMemOperand(object_map, Map::kInstanceTypeOffset)); 2564 FieldMemOperand(object_map, Map::kInstanceTypeOffset));
2555 DeoptimizeIf(eq, instr, Deoptimizer::kProxy, object_instance_type, 2565 DeoptimizeIf(eq, instr, Deoptimizer::kProxy, object_instance_type,
2556 Operand(JS_PROXY_TYPE)); 2566 Operand(JS_PROXY_TYPE));
2567
2557 __ lw(object_prototype, FieldMemOperand(object_map, Map::kPrototypeOffset)); 2568 __ lw(object_prototype, FieldMemOperand(object_map, Map::kPrototypeOffset));
2558 EmitTrueBranch(instr, eq, object_prototype, Operand(prototype)); 2569 EmitTrueBranch(instr, eq, object_prototype, Operand(prototype));
2559 __ LoadRoot(at, Heap::kNullValueRootIndex); 2570 __ LoadRoot(at, Heap::kNullValueRootIndex);
2560 EmitFalseBranch(instr, eq, object_prototype, Operand(at)); 2571 EmitFalseBranch(instr, eq, object_prototype, Operand(at));
2561 __ Branch(USE_DELAY_SLOT, &loop); 2572 __ Branch(USE_DELAY_SLOT, &loop);
2562 __ lw(object_map, FieldMemOperand(object_prototype, HeapObject::kMapOffset)); 2573 __ lw(object_map, FieldMemOperand(object_prototype, HeapObject::kMapOffset));
2563 } 2574 }
2564 2575
2565 2576
2566 void LCodeGen::DoCmpT(LCmpT* instr) { 2577 void LCodeGen::DoCmpT(LCmpT* instr) {
(...skipping 3098 matching lines...) Expand 10 before | Expand all | Expand 10 after
5665 __ Push(at, ToRegister(instr->function())); 5676 __ Push(at, ToRegister(instr->function()));
5666 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5677 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5667 RecordSafepoint(Safepoint::kNoLazyDeopt); 5678 RecordSafepoint(Safepoint::kNoLazyDeopt);
5668 } 5679 }
5669 5680
5670 5681
5671 #undef __ 5682 #undef __
5672 5683
5673 } // namespace internal 5684 } // namespace internal
5674 } // namespace v8 5685 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/crankshaft/mips64/lithium-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698