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

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

Issue 160160: X64: Add inline cache stub for storing to globals. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 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 | « no previous file | test/mjsunit/mjsunit.status » ('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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 464
465 Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* a, String* b) { 465 Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* a, String* b) {
466 // TODO(X64): Implement a real stub. 466 // TODO(X64): Implement a real stub.
467 return Failure::InternalError(); 467 return Failure::InternalError();
468 } 468 }
469 469
470 470
471 Object* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object, 471 Object* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object,
472 JSGlobalPropertyCell* cell, 472 JSGlobalPropertyCell* cell,
473 String* name) { 473 String* name) {
474 // TODO(X64): Implement a real stub. 474 // ----------- S t a t e -------------
475 return Failure::InternalError(); 475 // -- rax : value
476 // -- rcx : name
477 // -- rsp[0] : return address
478 // -- rsp[8] : receiver
479 // -----------------------------------
480 Label miss;
481
482 // Check that the map of the global has not changed.
483 __ movq(rbx, Operand(rsp, kPointerSize));
484 __ Cmp(FieldOperand(rbx, HeapObject::kMapOffset),
485 Handle<Map>(object->map()));
486 __ j(not_equal, &miss);
487
488 // Store the value in the cell.
489 __ Move(rcx, Handle<JSGlobalPropertyCell>(cell));
490 __ movq(FieldOperand(rcx, JSGlobalPropertyCell::kValueOffset), rax);
491
492 __ IncrementCounter(&Counters::named_store_global_inline, 1);
493 // Return the value (register rax).
494 __ ret(0);
495
496 // Handle store cache miss.
497 __ bind(&miss);
498 __ IncrementCounter(&Counters::named_store_global_inline_miss, 1);
499 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss));
500 __ Jump(ic, RelocInfo::CODE_TARGET);
501
502 // Return the generated code.
503 return GetCode(NORMAL, name);
476 } 504 }
477 505
478 506
479 Object* KeyedLoadStubCompiler::CompileLoadField(String* name, 507 Object* KeyedLoadStubCompiler::CompileLoadField(String* name,
480 JSObject* receiver, 508 JSObject* receiver,
481 JSObject* holder, 509 JSObject* holder,
482 int index) { 510 int index) {
483 // ----------- S t a t e ------------- 511 // ----------- S t a t e -------------
484 // -- rsp[0] : return address 512 // -- rsp[0] : return address
485 // -- rsp[8] : name 513 // -- rsp[8] : name
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 856
829 // Return the value (register rax). 857 // Return the value (register rax).
830 __ ret(0); 858 __ ret(0);
831 } 859 }
832 860
833 861
834 #undef __ 862 #undef __
835 863
836 864
837 } } // namespace v8::internal 865 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698