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

Side by Side Diff: src/compiler.cc

Issue 701093003: Correctly compute line numbers in functions from the function constructor. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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
« no previous file with comments | « no previous file | src/runtime/runtime.h » ('j') | src/v8natives.js » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/compiler.h" 7 #include "src/compiler.h"
8 8
9 #include "src/ast-numbering.h" 9 #include "src/ast-numbering.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1145 // Explicitly disable optimization for eval code. We're not yet prepared 1145 // Explicitly disable optimization for eval code. We're not yet prepared
1146 // to handle eval-code in the optimizing compiler. 1146 // to handle eval-code in the optimizing compiler.
1147 shared_info->DisableOptimization(kEval); 1147 shared_info->DisableOptimization(kEval);
1148 1148
1149 // If caller is strict mode, the result must be in strict mode as well. 1149 // If caller is strict mode, the result must be in strict mode as well.
1150 DCHECK(strict_mode == SLOPPY || shared_info->strict_mode() == STRICT); 1150 DCHECK(strict_mode == SLOPPY || shared_info->strict_mode() == STRICT);
1151 if (!shared_info->dont_cache()) { 1151 if (!shared_info->dont_cache()) {
1152 compilation_cache->PutEval(source, outer_info, context, shared_info, 1152 compilation_cache->PutEval(source, outer_info, context, shared_info,
1153 scope_position); 1153 scope_position);
1154 } 1154 }
1155 if (restriction == ONLY_SINGLE_FUNCTION_LITERAL) {
1156 // Function constructor.
1157 shared_info->set_name_should_print_as_anonymous(true);
1158 // The actual body is wrapped, which adds a line.
1159 script->set_line_offset(Smi::FromInt(-1));
1160 }
1155 } 1161 }
1156 } else if (shared_info->ic_age() != isolate->heap()->global_ic_age()) { 1162 } else if (shared_info->ic_age() != isolate->heap()->global_ic_age()) {
1157 shared_info->ResetForNewContext(isolate->heap()->global_ic_age()); 1163 shared_info->ResetForNewContext(isolate->heap()->global_ic_age());
1158 } 1164 }
1159 1165
1160 return isolate->factory()->NewFunctionFromSharedFunctionInfo( 1166 return isolate->factory()->NewFunctionFromSharedFunctionInfo(
1161 shared_info, context, NOT_TENURED); 1167 shared_info, context, NOT_TENURED);
1162 } 1168 }
1163 1169
1164 1170
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
1473 AllowHandleDereference allow_deref; 1479 AllowHandleDereference allow_deref;
1474 bool tracing_on = info()->IsStub() 1480 bool tracing_on = info()->IsStub()
1475 ? FLAG_trace_hydrogen_stubs 1481 ? FLAG_trace_hydrogen_stubs
1476 : (FLAG_trace_hydrogen && 1482 : (FLAG_trace_hydrogen &&
1477 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); 1483 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter));
1478 return (tracing_on && 1484 return (tracing_on &&
1479 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); 1485 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL);
1480 } 1486 }
1481 1487
1482 } } // namespace v8::internal 1488 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/runtime/runtime.h » ('j') | src/v8natives.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698