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

Side by Side Diff: src/compiler.cc

Issue 6694024: Use NativesFlag to allow/disallow natives syntax during compilation. (Closed)
Patch Set: Created 9 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
« no previous file with comments | « src/compiler.h ('k') | src/debug.cc » ('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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 } 522 }
523 523
524 script->set_data(script_data.is_null() ? Heap::undefined_value() 524 script->set_data(script_data.is_null() ? Heap::undefined_value()
525 : *script_data); 525 : *script_data);
526 526
527 // Compile the function and add it to the cache. 527 // Compile the function and add it to the cache.
528 CompilationInfo info(script); 528 CompilationInfo info(script);
529 info.MarkAsGlobal(); 529 info.MarkAsGlobal();
530 info.SetExtension(extension); 530 info.SetExtension(extension);
531 info.SetPreParseData(pre_data); 531 info.SetPreParseData(pre_data);
532 if (natives == NATIVES_CODE) info.MarkAsAllowingNativesSyntax();
532 result = MakeFunctionInfo(&info); 533 result = MakeFunctionInfo(&info);
533 if (extension == NULL && !result.is_null()) { 534 if (extension == NULL && !result.is_null()) {
534 CompilationCache::PutScript(source, result); 535 CompilationCache::PutScript(source, result);
535 } 536 }
536 537
537 // Get rid of the pre-parsing data (if necessary). 538 // Get rid of the pre-parsing data (if necessary).
538 if (input_pre_data == NULL && pre_data != NULL) { 539 if (input_pre_data == NULL && pre_data != NULL) {
539 delete pre_data; 540 delete pre_data;
540 } 541 }
541 } 542 }
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 shared->DebugName())); 799 shared->DebugName()));
799 } 800 }
800 } 801 }
801 802
802 GDBJIT(AddCode(name, 803 GDBJIT(AddCode(name,
803 Handle<Script>(info->script()), 804 Handle<Script>(info->script()),
804 Handle<Code>(info->code()))); 805 Handle<Code>(info->code())));
805 } 806 }
806 807
807 } } // namespace v8::internal 808 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/compiler.h ('k') | src/debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698