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

Side by Side Diff: src/hydrogen.cc

Issue 1007783002: Remove --harmony-scoping flag. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Tests moved Created 5 years, 9 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
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 5300 matching lines...) Expand 10 before | Expand all | Expand 10 after
5311 // load from a global cell for them. 5311 // load from a global cell for them.
5312 Handle<Object> constant_value = 5312 Handle<Object> constant_value =
5313 isolate()->factory()->GlobalConstantFor(variable->name()); 5313 isolate()->factory()->GlobalConstantFor(variable->name());
5314 if (!constant_value.is_null()) { 5314 if (!constant_value.is_null()) {
5315 HConstant* instr = New<HConstant>(constant_value); 5315 HConstant* instr = New<HConstant>(constant_value);
5316 return ast_context()->ReturnInstruction(instr, expr->id()); 5316 return ast_context()->ReturnInstruction(instr, expr->id());
5317 } 5317 }
5318 5318
5319 Handle<GlobalObject> global(current_info()->global_object()); 5319 Handle<GlobalObject> global(current_info()->global_object());
5320 5320
5321 if (FLAG_harmony_scoping) { 5321 // Lookup in script contexts.
5322 {
5322 Handle<ScriptContextTable> script_contexts( 5323 Handle<ScriptContextTable> script_contexts(
5323 global->native_context()->script_context_table()); 5324 global->native_context()->script_context_table());
5324 ScriptContextTable::LookupResult lookup; 5325 ScriptContextTable::LookupResult lookup;
5325 if (ScriptContextTable::Lookup(script_contexts, variable->name(), 5326 if (ScriptContextTable::Lookup(script_contexts, variable->name(),
5326 &lookup)) { 5327 &lookup)) {
5327 Handle<Context> script_context = ScriptContextTable::GetContext( 5328 Handle<Context> script_context = ScriptContextTable::GetContext(
5328 script_contexts, lookup.context_index); 5329 script_contexts, lookup.context_index);
5329 Handle<Object> current_value = 5330 Handle<Object> current_value =
5330 FixedArray::get(script_context, lookup.context_index); 5331 FixedArray::get(script_context, lookup.context_index);
5331 5332
(...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after
6471 6472
6472 // Because not every expression has a position and there is not common 6473 // Because not every expression has a position and there is not common
6473 // superclass of Assignment and CountOperation, we cannot just pass the 6474 // superclass of Assignment and CountOperation, we cannot just pass the
6474 // owning expression instead of position and ast_id separately. 6475 // owning expression instead of position and ast_id separately.
6475 void HOptimizedGraphBuilder::HandleGlobalVariableAssignment( 6476 void HOptimizedGraphBuilder::HandleGlobalVariableAssignment(
6476 Variable* var, 6477 Variable* var,
6477 HValue* value, 6478 HValue* value,
6478 BailoutId ast_id) { 6479 BailoutId ast_id) {
6479 Handle<GlobalObject> global(current_info()->global_object()); 6480 Handle<GlobalObject> global(current_info()->global_object());
6480 6481
6481 if (FLAG_harmony_scoping) { 6482 // Lookup in script contexts.
6483 {
6482 Handle<ScriptContextTable> script_contexts( 6484 Handle<ScriptContextTable> script_contexts(
6483 global->native_context()->script_context_table()); 6485 global->native_context()->script_context_table());
6484 ScriptContextTable::LookupResult lookup; 6486 ScriptContextTable::LookupResult lookup;
6485 if (ScriptContextTable::Lookup(script_contexts, var->name(), &lookup)) { 6487 if (ScriptContextTable::Lookup(script_contexts, var->name(), &lookup)) {
6486 if (lookup.mode == CONST) { 6488 if (lookup.mode == CONST) {
6487 return Bailout(kNonInitializerAssignmentToConst); 6489 return Bailout(kNonInitializerAssignmentToConst);
6488 } 6490 }
6489 Handle<Context> script_context = 6491 Handle<Context> script_context =
6490 ScriptContextTable::GetContext(script_contexts, lookup.context_index); 6492 ScriptContextTable::GetContext(script_contexts, lookup.context_index);
6491 HStoreNamedField* instr = Add<HStoreNamedField>( 6493 HStoreNamedField* instr = Add<HStoreNamedField>(
(...skipping 6886 matching lines...) Expand 10 before | Expand all | Expand 10 after
13378 if (ShouldProduceTraceOutput()) { 13380 if (ShouldProduceTraceOutput()) {
13379 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 13381 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
13380 } 13382 }
13381 13383
13382 #ifdef DEBUG 13384 #ifdef DEBUG
13383 graph_->Verify(false); // No full verify. 13385 graph_->Verify(false); // No full verify.
13384 #endif 13386 #endif
13385 } 13387 }
13386 13388
13387 } } // namespace v8::internal 13389 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698