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

Side by Side Diff: src/code-stubs-hydrogen.cc

Issue 23537067: Add support for keyed-call on arrays of fast elements (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 years, 2 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
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 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 HObjectAccess::ForBackingStoreOffset(casted_stub()->offset(), rep); 566 HObjectAccess::ForBackingStoreOffset(casted_stub()->offset(), rep);
567 return AddInstruction(BuildLoadNamedField(GetParameter(0), access)); 567 return AddInstruction(BuildLoadNamedField(GetParameter(0), access));
568 } 568 }
569 569
570 570
571 Handle<Code> KeyedLoadFieldStub::GenerateCode(Isolate* isolate) { 571 Handle<Code> KeyedLoadFieldStub::GenerateCode(Isolate* isolate) {
572 return DoGenerateCode(isolate, this); 572 return DoGenerateCode(isolate, this);
573 } 573 }
574 574
575 575
576 template<>
577 HValue* CodeStubGraphBuilder<KeyedArrayCallStub>::BuildCodeStub() {
578 int argc = casted_stub()->argc() + 1;
579 info()->set_parameter_count(argc);
580
581 HValue* receiver = Add<HParameter>(1);
582
583 // Load the expected initial array map from the context.
584 JSArrayBuilder array_builder(this, casted_stub()->elements_kind());
585 HValue* map = array_builder.EmitMapCode();
586
587 HValue* checked_receiver = Add<HCheckMapValue>(receiver, map);
588
589 HValue* function = BuildUncheckedMonomorphicElementAccess(
590 checked_receiver, GetParameter(0),
591 NULL, true, casted_stub()->elements_kind(),
592 false, NEVER_RETURN_HOLE, STANDARD_STORE);
593 return Add<HCallFunction>(function, argc, TAIL_CALL);
594 }
595
596
597 Handle<Code> KeyedArrayCallStub::GenerateCode(Isolate* isolate) {
598 return DoGenerateCode(isolate, this);
599 }
600
601
576 template <> 602 template <>
577 HValue* CodeStubGraphBuilder<KeyedStoreFastElementStub>::BuildCodeStub() { 603 HValue* CodeStubGraphBuilder<KeyedStoreFastElementStub>::BuildCodeStub() {
578 BuildUncheckedMonomorphicElementAccess( 604 BuildUncheckedMonomorphicElementAccess(
579 GetParameter(0), GetParameter(1), GetParameter(2), 605 GetParameter(0), GetParameter(1), GetParameter(2),
580 casted_stub()->is_js_array(), casted_stub()->elements_kind(), 606 casted_stub()->is_js_array(), casted_stub()->elements_kind(),
581 true, NEVER_RETURN_HOLE, casted_stub()->store_mode()); 607 true, NEVER_RETURN_HOLE, casted_stub()->store_mode());
582 608
583 return GetParameter(2); 609 return GetParameter(2);
584 } 610 }
585 611
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
1127 return js_function; 1153 return js_function;
1128 } 1154 }
1129 1155
1130 1156
1131 Handle<Code> FastNewClosureStub::GenerateCode(Isolate* isolate) { 1157 Handle<Code> FastNewClosureStub::GenerateCode(Isolate* isolate) {
1132 return DoGenerateCode(isolate, this); 1158 return DoGenerateCode(isolate, this);
1133 } 1159 }
1134 1160
1135 1161
1136 } } // namespace v8::internal 1162 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/code-stubs.cc ('k') | src/compiler.h » ('j') | src/ia32/lithium-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698