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

Side by Side Diff: src/hydrogen.cc

Issue 8344082: Replace boolean indications of strict mode by an enum value. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Some fixes and adapted the preparser. Created 9 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 3258 matching lines...) Expand 10 before | Expand all | Expand 10 after
3269 if (property->emit_store()) { 3269 if (property->emit_store()) {
3270 CHECK_ALIVE(VisitForValue(value)); 3270 CHECK_ALIVE(VisitForValue(value));
3271 HValue* value = Pop(); 3271 HValue* value = Pop();
3272 Handle<String> name = Handle<String>::cast(key->handle()); 3272 Handle<String> name = Handle<String>::cast(key->handle());
3273 HStoreNamedGeneric* store = 3273 HStoreNamedGeneric* store =
3274 new(zone()) HStoreNamedGeneric( 3274 new(zone()) HStoreNamedGeneric(
3275 context, 3275 context,
3276 literal, 3276 literal,
3277 name, 3277 name,
3278 value, 3278 value,
3279 function_strict_mode()); 3279 function_strict_mode_flag());
3280 AddInstruction(store); 3280 AddInstruction(store);
3281 AddSimulate(key->id()); 3281 AddSimulate(key->id());
3282 } else { 3282 } else {
3283 CHECK_ALIVE(VisitForEffect(value)); 3283 CHECK_ALIVE(VisitForEffect(value));
3284 } 3284 }
3285 break; 3285 break;
3286 } 3286 }
3287 // Fall through. 3287 // Fall through.
3288 case ObjectLiteral::Property::PROTOTYPE: 3288 case ObjectLiteral::Property::PROTOTYPE:
3289 case ObjectLiteral::Property::SETTER: 3289 case ObjectLiteral::Property::SETTER:
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
3447 3447
3448 HInstruction* HGraphBuilder::BuildStoreNamedGeneric(HValue* object, 3448 HInstruction* HGraphBuilder::BuildStoreNamedGeneric(HValue* object,
3449 Handle<String> name, 3449 Handle<String> name,
3450 HValue* value) { 3450 HValue* value) {
3451 HValue* context = environment()->LookupContext(); 3451 HValue* context = environment()->LookupContext();
3452 return new(zone()) HStoreNamedGeneric( 3452 return new(zone()) HStoreNamedGeneric(
3453 context, 3453 context,
3454 object, 3454 object,
3455 name, 3455 name,
3456 value, 3456 value,
3457 function_strict_mode()); 3457 function_strict_mode_flag());
3458 } 3458 }
3459 3459
3460 3460
3461 HInstruction* HGraphBuilder::BuildStoreNamed(HValue* object, 3461 HInstruction* HGraphBuilder::BuildStoreNamed(HValue* object,
3462 HValue* value, 3462 HValue* value,
3463 Expression* expr) { 3463 Expression* expr) {
3464 Property* prop = (expr->AsProperty() != NULL) 3464 Property* prop = (expr->AsProperty() != NULL)
3465 ? expr->AsProperty() 3465 ? expr->AsProperty()
3466 : expr->AsAssignment()->target()->AsProperty(); 3466 : expr->AsAssignment()->target()->AsProperty();
3467 Literal* key = prop->key()->AsLiteral(); 3467 Literal* key = prop->key()->AsLiteral();
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
3632 if (instr->HasSideEffects()) AddSimulate(ast_id); 3632 if (instr->HasSideEffects()) AddSimulate(ast_id);
3633 } else { 3633 } else {
3634 HValue* context = environment()->LookupContext(); 3634 HValue* context = environment()->LookupContext();
3635 HGlobalObject* global_object = new(zone()) HGlobalObject(context); 3635 HGlobalObject* global_object = new(zone()) HGlobalObject(context);
3636 AddInstruction(global_object); 3636 AddInstruction(global_object);
3637 HStoreGlobalGeneric* instr = 3637 HStoreGlobalGeneric* instr =
3638 new(zone()) HStoreGlobalGeneric(context, 3638 new(zone()) HStoreGlobalGeneric(context,
3639 global_object, 3639 global_object,
3640 var->name(), 3640 var->name(),
3641 value, 3641 value,
3642 function_strict_mode()); 3642 function_strict_mode_flag());
3643 instr->set_position(position); 3643 instr->set_position(position);
3644 AddInstruction(instr); 3644 AddInstruction(instr);
3645 ASSERT(instr->HasSideEffects()); 3645 ASSERT(instr->HasSideEffects());
3646 if (instr->HasSideEffects()) AddSimulate(ast_id); 3646 if (instr->HasSideEffects()) AddSimulate(ast_id);
3647 } 3647 }
3648 } 3648 }
3649 3649
3650 3650
3651 void HGraphBuilder::HandleCompoundAssignment(Assignment* expr) { 3651 void HGraphBuilder::HandleCompoundAssignment(Assignment* expr) {
3652 Expression* target = expr->target(); 3652 Expression* target = expr->target();
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
4297 4297
4298 HInstruction* HGraphBuilder::BuildStoreKeyedGeneric(HValue* object, 4298 HInstruction* HGraphBuilder::BuildStoreKeyedGeneric(HValue* object,
4299 HValue* key, 4299 HValue* key,
4300 HValue* value) { 4300 HValue* value) {
4301 HValue* context = environment()->LookupContext(); 4301 HValue* context = environment()->LookupContext();
4302 return new(zone()) HStoreKeyedGeneric( 4302 return new(zone()) HStoreKeyedGeneric(
4303 context, 4303 context,
4304 object, 4304 object,
4305 key, 4305 key,
4306 value, 4306 value,
4307 function_strict_mode()); 4307 function_strict_mode_flag());
4308 } 4308 }
4309 4309
4310 bool HGraphBuilder::TryArgumentsAccess(Property* expr) { 4310 bool HGraphBuilder::TryArgumentsAccess(Property* expr) {
4311 VariableProxy* proxy = expr->obj()->AsVariableProxy(); 4311 VariableProxy* proxy = expr->obj()->AsVariableProxy();
4312 if (proxy == NULL) return false; 4312 if (proxy == NULL) return false;
4313 if (!proxy->var()->IsStackAllocated()) return false; 4313 if (!proxy->var()->IsStackAllocated()) return false;
4314 if (!environment()->Lookup(proxy->var())->CheckFlag(HValue::kIsArguments)) { 4314 if (!environment()->Lookup(proxy->var())->CheckFlag(HValue::kIsArguments)) {
4315 return false; 4315 return false;
4316 } 4316 }
4317 4317
(...skipping 2695 matching lines...) Expand 10 before | Expand all | Expand 10 after
7013 } 7013 }
7014 } 7014 }
7015 7015
7016 #ifdef DEBUG 7016 #ifdef DEBUG
7017 if (graph_ != NULL) graph_->Verify(false); // No full verify. 7017 if (graph_ != NULL) graph_->Verify(false); // No full verify.
7018 if (allocator_ != NULL) allocator_->Verify(); 7018 if (allocator_ != NULL) allocator_->Verify();
7019 #endif 7019 #endif
7020 } 7020 }
7021 7021
7022 } } // namespace v8::internal 7022 } } // namespace v8::internal
OLDNEW
« src/compiler.cc ('K') | « src/hydrogen.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698