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

Side by Side Diff: src/compiler.cc

Issue 1083193005: WIP: new.target (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix return from new func Created 5 years, 8 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/builtins.h ('k') | src/deoptimizer.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 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/compiler.h" 5 #include "src/compiler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
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 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after
1371 1371
1372 // Create a shared function info object. 1372 // Create a shared function info object.
1373 Handle<SharedFunctionInfo> result = factory->NewSharedFunctionInfo( 1373 Handle<SharedFunctionInfo> result = factory->NewSharedFunctionInfo(
1374 literal->name(), literal->materialized_literal_count(), literal->kind(), 1374 literal->name(), literal->materialized_literal_count(), literal->kind(),
1375 info.code(), scope_info, info.feedback_vector()); 1375 info.code(), scope_info, info.feedback_vector());
1376 1376
1377 SharedFunctionInfo::InitFromFunctionLiteral(result, literal); 1377 SharedFunctionInfo::InitFromFunctionLiteral(result, literal);
1378 result->set_script(*script); 1378 result->set_script(*script);
1379 result->set_is_toplevel(false); 1379 result->set_is_toplevel(false);
1380 1380
1381 if (literal->scope()->uses_new_target()) {
1382 Handle<Code> stub(isolate->builtins()->JSConstructStubNewTarget());
1383 result->set_construct_stub(*stub);
1384 }
1385
1381 RecordFunctionCompilation(Logger::FUNCTION_TAG, &info, result); 1386 RecordFunctionCompilation(Logger::FUNCTION_TAG, &info, result);
1382 result->set_allows_lazy_compilation(literal->AllowsLazyCompilation()); 1387 result->set_allows_lazy_compilation(literal->AllowsLazyCompilation());
1383 result->set_allows_lazy_compilation_without_context(allow_lazy_without_ctx); 1388 result->set_allows_lazy_compilation_without_context(allow_lazy_without_ctx);
1384 1389
1385 // Set the expected number of properties for instances and return 1390 // Set the expected number of properties for instances and return
1386 // the resulting function. 1391 // the resulting function.
1387 SetExpectedNofPropertiesFromEstimate(result, 1392 SetExpectedNofPropertiesFromEstimate(result,
1388 literal->expected_property_count()); 1393 literal->expected_property_count());
1389 live_edit_tracker.RecordFunctionInfo(result, literal, info.zone()); 1394 live_edit_tracker.RecordFunctionInfo(result, literal, info.zone());
1390 return result; 1395 return result;
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1540 } 1545 }
1541 1546
1542 1547
1543 #if DEBUG 1548 #if DEBUG
1544 void CompilationInfo::PrintAstForTesting() { 1549 void CompilationInfo::PrintAstForTesting() {
1545 PrintF("--- Source from AST ---\n%s\n", 1550 PrintF("--- Source from AST ---\n%s\n",
1546 PrettyPrinter(isolate(), zone()).PrintProgram(function())); 1551 PrettyPrinter(isolate(), zone()).PrintProgram(function()));
1547 } 1552 }
1548 #endif 1553 #endif
1549 } } // namespace v8::internal 1554 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/builtins.h ('k') | src/deoptimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698