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

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

Issue 57873004: MIPS: Handle constants in new space by making macro-assembler smarter. (Closed) Base URL: https://github.com/v8/v8.git@gbl
Patch Set: Created 7 years, 1 month 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/macro-assembler-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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 Label exit; 454 Label exit;
455 455
456 int descriptor = transition->LastAdded(); 456 int descriptor = transition->LastAdded();
457 DescriptorArray* descriptors = transition->instance_descriptors(); 457 DescriptorArray* descriptors = transition->instance_descriptors();
458 PropertyDetails details = descriptors->GetDetails(descriptor); 458 PropertyDetails details = descriptors->GetDetails(descriptor);
459 Representation representation = details.representation(); 459 Representation representation = details.representation();
460 ASSERT(!representation.IsNone()); 460 ASSERT(!representation.IsNone());
461 461
462 if (details.type() == CONSTANT) { 462 if (details.type() == CONSTANT) {
463 Handle<Object> constant(descriptors->GetValue(descriptor), masm->isolate()); 463 Handle<Object> constant(descriptors->GetValue(descriptor), masm->isolate());
464 __ LoadObject(scratch1, constant); 464 __ li(scratch1, constant);
465 __ Branch(miss_label, ne, value_reg, Operand(scratch1)); 465 __ Branch(miss_label, ne, value_reg, Operand(scratch1));
466 } else if (FLAG_track_fields && representation.IsSmi()) { 466 } else if (FLAG_track_fields && representation.IsSmi()) {
467 __ JumpIfNotSmi(value_reg, miss_label); 467 __ JumpIfNotSmi(value_reg, miss_label);
468 } else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { 468 } else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) {
469 __ JumpIfSmi(value_reg, miss_label); 469 __ JumpIfSmi(value_reg, miss_label);
470 } else if (FLAG_track_double_fields && representation.IsDouble()) { 470 } else if (FLAG_track_double_fields && representation.IsDouble()) {
471 Label do_store, heap_number; 471 Label do_store, heap_number;
472 __ LoadRoot(scratch3, Heap::kHeapNumberMapRootIndex); 472 __ LoadRoot(scratch3, Heap::kHeapNumberMapRootIndex);
473 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, scratch3, slow); 473 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, scratch3, slow);
474 474
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 // -- sp[28] : last JS argument 830 // -- sp[28] : last JS argument
831 // -- ... 831 // -- ...
832 // -- sp[(argc + 6) * 4] : first JS argument 832 // -- sp[(argc + 6) * 4] : first JS argument
833 // -- sp[(argc + 7) * 4] : receiver 833 // -- sp[(argc + 7) * 4] : receiver
834 // ----------------------------------- 834 // -----------------------------------
835 typedef FunctionCallbackArguments FCA; 835 typedef FunctionCallbackArguments FCA;
836 // Save calling context. 836 // Save calling context.
837 __ sw(cp, MemOperand(sp, FCA::kContextSaveIndex * kPointerSize)); 837 __ sw(cp, MemOperand(sp, FCA::kContextSaveIndex * kPointerSize));
838 // Get the function and setup the context. 838 // Get the function and setup the context.
839 Handle<JSFunction> function = optimization.constant_function(); 839 Handle<JSFunction> function = optimization.constant_function();
840 __ LoadHeapObject(t1, function); 840 __ li(t1, function);
841 __ lw(cp, FieldMemOperand(t1, JSFunction::kContextOffset)); 841 __ lw(cp, FieldMemOperand(t1, JSFunction::kContextOffset));
842 __ sw(t1, MemOperand(sp, FCA::kCalleeIndex * kPointerSize)); 842 __ sw(t1, MemOperand(sp, FCA::kCalleeIndex * kPointerSize));
843 843
844 // Construct the FunctionCallbackInfo. 844 // Construct the FunctionCallbackInfo.
845 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); 845 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info();
846 Handle<Object> call_data(api_call_info->data(), masm->isolate()); 846 Handle<Object> call_data(api_call_info->data(), masm->isolate());
847 if (masm->isolate()->heap()->InNewSpace(*call_data)) { 847 if (masm->isolate()->heap()->InNewSpace(*call_data)) {
848 __ li(a0, api_call_info); 848 __ li(a0, api_call_info);
849 __ lw(t2, FieldMemOperand(a0, CallHandlerInfo::kDataOffset)); 849 __ lw(t2, FieldMemOperand(a0, CallHandlerInfo::kDataOffset));
850 } else { 850 } else {
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
1369 KeyedLoadFieldStub stub(field.is_inobject(holder), 1369 KeyedLoadFieldStub stub(field.is_inobject(holder),
1370 field.translate(holder), 1370 field.translate(holder),
1371 representation); 1371 representation);
1372 GenerateTailCall(masm(), stub.GetCode(isolate())); 1372 GenerateTailCall(masm(), stub.GetCode(isolate()));
1373 } 1373 }
1374 } 1374 }
1375 1375
1376 1376
1377 void LoadStubCompiler::GenerateLoadConstant(Handle<Object> value) { 1377 void LoadStubCompiler::GenerateLoadConstant(Handle<Object> value) {
1378 // Return the constant value. 1378 // Return the constant value.
1379 __ LoadObject(v0, value); 1379 __ li(v0, value);
1380 __ Ret(); 1380 __ Ret();
1381 } 1381 }
1382 1382
1383 1383
1384 void LoadStubCompiler::GenerateLoadCallback( 1384 void LoadStubCompiler::GenerateLoadCallback(
1385 const CallOptimization& call_optimization) { 1385 const CallOptimization& call_optimization) {
1386 GenerateFastApiCall( 1386 GenerateFastApiCall(
1387 masm(), call_optimization, receiver(), scratch3(), 0, NULL); 1387 masm(), call_optimization, receiver(), scratch3(), 0, NULL);
1388 } 1388 }
1389 1389
(...skipping 1784 matching lines...) Expand 10 before | Expand all | Expand 10 after
3174 // ----------------------------------- 3174 // -----------------------------------
3175 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); 3175 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric);
3176 } 3176 }
3177 3177
3178 3178
3179 #undef __ 3179 #undef __
3180 3180
3181 } } // namespace v8::internal 3181 } } // namespace v8::internal
3182 3182
3183 #endif // V8_TARGET_ARCH_MIPS 3183 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/macro-assembler-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698