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

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

Issue 19485008: Replace CONSTANT_FUNCTION by CONSTANT (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 years, 4 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/arm/lithium-codegen-arm.cc ('k') | src/ast.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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 Label* slow) { 472 Label* slow) {
473 // r0 : value 473 // r0 : value
474 Label exit; 474 Label exit;
475 475
476 int descriptor = transition->LastAdded(); 476 int descriptor = transition->LastAdded();
477 DescriptorArray* descriptors = transition->instance_descriptors(); 477 DescriptorArray* descriptors = transition->instance_descriptors();
478 PropertyDetails details = descriptors->GetDetails(descriptor); 478 PropertyDetails details = descriptors->GetDetails(descriptor);
479 Representation representation = details.representation(); 479 Representation representation = details.representation();
480 ASSERT(!representation.IsNone()); 480 ASSERT(!representation.IsNone());
481 481
482 if (details.type() == CONSTANT_FUNCTION) { 482 if (details.type() == CONSTANT) {
483 Handle<HeapObject> constant( 483 Handle<Object> constant(descriptors->GetValue(descriptor), masm->isolate());
484 HeapObject::cast(descriptors->GetValue(descriptor))); 484 __ LoadObject(scratch1, constant);
485 __ LoadHeapObject(scratch1, constant);
486 __ cmp(value_reg, scratch1); 485 __ cmp(value_reg, scratch1);
487 __ b(ne, miss_label); 486 __ b(ne, miss_label);
488 } else if (FLAG_track_fields && representation.IsSmi()) { 487 } else if (FLAG_track_fields && representation.IsSmi()) {
489 __ JumpIfNotSmi(value_reg, miss_label); 488 __ JumpIfNotSmi(value_reg, miss_label);
490 } else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { 489 } else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) {
491 __ JumpIfSmi(value_reg, miss_label); 490 __ JumpIfSmi(value_reg, miss_label);
492 } else if (FLAG_track_double_fields && representation.IsDouble()) { 491 } else if (FLAG_track_double_fields && representation.IsDouble()) {
493 Label do_store, heap_number; 492 Label do_store, heap_number;
494 __ LoadRoot(scratch3, Heap::kHeapNumberMapRootIndex); 493 __ LoadRoot(scratch3, Heap::kHeapNumberMapRootIndex);
495 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, scratch3, slow); 494 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, scratch3, slow);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 // Update the write barrier for the map field. 535 // Update the write barrier for the map field.
537 __ RecordWriteField(receiver_reg, 536 __ RecordWriteField(receiver_reg,
538 HeapObject::kMapOffset, 537 HeapObject::kMapOffset,
539 scratch1, 538 scratch1,
540 scratch2, 539 scratch2,
541 kLRHasNotBeenSaved, 540 kLRHasNotBeenSaved,
542 kDontSaveFPRegs, 541 kDontSaveFPRegs,
543 OMIT_REMEMBERED_SET, 542 OMIT_REMEMBERED_SET,
544 OMIT_SMI_CHECK); 543 OMIT_SMI_CHECK);
545 544
546 if (details.type() == CONSTANT_FUNCTION) { 545 if (details.type() == CONSTANT) {
547 ASSERT(value_reg.is(r0)); 546 ASSERT(value_reg.is(r0));
548 __ Ret(); 547 __ Ret();
549 return; 548 return;
550 } 549 }
551 550
552 int index = transition->instance_descriptors()->GetFieldIndex( 551 int index = transition->instance_descriptors()->GetFieldIndex(
553 transition->LastAdded()); 552 transition->LastAdded());
554 553
555 // Adjust for the number of properties stored in the object. Even in the 554 // Adjust for the number of properties stored in the object. Even in the
556 // face of a transition we can use the old map here because the size of the 555 // face of a transition we can use the old map here because the size of the
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after
1392 GenerateTailCall(masm(), stub.GetCode(isolate())); 1391 GenerateTailCall(masm(), stub.GetCode(isolate()));
1393 } else { 1392 } else {
1394 KeyedLoadFieldStub stub(field.is_inobject(holder), 1393 KeyedLoadFieldStub stub(field.is_inobject(holder),
1395 field.translate(holder), 1394 field.translate(holder),
1396 representation); 1395 representation);
1397 GenerateTailCall(masm(), stub.GetCode(isolate())); 1396 GenerateTailCall(masm(), stub.GetCode(isolate()));
1398 } 1397 }
1399 } 1398 }
1400 1399
1401 1400
1402 void BaseLoadStubCompiler::GenerateLoadConstant(Handle<JSFunction> value) { 1401 void BaseLoadStubCompiler::GenerateLoadConstant(Handle<Object> value) {
1403 // Return the constant value. 1402 // Return the constant value.
1404 __ LoadHeapObject(r0, value); 1403 __ LoadObject(r0, value);
1405 __ Ret(); 1404 __ Ret();
1406 } 1405 }
1407 1406
1408 1407
1409 void BaseLoadStubCompiler::GenerateLoadCallback( 1408 void BaseLoadStubCompiler::GenerateLoadCallback(
1410 Register reg, 1409 Register reg,
1411 Handle<ExecutableAccessorInfo> callback) { 1410 Handle<ExecutableAccessorInfo> callback) {
1412 // Build AccessorInfo::args_ list on the stack and push property name below 1411 // Build AccessorInfo::args_ list on the stack and push property name below
1413 // the exit frame to make GC aware of them and store pointers to them. 1412 // the exit frame to make GC aware of them and store pointers to them.
1414 __ push(receiver()); 1413 __ push(receiver());
(...skipping 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after
2663 Handle<Code> CallStubCompiler::CompileCallConstant( 2662 Handle<Code> CallStubCompiler::CompileCallConstant(
2664 Handle<Object> object, 2663 Handle<Object> object,
2665 Handle<JSObject> holder, 2664 Handle<JSObject> holder,
2666 Handle<Name> name, 2665 Handle<Name> name,
2667 CheckType check, 2666 CheckType check,
2668 Handle<JSFunction> function) { 2667 Handle<JSFunction> function) {
2669 if (HasCustomCallGenerator(function)) { 2668 if (HasCustomCallGenerator(function)) {
2670 Handle<Code> code = CompileCustomCall(object, holder, 2669 Handle<Code> code = CompileCustomCall(object, holder,
2671 Handle<Cell>::null(), 2670 Handle<Cell>::null(),
2672 function, Handle<String>::cast(name), 2671 function, Handle<String>::cast(name),
2673 Code::CONSTANT_FUNCTION); 2672 Code::CONSTANT);
2674 // A null handle means bail out to the regular compiler code below. 2673 // A null handle means bail out to the regular compiler code below.
2675 if (!code.is_null()) return code; 2674 if (!code.is_null()) return code;
2676 } 2675 }
2677 2676
2678 Label success; 2677 Label success;
2679 2678
2680 CompileHandlerFrontend(object, holder, name, check, &success); 2679 CompileHandlerFrontend(object, holder, name, check, &success);
2681 __ bind(&success); 2680 __ bind(&success);
2682 CompileHandlerBackend(function); 2681 CompileHandlerBackend(function);
2683 2682
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after
3692 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow); 3691 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow);
3693 } 3692 }
3694 } 3693 }
3695 3694
3696 3695
3697 #undef __ 3696 #undef __
3698 3697
3699 } } // namespace v8::internal 3698 } } // namespace v8::internal
3700 3699
3701 #endif // V8_TARGET_ARCH_ARM 3700 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698