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 "codegen.h" | 30 #include "codegen.h" |
31 #include "compiler.h" | 31 #include "compiler.h" |
32 #include "debug.h" | 32 #include "debug.h" |
33 #include "full-codegen.h" | 33 #include "full-codegen.h" |
34 #include "liveedit.h" | 34 #include "liveedit.h" |
35 #include "macro-assembler.h" | 35 #include "macro-assembler.h" |
36 #include "prettyprinter.h" | 36 #include "prettyprinter.h" |
37 #include "scopes.h" | 37 #include "scopes.h" |
38 #include "scopeinfo.h" | 38 #include "scopeinfo.h" |
| 39 #include "snapshot.h" |
39 #include "stub-cache.h" | 40 #include "stub-cache.h" |
40 | 41 |
41 namespace v8 { | 42 namespace v8 { |
42 namespace internal { | 43 namespace internal { |
43 | 44 |
44 void BreakableStatementChecker::Check(Statement* stmt) { | 45 void BreakableStatementChecker::Check(Statement* stmt) { |
45 Visit(stmt); | 46 Visit(stmt); |
46 } | 47 } |
47 | 48 |
48 | 49 |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 | 376 |
376 | 377 |
377 void FullCodeGenerator::PopulateTypeFeedbackInfo(Handle<Code> code) { | 378 void FullCodeGenerator::PopulateTypeFeedbackInfo(Handle<Code> code) { |
378 Handle<TypeFeedbackInfo> info = isolate()->factory()->NewTypeFeedbackInfo(); | 379 Handle<TypeFeedbackInfo> info = isolate()->factory()->NewTypeFeedbackInfo(); |
379 info->set_ic_total_count(ic_total_count_); | 380 info->set_ic_total_count(ic_total_count_); |
380 ASSERT(!isolate()->heap()->InNewSpace(*info)); | 381 ASSERT(!isolate()->heap()->InNewSpace(*info)); |
381 code->set_type_feedback_info(*info); | 382 code->set_type_feedback_info(*info); |
382 } | 383 } |
383 | 384 |
384 | 385 |
| 386 void FullCodeGenerator::Initialize() { |
| 387 // The generation of debug code must match between the snapshot code and the |
| 388 // code that is generated later. This is assumed by the debugger when it is |
| 389 // calculating PC offsets after generating a debug version of code. Therefore |
| 390 // we disable the production of debug code in the full compiler if we are |
| 391 // either generating a snapshot or we booted from a snapshot. |
| 392 generate_debug_code_ = FLAG_debug_code && |
| 393 !Serializer::enabled() && |
| 394 !Snapshot::HaveASnapshotToStartFrom(); |
| 395 masm_->set_emit_debug_code(generate_debug_code_); |
| 396 masm_->set_predictable_code_size(true); |
| 397 } |
| 398 |
| 399 |
385 void FullCodeGenerator::PopulateTypeFeedbackCells(Handle<Code> code) { | 400 void FullCodeGenerator::PopulateTypeFeedbackCells(Handle<Code> code) { |
386 if (type_feedback_cells_.is_empty()) return; | 401 if (type_feedback_cells_.is_empty()) return; |
387 int length = type_feedback_cells_.length(); | 402 int length = type_feedback_cells_.length(); |
388 int array_size = TypeFeedbackCells::LengthOfFixedArray(length); | 403 int array_size = TypeFeedbackCells::LengthOfFixedArray(length); |
389 Handle<TypeFeedbackCells> cache = Handle<TypeFeedbackCells>::cast( | 404 Handle<TypeFeedbackCells> cache = Handle<TypeFeedbackCells>::cast( |
390 isolate()->factory()->NewFixedArray(array_size, TENURED)); | 405 isolate()->factory()->NewFixedArray(array_size, TENURED)); |
391 for (int i = 0; i < length; i++) { | 406 for (int i = 0; i < length; i++) { |
392 cache->SetAstId(i, Smi::FromInt(type_feedback_cells_[i].ast_id)); | 407 cache->SetAstId(i, Smi::FromInt(type_feedback_cells_[i].ast_id)); |
393 cache->SetCell(i, *type_feedback_cells_[i].cell); | 408 cache->SetCell(i, *type_feedback_cells_[i].cell); |
394 } | 409 } |
(...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1406 } | 1421 } |
1407 | 1422 |
1408 return false; | 1423 return false; |
1409 } | 1424 } |
1410 | 1425 |
1411 | 1426 |
1412 #undef __ | 1427 #undef __ |
1413 | 1428 |
1414 | 1429 |
1415 } } // namespace v8::internal | 1430 } } // namespace v8::internal |
OLD | NEW |