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

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

Issue 696783005: harmony-scoping: Implement LoadIC handler for loads from global contexts. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Finished/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 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 return feedback_vector; 507 return feedback_vector;
508 } 508 }
509 509
510 510
511 Handle<Code> CreateAllocationSiteStub::GenerateCode() { 511 Handle<Code> CreateAllocationSiteStub::GenerateCode() {
512 return DoGenerateCode(this); 512 return DoGenerateCode(this);
513 } 513 }
514 514
515 515
516 template <> 516 template <>
517 HValue* CodeStubGraphBuilder<LoadGlobalContextFieldStub>::BuildCodeStub() {
518 int context_index = casted_stub()->context_index();
519 int slot_index = casted_stub()->slot_index();
520
521 HValue* native_context = BuildGetNativeContext();
522 HValue* global_context_table = Add<HLoadNamedField>(
523 native_context, static_cast<HValue*>(NULL),
524 HObjectAccess::ForContextSlot(Context::GLOBAL_CONTEXT_TABLE_INDEX));
525 HValue* global_context =
526 Add<HLoadNamedField>(global_context_table, static_cast<HValue*>(NULL),
527 HObjectAccess::ForGlobalContext(context_index));
528 return Add<HLoadNamedField>(global_context, static_cast<HValue*>(NULL),
529 HObjectAccess::ForContextSlot(slot_index));
530 }
531
532
533 Handle<Code> LoadGlobalContextFieldStub::GenerateCode() {
534 return DoGenerateCode(this);
535 }
536
537
538 template <>
517 HValue* CodeStubGraphBuilder<LoadFastElementStub>::BuildCodeStub() { 539 HValue* CodeStubGraphBuilder<LoadFastElementStub>::BuildCodeStub() {
518 HInstruction* load = BuildUncheckedMonomorphicElementAccess( 540 HInstruction* load = BuildUncheckedMonomorphicElementAccess(
519 GetParameter(LoadDescriptor::kReceiverIndex), 541 GetParameter(LoadDescriptor::kReceiverIndex),
520 GetParameter(LoadDescriptor::kNameIndex), NULL, 542 GetParameter(LoadDescriptor::kNameIndex), NULL,
521 casted_stub()->is_js_array(), casted_stub()->elements_kind(), LOAD, 543 casted_stub()->is_js_array(), casted_stub()->elements_kind(), LOAD,
522 NEVER_RETURN_HOLE, STANDARD_STORE); 544 NEVER_RETURN_HOLE, STANDARD_STORE);
523 return load; 545 return load;
524 } 546 }
525 547
526 548
(...skipping 1477 matching lines...) Expand 10 before | Expand all | Expand 10 after
2004 2026
2005 // Probe the stub cache. 2027 // Probe the stub cache.
2006 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( 2028 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags(
2007 Code::ComputeHandlerFlags(Code::LOAD_IC)); 2029 Code::ComputeHandlerFlags(Code::LOAD_IC));
2008 Add<HTailCallThroughMegamorphicCache>(receiver, name, flags); 2030 Add<HTailCallThroughMegamorphicCache>(receiver, name, flags);
2009 2031
2010 // We never continue. 2032 // We never continue.
2011 return graph()->GetConstant0(); 2033 return graph()->GetConstant0();
2012 } 2034 }
2013 } } // namespace v8::internal 2035 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/code-stubs.h ('k') | src/hydrogen.cc » ('j') | src/hydrogen-instructions.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698