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

Side by Side Diff: src/mips/stub-cache-mips.cc

Issue 19847003: MIPS: Convert CONSTANT_FUNCTION to CONSTANT (Closed) Base URL: https://github.com/v8/v8.git@gbl
Patch Set: Created 7 years, 5 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/mips/lithium-codegen-mips.cc ('k') | no next file » | 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 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 Label* slow) { 463 Label* slow) {
464 // a0 : value. 464 // a0 : value.
465 Label exit; 465 Label exit;
466 466
467 int descriptor = transition->LastAdded(); 467 int descriptor = transition->LastAdded();
468 DescriptorArray* descriptors = transition->instance_descriptors(); 468 DescriptorArray* descriptors = transition->instance_descriptors();
469 PropertyDetails details = descriptors->GetDetails(descriptor); 469 PropertyDetails details = descriptors->GetDetails(descriptor);
470 Representation representation = details.representation(); 470 Representation representation = details.representation();
471 ASSERT(!representation.IsNone()); 471 ASSERT(!representation.IsNone());
472 472
473 if (details.type() == CONSTANT_FUNCTION) { 473 if (details.type() == CONSTANT) {
474 Handle<HeapObject> constant( 474 Handle<Object> constant(descriptors->GetValue(descriptor), masm->isolate());
475 HeapObject::cast(descriptors->GetValue(descriptor))); 475 __ LoadObject(scratch1, constant);
476 __ LoadHeapObject(scratch1, constant);
477 __ Branch(miss_label, ne, value_reg, Operand(scratch1)); 476 __ Branch(miss_label, ne, value_reg, Operand(scratch1));
478 } else if (FLAG_track_fields && representation.IsSmi()) { 477 } else if (FLAG_track_fields && representation.IsSmi()) {
479 __ JumpIfNotSmi(value_reg, miss_label); 478 __ JumpIfNotSmi(value_reg, miss_label);
480 } else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { 479 } else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) {
481 __ JumpIfSmi(value_reg, miss_label); 480 __ JumpIfSmi(value_reg, miss_label);
482 } else if (FLAG_track_double_fields && representation.IsDouble()) { 481 } else if (FLAG_track_double_fields && representation.IsDouble()) {
483 Label do_store, heap_number; 482 Label do_store, heap_number;
484 __ LoadRoot(scratch3, Heap::kHeapNumberMapRootIndex); 483 __ LoadRoot(scratch3, Heap::kHeapNumberMapRootIndex);
485 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, scratch3, slow); 484 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, scratch3, slow);
486 485
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 // Update the write barrier for the map field. 524 // Update the write barrier for the map field.
526 __ RecordWriteField(receiver_reg, 525 __ RecordWriteField(receiver_reg,
527 HeapObject::kMapOffset, 526 HeapObject::kMapOffset,
528 scratch1, 527 scratch1,
529 scratch2, 528 scratch2,
530 kRAHasNotBeenSaved, 529 kRAHasNotBeenSaved,
531 kDontSaveFPRegs, 530 kDontSaveFPRegs,
532 OMIT_REMEMBERED_SET, 531 OMIT_REMEMBERED_SET,
533 OMIT_SMI_CHECK); 532 OMIT_SMI_CHECK);
534 533
535 if (details.type() == CONSTANT_FUNCTION) { 534 if (details.type() == CONSTANT) {
536 ASSERT(value_reg.is(a0)); 535 ASSERT(value_reg.is(a0));
537 __ Ret(USE_DELAY_SLOT); 536 __ Ret(USE_DELAY_SLOT);
538 __ mov(v0, a0); 537 __ mov(v0, a0);
539 return; 538 return;
540 } 539 }
541 540
542 int index = transition->instance_descriptors()->GetFieldIndex( 541 int index = transition->instance_descriptors()->GetFieldIndex(
543 transition->LastAdded()); 542 transition->LastAdded());
544 543
545 // Adjust for the number of properties stored in the object. Even in the 544 // Adjust for the number of properties stored in the object. Even in the
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after
1397 GenerateTailCall(masm(), stub.GetCode(isolate())); 1396 GenerateTailCall(masm(), stub.GetCode(isolate()));
1398 } else { 1397 } else {
1399 KeyedLoadFieldStub stub(field.is_inobject(holder), 1398 KeyedLoadFieldStub stub(field.is_inobject(holder),
1400 field.translate(holder), 1399 field.translate(holder),
1401 representation); 1400 representation);
1402 GenerateTailCall(masm(), stub.GetCode(isolate())); 1401 GenerateTailCall(masm(), stub.GetCode(isolate()));
1403 } 1402 }
1404 } 1403 }
1405 1404
1406 1405
1407 void BaseLoadStubCompiler::GenerateLoadConstant(Handle<JSFunction> value) { 1406 void BaseLoadStubCompiler::GenerateLoadConstant(Handle<Object> value) {
1408 // Return the constant value. 1407 // Return the constant value.
1409 __ LoadHeapObject(v0, value); 1408 __ LoadObject(v0, value);
1410 __ Ret(); 1409 __ Ret();
1411 } 1410 }
1412 1411
1413 1412
1414 void BaseLoadStubCompiler::GenerateLoadCallback( 1413 void BaseLoadStubCompiler::GenerateLoadCallback(
1415 Register reg, 1414 Register reg,
1416 Handle<ExecutableAccessorInfo> callback) { 1415 Handle<ExecutableAccessorInfo> callback) {
1417 // Build AccessorInfo::args_ list on the stack and push property name below 1416 // Build AccessorInfo::args_ list on the stack and push property name below
1418 // the exit frame to make GC aware of them and store pointers to them. 1417 // the exit frame to make GC aware of them and store pointers to them.
1419 __ push(receiver()); 1418 __ push(receiver());
(...skipping 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after
2702 Handle<Code> CallStubCompiler::CompileCallConstant( 2701 Handle<Code> CallStubCompiler::CompileCallConstant(
2703 Handle<Object> object, 2702 Handle<Object> object,
2704 Handle<JSObject> holder, 2703 Handle<JSObject> holder,
2705 Handle<Name> name, 2704 Handle<Name> name,
2706 CheckType check, 2705 CheckType check,
2707 Handle<JSFunction> function) { 2706 Handle<JSFunction> function) {
2708 if (HasCustomCallGenerator(function)) { 2707 if (HasCustomCallGenerator(function)) {
2709 Handle<Code> code = CompileCustomCall(object, holder, 2708 Handle<Code> code = CompileCustomCall(object, holder,
2710 Handle<Cell>::null(), 2709 Handle<Cell>::null(),
2711 function, Handle<String>::cast(name), 2710 function, Handle<String>::cast(name),
2712 Code::CONSTANT_FUNCTION); 2711 Code::CONSTANT);
2713 // A null handle means bail out to the regular compiler code below. 2712 // A null handle means bail out to the regular compiler code below.
2714 if (!code.is_null()) return code; 2713 if (!code.is_null()) return code;
2715 } 2714 }
2716 2715
2717 Label success; 2716 Label success;
2718 2717
2719 CompileHandlerFrontend(object, holder, name, check, &success); 2718 CompileHandlerFrontend(object, holder, name, check, &success);
2720 __ bind(&success); 2719 __ bind(&success);
2721 CompileHandlerBackend(function); 2720 CompileHandlerBackend(function);
2722 2721
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after
3792 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow); 3791 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow);
3793 } 3792 }
3794 } 3793 }
3795 3794
3796 3795
3797 #undef __ 3796 #undef __
3798 3797
3799 } } // namespace v8::internal 3798 } } // namespace v8::internal
3800 3799
3801 #endif // V8_TARGET_ARCH_MIPS 3800 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698