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

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

Issue 71783003: Reland and fix "Add support for keyed-call on arrays of fast elements" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Test + fix 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 | Annotate | Revision Log
« no previous file with comments | « src/code-stubs.cc ('k') | src/compiler.h » ('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 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 HObjectAccess::ForBackingStoreOffset(casted_stub()->offset(), rep); 587 HObjectAccess::ForBackingStoreOffset(casted_stub()->offset(), rep);
588 return AddLoadNamedField(GetParameter(0), access); 588 return AddLoadNamedField(GetParameter(0), access);
589 } 589 }
590 590
591 591
592 Handle<Code> KeyedLoadFieldStub::GenerateCode(Isolate* isolate) { 592 Handle<Code> KeyedLoadFieldStub::GenerateCode(Isolate* isolate) {
593 return DoGenerateCode(isolate, this); 593 return DoGenerateCode(isolate, this);
594 } 594 }
595 595
596 596
597 template<>
598 HValue* CodeStubGraphBuilder<KeyedArrayCallStub>::BuildCodeStub() {
599 int argc = casted_stub()->argc() + 1;
600 info()->set_parameter_count(argc);
601
602 HValue* receiver = Add<HParameter>(1);
603
604 // Load the expected initial array map from the context.
605 JSArrayBuilder array_builder(this, casted_stub()->elements_kind());
606 HValue* map = array_builder.EmitMapCode();
607
608 HValue* checked_receiver = Add<HCheckMapValue>(receiver, map);
609
610 HValue* function = BuildUncheckedMonomorphicElementAccess(
611 checked_receiver, GetParameter(0),
612 NULL, true, casted_stub()->elements_kind(),
613 false, NEVER_RETURN_HOLE, STANDARD_STORE);
614 return Add<HCallFunction>(function, argc, TAIL_CALL);
615 }
616
617
618 Handle<Code> KeyedArrayCallStub::GenerateCode(Isolate* isolate) {
619 return DoGenerateCode(isolate, this);
620 }
621
622
597 template <> 623 template <>
598 HValue* CodeStubGraphBuilder<KeyedStoreFastElementStub>::BuildCodeStub() { 624 HValue* CodeStubGraphBuilder<KeyedStoreFastElementStub>::BuildCodeStub() {
599 BuildUncheckedMonomorphicElementAccess( 625 BuildUncheckedMonomorphicElementAccess(
600 GetParameter(0), GetParameter(1), GetParameter(2), 626 GetParameter(0), GetParameter(1), GetParameter(2),
601 casted_stub()->is_js_array(), casted_stub()->elements_kind(), 627 casted_stub()->is_js_array(), casted_stub()->elements_kind(),
602 true, NEVER_RETURN_HOLE, casted_stub()->store_mode()); 628 true, NEVER_RETURN_HOLE, casted_stub()->store_mode());
603 629
604 return GetParameter(2); 630 return GetParameter(2);
605 } 631 }
606 632
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
1271 return js_function; 1297 return js_function;
1272 } 1298 }
1273 1299
1274 1300
1275 Handle<Code> FastNewClosureStub::GenerateCode(Isolate* isolate) { 1301 Handle<Code> FastNewClosureStub::GenerateCode(Isolate* isolate) {
1276 return DoGenerateCode(isolate, this); 1302 return DoGenerateCode(isolate, this);
1277 } 1303 }
1278 1304
1279 1305
1280 } } // namespace v8::internal 1306 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/code-stubs.cc ('k') | src/compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698