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

Side by Side Diff: src/hydrogen.cc

Issue 1259963002: [stubs] Don't pass name to Load/StoreGlobalViaContext stubs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix rebase Created 5 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
« no previous file with comments | « src/full-codegen/x64/full-codegen-x64.cc ('k') | src/hydrogen-instructions.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/hydrogen.h" 5 #include "src/hydrogen.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/v8.h" 9 #include "src/v8.h"
10 10
(...skipping 5551 matching lines...) Expand 10 before | Expand all | Expand 10 after
5562 return ast_context()->ReturnInstruction(instr, expr->id()); 5562 return ast_context()->ReturnInstruction(instr, expr->id());
5563 } 5563 }
5564 } else if (variable->IsGlobalSlot()) { 5564 } else if (variable->IsGlobalSlot()) {
5565 DCHECK(variable->index() > 0); 5565 DCHECK(variable->index() > 0);
5566 DCHECK(variable->IsStaticGlobalObjectProperty()); 5566 DCHECK(variable->IsStaticGlobalObjectProperty());
5567 // Each var occupies two slots in the context: for reads and writes. 5567 // Each var occupies two slots in the context: for reads and writes.
5568 int slot_index = variable->index(); 5568 int slot_index = variable->index();
5569 int depth = scope()->ContextChainLength(variable->scope()); 5569 int depth = scope()->ContextChainLength(variable->scope());
5570 5570
5571 HLoadGlobalViaContext* instr = 5571 HLoadGlobalViaContext* instr =
5572 New<HLoadGlobalViaContext>(variable->name(), depth, slot_index); 5572 New<HLoadGlobalViaContext>(depth, slot_index);
5573 return ast_context()->ReturnInstruction(instr, expr->id()); 5573 return ast_context()->ReturnInstruction(instr, expr->id());
5574 5574
5575 } else { 5575 } else {
5576 HValue* global_object = Add<HLoadNamedField>( 5576 HValue* global_object = Add<HLoadNamedField>(
5577 context(), nullptr, 5577 context(), nullptr,
5578 HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX)); 5578 HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX));
5579 HLoadGlobalGeneric* instr = New<HLoadGlobalGeneric>( 5579 HLoadGlobalGeneric* instr = New<HLoadGlobalGeneric>(
5580 global_object, variable->name(), ast_context()->typeof_mode()); 5580 global_object, variable->name(), ast_context()->typeof_mode());
5581 instr->SetVectorAndSlot(handle(current_feedback_vector(), isolate()), 5581 instr->SetVectorAndSlot(handle(current_feedback_vector(), isolate()),
5582 expr->VariableFeedbackSlot()); 5582 expr->VariableFeedbackSlot());
(...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after
6794 Add<HSimulate>(ast_id, REMOVABLE_SIMULATE); 6794 Add<HSimulate>(ast_id, REMOVABLE_SIMULATE);
6795 } 6795 }
6796 } else if (var->IsGlobalSlot()) { 6796 } else if (var->IsGlobalSlot()) {
6797 DCHECK(var->index() > 0); 6797 DCHECK(var->index() > 0);
6798 DCHECK(var->IsStaticGlobalObjectProperty()); 6798 DCHECK(var->IsStaticGlobalObjectProperty());
6799 // Each var occupies two slots in the context: for reads and writes. 6799 // Each var occupies two slots in the context: for reads and writes.
6800 int slot_index = var->index() + 1; 6800 int slot_index = var->index() + 1;
6801 int depth = scope()->ContextChainLength(var->scope()); 6801 int depth = scope()->ContextChainLength(var->scope());
6802 6802
6803 HStoreGlobalViaContext* instr = Add<HStoreGlobalViaContext>( 6803 HStoreGlobalViaContext* instr = Add<HStoreGlobalViaContext>(
6804 var->name(), value, depth, slot_index, function_language_mode()); 6804 value, depth, slot_index, function_language_mode());
6805 USE(instr); 6805 USE(instr);
6806 DCHECK(instr->HasObservableSideEffects()); 6806 DCHECK(instr->HasObservableSideEffects());
6807 Add<HSimulate>(ast_id, REMOVABLE_SIMULATE); 6807 Add<HSimulate>(ast_id, REMOVABLE_SIMULATE);
6808 6808
6809 } else { 6809 } else {
6810 HValue* global_object = Add<HLoadNamedField>( 6810 HValue* global_object = Add<HLoadNamedField>(
6811 context(), nullptr, 6811 context(), nullptr,
6812 HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX)); 6812 HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX));
6813 HStoreNamedGeneric* instr = 6813 HStoreNamedGeneric* instr =
6814 Add<HStoreNamedGeneric>(global_object, var->name(), value, 6814 Add<HStoreNamedGeneric>(global_object, var->name(), value,
(...skipping 6520 matching lines...) Expand 10 before | Expand all | Expand 10 after
13335 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 13335 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
13336 } 13336 }
13337 13337
13338 #ifdef DEBUG 13338 #ifdef DEBUG
13339 graph_->Verify(false); // No full verify. 13339 graph_->Verify(false); // No full verify.
13340 #endif 13340 #endif
13341 } 13341 }
13342 13342
13343 } // namespace internal 13343 } // namespace internal
13344 } // namespace v8 13344 } // namespace v8
OLDNEW
« no previous file with comments | « src/full-codegen/x64/full-codegen-x64.cc ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698