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

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

Issue 16858003: MIPS: Separate Cell and PropertyCell spaces (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed nits. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/mips/full-codegen-mips.cc ('k') | src/mips/macro-assembler-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 // 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 2421 matching lines...) Expand 10 before | Expand all | Expand 10 after
2432 // instanceof stub. 2432 // instanceof stub.
2433 Label cache_miss; 2433 Label cache_miss;
2434 Register map = temp; 2434 Register map = temp;
2435 __ lw(map, FieldMemOperand(object, HeapObject::kMapOffset)); 2435 __ lw(map, FieldMemOperand(object, HeapObject::kMapOffset));
2436 2436
2437 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); 2437 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_);
2438 __ bind(deferred->map_check()); // Label for calculating code patching. 2438 __ bind(deferred->map_check()); // Label for calculating code patching.
2439 // We use Factory::the_hole_value() on purpose instead of loading from the 2439 // We use Factory::the_hole_value() on purpose instead of loading from the
2440 // root array to force relocation to be able to later patch with 2440 // root array to force relocation to be able to later patch with
2441 // the cached map. 2441 // the cached map.
2442 Handle<JSGlobalPropertyCell> cell = 2442 Handle<Cell> cell = factory()->NewCell(factory()->the_hole_value());
2443 factory()->NewJSGlobalPropertyCell(factory()->the_hole_value());
2444 __ li(at, Operand(Handle<Object>(cell))); 2443 __ li(at, Operand(Handle<Object>(cell)));
2445 __ lw(at, FieldMemOperand(at, JSGlobalPropertyCell::kValueOffset)); 2444 __ lw(at, FieldMemOperand(at, JSGlobalPropertyCell::kValueOffset));
2446 __ Branch(&cache_miss, ne, map, Operand(at)); 2445 __ Branch(&cache_miss, ne, map, Operand(at));
2447 // We use Factory::the_hole_value() on purpose instead of loading from the 2446 // We use Factory::the_hole_value() on purpose instead of loading from the
2448 // root array to force relocation to be able to later patch 2447 // root array to force relocation to be able to later patch
2449 // with true or false. 2448 // with true or false.
2450 __ li(result, Operand(factory()->the_hole_value()), CONSTANT_SIZE); 2449 __ li(result, Operand(factory()->the_hole_value()), CONSTANT_SIZE);
2451 __ Branch(&done); 2450 __ Branch(&done);
2452 2451
2453 // The inlined call site cache did not match. Check null and string before 2452 // The inlined call site cache did not match. Check null and string before
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
2589 2588
2590 if (no_frame_start != -1) { 2589 if (no_frame_start != -1) {
2591 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); 2590 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset());
2592 } 2591 }
2593 } 2592 }
2594 2593
2595 2594
2596 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { 2595 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) {
2597 Register result = ToRegister(instr->result()); 2596 Register result = ToRegister(instr->result());
2598 __ li(at, Operand(Handle<Object>(instr->hydrogen()->cell()))); 2597 __ li(at, Operand(Handle<Object>(instr->hydrogen()->cell())));
2599 __ lw(result, FieldMemOperand(at, JSGlobalPropertyCell::kValueOffset)); 2598 __ lw(result, FieldMemOperand(at, Cell::kValueOffset));
2600 if (instr->hydrogen()->RequiresHoleCheck()) { 2599 if (instr->hydrogen()->RequiresHoleCheck()) {
2601 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); 2600 __ LoadRoot(at, Heap::kTheHoleValueRootIndex);
2602 DeoptimizeIf(eq, instr->environment(), result, Operand(at)); 2601 DeoptimizeIf(eq, instr->environment(), result, Operand(at));
2603 } 2602 }
2604 } 2603 }
2605 2604
2606 2605
2607 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { 2606 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) {
2608 ASSERT(ToRegister(instr->global_object()).is(a0)); 2607 ASSERT(ToRegister(instr->global_object()).is(a0));
2609 ASSERT(ToRegister(instr->result()).is(v0)); 2608 ASSERT(ToRegister(instr->result()).is(v0));
(...skipping 13 matching lines...) Expand all
2623 // Load the cell. 2622 // Load the cell.
2624 __ li(cell, Operand(instr->hydrogen()->cell())); 2623 __ li(cell, Operand(instr->hydrogen()->cell()));
2625 2624
2626 // If the cell we are storing to contains the hole it could have 2625 // If the cell we are storing to contains the hole it could have
2627 // been deleted from the property dictionary. In that case, we need 2626 // been deleted from the property dictionary. In that case, we need
2628 // to update the property details in the property dictionary to mark 2627 // to update the property details in the property dictionary to mark
2629 // it as no longer deleted. 2628 // it as no longer deleted.
2630 if (instr->hydrogen()->RequiresHoleCheck()) { 2629 if (instr->hydrogen()->RequiresHoleCheck()) {
2631 // We use a temp to check the payload. 2630 // We use a temp to check the payload.
2632 Register payload = ToRegister(instr->temp()); 2631 Register payload = ToRegister(instr->temp());
2633 __ lw(payload, FieldMemOperand(cell, JSGlobalPropertyCell::kValueOffset)); 2632 __ lw(payload, FieldMemOperand(cell, Cell::kValueOffset));
2634 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); 2633 __ LoadRoot(at, Heap::kTheHoleValueRootIndex);
2635 DeoptimizeIf(eq, instr->environment(), payload, Operand(at)); 2634 DeoptimizeIf(eq, instr->environment(), payload, Operand(at));
2636 } 2635 }
2637 2636
2638 // Store the value. 2637 // Store the value.
2639 __ sw(value, FieldMemOperand(cell, JSGlobalPropertyCell::kValueOffset)); 2638 __ sw(value, FieldMemOperand(cell, Cell::kValueOffset));
2640 // Cells are always rescanned, so no write barrier here. 2639 // Cells are always rescanned, so no write barrier here.
2641 } 2640 }
2642 2641
2643 2642
2644 void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) { 2643 void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) {
2645 ASSERT(ToRegister(instr->global_object()).is(a1)); 2644 ASSERT(ToRegister(instr->global_object()).is(a1));
2646 ASSERT(ToRegister(instr->value()).is(a0)); 2645 ASSERT(ToRegister(instr->value()).is(a0));
2647 2646
2648 __ li(a2, Operand(instr->name())); 2647 __ li(a2, Operand(instr->name()));
2649 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) 2648 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode)
(...skipping 2344 matching lines...) Expand 10 before | Expand all | Expand 10 after
4994 } 4993 }
4995 } 4994 }
4996 4995
4997 4996
4998 void LCodeGen::DoCheckFunction(LCheckFunction* instr) { 4997 void LCodeGen::DoCheckFunction(LCheckFunction* instr) {
4999 Register reg = ToRegister(instr->value()); 4998 Register reg = ToRegister(instr->value());
5000 Handle<JSFunction> target = instr->hydrogen()->target(); 4999 Handle<JSFunction> target = instr->hydrogen()->target();
5001 AllowDeferredHandleDereference smi_check; 5000 AllowDeferredHandleDereference smi_check;
5002 if (isolate()->heap()->InNewSpace(*target)) { 5001 if (isolate()->heap()->InNewSpace(*target)) {
5003 Register reg = ToRegister(instr->value()); 5002 Register reg = ToRegister(instr->value());
5004 Handle<JSGlobalPropertyCell> cell = 5003 Handle<Cell> cell = isolate()->factory()->NewJSGlobalPropertyCell(target);
5005 isolate()->factory()->NewJSGlobalPropertyCell(target);
5006 __ li(at, Operand(Handle<Object>(cell))); 5004 __ li(at, Operand(Handle<Object>(cell)));
5007 __ lw(at, FieldMemOperand(at, JSGlobalPropertyCell::kValueOffset)); 5005 __ lw(at, FieldMemOperand(at, Cell::kValueOffset));
5008 DeoptimizeIf(ne, instr->environment(), reg, 5006 DeoptimizeIf(ne, instr->environment(), reg,
5009 Operand(at)); 5007 Operand(at));
5010 } else { 5008 } else {
5011 DeoptimizeIf(ne, instr->environment(), reg, 5009 DeoptimizeIf(ne, instr->environment(), reg,
5012 Operand(target)); 5010 Operand(target));
5013 } 5011 }
5014 } 5012 }
5015 5013
5016 5014
5017 void LCodeGen::DoCheckMapCommon(Register map_reg, 5015 void LCodeGen::DoCheckMapCommon(Register map_reg,
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
5666 __ Subu(scratch, result, scratch); 5664 __ Subu(scratch, result, scratch);
5667 __ lw(result, FieldMemOperand(scratch, 5665 __ lw(result, FieldMemOperand(scratch,
5668 FixedArray::kHeaderSize - kPointerSize)); 5666 FixedArray::kHeaderSize - kPointerSize));
5669 __ bind(&done); 5667 __ bind(&done);
5670 } 5668 }
5671 5669
5672 5670
5673 #undef __ 5671 #undef __
5674 5672
5675 } } // namespace v8::internal 5673 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mips/full-codegen-mips.cc ('k') | src/mips/macro-assembler-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698