OLD | NEW |
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/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 !function()->dont_optimize() && | 284 !function()->dont_optimize() && |
285 function()->scope()->AllowsLazyCompilation() && | 285 function()->scope()->AllowsLazyCompilation() && |
286 (shared_info().is_null() || !shared_info()->optimization_disabled()); | 286 (shared_info().is_null() || !shared_info()->optimization_disabled()); |
287 } | 287 } |
288 | 288 |
289 | 289 |
290 void CompilationInfo::PrepareForCompilation(Scope* scope) { | 290 void CompilationInfo::PrepareForCompilation(Scope* scope) { |
291 DCHECK(scope_ == NULL); | 291 DCHECK(scope_ == NULL); |
292 scope_ = scope; | 292 scope_ = scope; |
293 | 293 |
294 int length = function()->slot_count(); | |
295 if (feedback_vector_.is_null()) { | 294 if (feedback_vector_.is_null()) { |
296 // Allocate the feedback vector too. | 295 // Allocate the feedback vector too. |
297 feedback_vector_ = isolate()->factory()->NewTypeFeedbackVector(length); | 296 feedback_vector_ = isolate()->factory()->NewTypeFeedbackVector( |
| 297 function()->slot_count(), function()->ic_slot_count()); |
298 } | 298 } |
299 DCHECK(feedback_vector_->length() == length); | 299 DCHECK(feedback_vector_->Slots() == function()->slot_count() && |
| 300 feedback_vector_->ICSlots() == function()->ic_slot_count()); |
300 } | 301 } |
301 | 302 |
302 | 303 |
303 class HOptimizedGraphBuilderWithPositions: public HOptimizedGraphBuilder { | 304 class HOptimizedGraphBuilderWithPositions: public HOptimizedGraphBuilder { |
304 public: | 305 public: |
305 explicit HOptimizedGraphBuilderWithPositions(CompilationInfo* info) | 306 explicit HOptimizedGraphBuilderWithPositions(CompilationInfo* info) |
306 : HOptimizedGraphBuilder(info) { | 307 : HOptimizedGraphBuilder(info) { |
307 } | 308 } |
308 | 309 |
309 #define DEF_VISIT(type) \ | 310 #define DEF_VISIT(type) \ |
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1454 AllowHandleDereference allow_deref; | 1455 AllowHandleDereference allow_deref; |
1455 bool tracing_on = info()->IsStub() | 1456 bool tracing_on = info()->IsStub() |
1456 ? FLAG_trace_hydrogen_stubs | 1457 ? FLAG_trace_hydrogen_stubs |
1457 : (FLAG_trace_hydrogen && | 1458 : (FLAG_trace_hydrogen && |
1458 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); | 1459 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); |
1459 return (tracing_on && | 1460 return (tracing_on && |
1460 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1461 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
1461 } | 1462 } |
1462 | 1463 |
1463 } } // namespace v8::internal | 1464 } } // namespace v8::internal |
OLD | NEW |