OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 18 matching lines...) Expand all Loading... |
29 | 29 |
30 #include "compiler.h" | 30 #include "compiler.h" |
31 | 31 |
32 #include "bootstrapper.h" | 32 #include "bootstrapper.h" |
33 #include "codegen.h" | 33 #include "codegen.h" |
34 #include "compilation-cache.h" | 34 #include "compilation-cache.h" |
35 #include "debug.h" | 35 #include "debug.h" |
36 #include "deoptimizer.h" | 36 #include "deoptimizer.h" |
37 #include "full-codegen.h" | 37 #include "full-codegen.h" |
38 #include "gdb-jit.h" | 38 #include "gdb-jit.h" |
| 39 #include "typing.h" |
39 #include "hydrogen.h" | 40 #include "hydrogen.h" |
40 #include "isolate-inl.h" | 41 #include "isolate-inl.h" |
41 #include "lithium.h" | 42 #include "lithium.h" |
42 #include "liveedit.h" | 43 #include "liveedit.h" |
43 #include "parser.h" | 44 #include "parser.h" |
44 #include "rewriter.h" | 45 #include "rewriter.h" |
45 #include "runtime-profiler.h" | 46 #include "runtime-profiler.h" |
46 #include "scanner-character-streams.h" | 47 #include "scanner-character-streams.h" |
47 #include "scopeinfo.h" | 48 #include "scopeinfo.h" |
48 #include "scopes.h" | 49 #include "scopes.h" |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 // support. | 352 // support. |
352 ASSERT(FLAG_always_opt || code->optimizable()); | 353 ASSERT(FLAG_always_opt || code->optimizable()); |
353 ASSERT(info()->shared_info()->has_deoptimization_support()); | 354 ASSERT(info()->shared_info()->has_deoptimization_support()); |
354 | 355 |
355 if (FLAG_trace_hydrogen) { | 356 if (FLAG_trace_hydrogen) { |
356 Handle<String> name = info()->function()->debug_name(); | 357 Handle<String> name = info()->function()->debug_name(); |
357 PrintF("-----------------------------------------------------------\n"); | 358 PrintF("-----------------------------------------------------------\n"); |
358 PrintF("Compiling method %s using hydrogen\n", *name->ToCString()); | 359 PrintF("Compiling method %s using hydrogen\n", *name->ToCString()); |
359 isolate()->GetHTracer()->TraceCompilation(info()); | 360 isolate()->GetHTracer()->TraceCompilation(info()); |
360 } | 361 } |
361 Handle<Context> native_context( | 362 |
362 info()->closure()->context()->native_context()); | 363 // Type-check the function. |
363 oracle_ = new(info()->zone()) TypeFeedbackOracle( | 364 AstTyper::Type(info()); |
364 code, native_context, isolate(), info()->zone()); | 365 |
365 graph_builder_ = new(info()->zone()) HOptimizedGraphBuilder(info(), oracle_); | 366 graph_builder_ = new(info()->zone()) HOptimizedGraphBuilder(info()); |
366 | 367 |
367 Timer t(this, &time_taken_to_create_graph_); | 368 Timer t(this, &time_taken_to_create_graph_); |
368 graph_ = graph_builder_->CreateGraph(); | 369 graph_ = graph_builder_->CreateGraph(); |
369 | 370 |
370 if (isolate()->has_pending_exception()) { | 371 if (isolate()->has_pending_exception()) { |
371 info()->SetCode(Handle<Code>::null()); | 372 info()->SetCode(Handle<Code>::null()); |
372 return SetLastStatus(FAILED); | 373 return SetLastStatus(FAILED); |
373 } | 374 } |
374 | 375 |
375 // The function being compiled may have bailed out due to an inline | 376 // The function being compiled may have bailed out due to an inline |
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1162 } | 1163 } |
1163 } | 1164 } |
1164 | 1165 |
1165 GDBJIT(AddCode(Handle<String>(shared->DebugName()), | 1166 GDBJIT(AddCode(Handle<String>(shared->DebugName()), |
1166 Handle<Script>(info->script()), | 1167 Handle<Script>(info->script()), |
1167 Handle<Code>(info->code()), | 1168 Handle<Code>(info->code()), |
1168 info)); | 1169 info)); |
1169 } | 1170 } |
1170 | 1171 |
1171 } } // namespace v8::internal | 1172 } } // namespace v8::internal |
OLD | NEW |