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

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

Issue 712973002: harmony-scoping: Implement StoreIC handler for stores to global contexts. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 6 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/bailout-reason.h" 7 #include "src/bailout-reason.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/field-index.h" 9 #include "src/field-index.h"
10 #include "src/hydrogen.h" 10 #include "src/hydrogen.h"
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 HObjectAccess::ForContextSlot(slot_index)); 529 HObjectAccess::ForContextSlot(slot_index));
530 } 530 }
531 531
532 532
533 Handle<Code> LoadGlobalContextFieldStub::GenerateCode() { 533 Handle<Code> LoadGlobalContextFieldStub::GenerateCode() {
534 return DoGenerateCode(this); 534 return DoGenerateCode(this);
535 } 535 }
536 536
537 537
538 template <> 538 template <>
539 HValue* CodeStubGraphBuilder<StoreGlobalContextFieldStub>::BuildCodeStub() {
540 int context_index = casted_stub()->context_index();
541 int slot_index = casted_stub()->slot_index();
542
543 HValue* native_context = BuildGetNativeContext();
544 HValue* global_context_table = Add<HLoadNamedField>(
545 native_context, static_cast<HValue*>(NULL),
546 HObjectAccess::ForContextSlot(Context::GLOBAL_CONTEXT_TABLE_INDEX));
547 HValue* global_context =
548 Add<HLoadNamedField>(global_context_table, static_cast<HValue*>(NULL),
549 HObjectAccess::ForGlobalContext(context_index));
Igor Sheludko 2014/11/11 14:17:06 I think it is worth adding BuildGetGlobalContext()
Dmitry Lomov (no reviews) 2014/11/11 15:15:25 Done.
550 Add<HStoreNamedField>(global_context,
551 HObjectAccess::ForContextSlot(slot_index),
552 GetParameter(2), STORE_TO_INITIALIZED_ENTRY);
553 return GetParameter(2);
554 }
555
556
557 Handle<Code> StoreGlobalContextFieldStub::GenerateCode() {
558 return DoGenerateCode(this);
559 }
560
561
562 template <>
539 HValue* CodeStubGraphBuilder<LoadFastElementStub>::BuildCodeStub() { 563 HValue* CodeStubGraphBuilder<LoadFastElementStub>::BuildCodeStub() {
540 HInstruction* load = BuildUncheckedMonomorphicElementAccess( 564 HInstruction* load = BuildUncheckedMonomorphicElementAccess(
541 GetParameter(LoadDescriptor::kReceiverIndex), 565 GetParameter(LoadDescriptor::kReceiverIndex),
542 GetParameter(LoadDescriptor::kNameIndex), NULL, 566 GetParameter(LoadDescriptor::kNameIndex), NULL,
543 casted_stub()->is_js_array(), casted_stub()->elements_kind(), LOAD, 567 casted_stub()->is_js_array(), casted_stub()->elements_kind(), LOAD,
544 NEVER_RETURN_HOLE, STANDARD_STORE); 568 NEVER_RETURN_HOLE, STANDARD_STORE);
545 return load; 569 return load;
546 } 570 }
547 571
548 572
(...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after
2029 2053
2030 // Probe the stub cache. 2054 // Probe the stub cache.
2031 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( 2055 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags(
2032 Code::ComputeHandlerFlags(Code::LOAD_IC)); 2056 Code::ComputeHandlerFlags(Code::LOAD_IC));
2033 Add<HTailCallThroughMegamorphicCache>(receiver, name, flags); 2057 Add<HTailCallThroughMegamorphicCache>(receiver, name, flags);
2034 2058
2035 // We never continue. 2059 // We never continue.
2036 return graph()->GetConstant0(); 2060 return graph()->GetConstant0();
2037 } 2061 }
2038 } } // namespace v8::internal 2062 } } // namespace v8::internal
OLDNEW
« src/code-stubs.h ('K') | « src/code-stubs.h ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698