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

Side by Side Diff: src/x64/stub-cache-x64.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, 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 | Annotate | Revision Log
« no previous file with comments | « src/x64/lithium-codegen-x64.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 776 matching lines...) Expand 10 before | Expand all | Expand 10 after
787 Register scratch2, 787 Register scratch2,
788 Register unused, 788 Register unused,
789 Label* miss_label, 789 Label* miss_label,
790 Label* slow) { 790 Label* slow) {
791 int descriptor = transition->LastAdded(); 791 int descriptor = transition->LastAdded();
792 DescriptorArray* descriptors = transition->instance_descriptors(); 792 DescriptorArray* descriptors = transition->instance_descriptors();
793 PropertyDetails details = descriptors->GetDetails(descriptor); 793 PropertyDetails details = descriptors->GetDetails(descriptor);
794 Representation representation = details.representation(); 794 Representation representation = details.representation();
795 ASSERT(!representation.IsNone()); 795 ASSERT(!representation.IsNone());
796 796
797 if (details.type() == CONSTANT_FUNCTION) { 797 if (details.type() == CONSTANT) {
798 Handle<HeapObject> constant( 798 Handle<Object> constant(descriptors->GetValue(descriptor), masm->isolate());
799 HeapObject::cast(descriptors->GetValue(descriptor))); 799 __ CmpObject(value_reg, constant);
800 __ LoadHeapObject(scratch1, constant);
801 __ cmpq(value_reg, scratch1);
802 __ j(not_equal, miss_label); 800 __ j(not_equal, miss_label);
803 } else if (FLAG_track_fields && representation.IsSmi()) { 801 } else if (FLAG_track_fields && representation.IsSmi()) {
804 __ JumpIfNotSmi(value_reg, miss_label); 802 __ JumpIfNotSmi(value_reg, miss_label);
805 } else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { 803 } else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) {
806 __ JumpIfSmi(value_reg, miss_label); 804 __ JumpIfSmi(value_reg, miss_label);
807 } else if (FLAG_track_double_fields && representation.IsDouble()) { 805 } else if (FLAG_track_double_fields && representation.IsDouble()) {
808 Label do_store, heap_number; 806 Label do_store, heap_number;
809 __ AllocateHeapNumber(storage_reg, scratch1, slow); 807 __ AllocateHeapNumber(storage_reg, scratch1, slow);
810 808
811 __ JumpIfNotSmi(value_reg, &heap_number); 809 __ JumpIfNotSmi(value_reg, &heap_number);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 848
851 // Update the write barrier for the map field. 849 // Update the write barrier for the map field.
852 __ RecordWriteField(receiver_reg, 850 __ RecordWriteField(receiver_reg,
853 HeapObject::kMapOffset, 851 HeapObject::kMapOffset,
854 scratch1, 852 scratch1,
855 scratch2, 853 scratch2,
856 kDontSaveFPRegs, 854 kDontSaveFPRegs,
857 OMIT_REMEMBERED_SET, 855 OMIT_REMEMBERED_SET,
858 OMIT_SMI_CHECK); 856 OMIT_SMI_CHECK);
859 857
860 if (details.type() == CONSTANT_FUNCTION) { 858 if (details.type() == CONSTANT) {
861 ASSERT(value_reg.is(rax)); 859 ASSERT(value_reg.is(rax));
862 __ ret(0); 860 __ ret(0);
863 return; 861 return;
864 } 862 }
865 863
866 int index = transition->instance_descriptors()->GetFieldIndex( 864 int index = transition->instance_descriptors()->GetFieldIndex(
867 transition->LastAdded()); 865 transition->LastAdded());
868 866
869 // Adjust for the number of properties stored in the object. Even in the 867 // Adjust for the number of properties stored in the object. Even in the
870 // face of a transition we can use the old map here because the size of the 868 // face of a transition we can use the old map here because the size of the
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
1350 1348
1351 __ CallApiFunctionAndReturn(getter_address, 1349 __ CallApiFunctionAndReturn(getter_address,
1352 thunk_address, 1350 thunk_address,
1353 getter_arg, 1351 getter_arg,
1354 kStackSpace, 1352 kStackSpace,
1355 returns_handle, 1353 returns_handle,
1356 5); 1354 5);
1357 } 1355 }
1358 1356
1359 1357
1360 void BaseLoadStubCompiler::GenerateLoadConstant(Handle<JSFunction> value) { 1358 void BaseLoadStubCompiler::GenerateLoadConstant(Handle<Object> value) {
1361 // Return the constant value. 1359 // Return the constant value.
1362 __ LoadHeapObject(rax, value); 1360 __ LoadObject(rax, value);
1363 __ ret(0); 1361 __ ret(0);
1364 } 1362 }
1365 1363
1366 1364
1367 void BaseLoadStubCompiler::GenerateLoadInterceptor( 1365 void BaseLoadStubCompiler::GenerateLoadInterceptor(
1368 Register holder_reg, 1366 Register holder_reg,
1369 Handle<JSObject> object, 1367 Handle<JSObject> object,
1370 Handle<JSObject> interceptor_holder, 1368 Handle<JSObject> interceptor_holder,
1371 LookupResult* lookup, 1369 LookupResult* lookup,
1372 Handle<Name> name) { 1370 Handle<Name> name) {
(...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after
2493 Handle<Code> CallStubCompiler::CompileCallConstant( 2491 Handle<Code> CallStubCompiler::CompileCallConstant(
2494 Handle<Object> object, 2492 Handle<Object> object,
2495 Handle<JSObject> holder, 2493 Handle<JSObject> holder,
2496 Handle<Name> name, 2494 Handle<Name> name,
2497 CheckType check, 2495 CheckType check,
2498 Handle<JSFunction> function) { 2496 Handle<JSFunction> function) {
2499 if (HasCustomCallGenerator(function)) { 2497 if (HasCustomCallGenerator(function)) {
2500 Handle<Code> code = CompileCustomCall(object, holder, 2498 Handle<Code> code = CompileCustomCall(object, holder,
2501 Handle<PropertyCell>::null(), 2499 Handle<PropertyCell>::null(),
2502 function, Handle<String>::cast(name), 2500 function, Handle<String>::cast(name),
2503 Code::CONSTANT_FUNCTION); 2501 Code::CONSTANT);
2504 // A null handle means bail out to the regular compiler code below. 2502 // A null handle means bail out to the regular compiler code below.
2505 if (!code.is_null()) return code; 2503 if (!code.is_null()) return code;
2506 } 2504 }
2507 2505
2508 Label success; 2506 Label success;
2509 2507
2510 CompileHandlerFrontend(object, holder, name, check, &success); 2508 CompileHandlerFrontend(object, holder, name, check, &success);
2511 __ bind(&success); 2509 __ bind(&success);
2512 CompileHandlerBackend(function); 2510 CompileHandlerBackend(function);
2513 2511
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after
3514 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow); 3512 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow);
3515 } 3513 }
3516 } 3514 }
3517 3515
3518 3516
3519 #undef __ 3517 #undef __
3520 3518
3521 } } // namespace v8::internal 3519 } } // namespace v8::internal
3522 3520
3523 #endif // V8_TARGET_ARCH_X64 3521 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698