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

Side by Side Diff: src/compiler.cc

Issue 137403009: Adding a type vector to replace type cells. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Refinements. Created 6 years, 10 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 | Annotate | Revision Log
OLDNEW
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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 // for the SharedFunctionInfo::kCallsUntilPrimitiveOptimization-th time. 236 // for the SharedFunctionInfo::kCallsUntilPrimitiveOptimization-th time.
237 bool CompilationInfo::ShouldSelfOptimize() { 237 bool CompilationInfo::ShouldSelfOptimize() {
238 return FLAG_crankshaft && 238 return FLAG_crankshaft &&
239 !function()->flags()->Contains(kDontSelfOptimize) && 239 !function()->flags()->Contains(kDontSelfOptimize) &&
240 !function()->dont_optimize() && 240 !function()->dont_optimize() &&
241 function()->scope()->AllowsLazyCompilation() && 241 function()->scope()->AllowsLazyCompilation() &&
242 (shared_info().is_null() || !shared_info()->optimization_disabled()); 242 (shared_info().is_null() || !shared_info()->optimization_disabled());
243 } 243 }
244 244
245 245
246 void CompilationInfo::ProcessFeedbackSlots() {
247 // Scope analysis must have been done.
248 if (function()->slot_count() >= 0) {
mvstanton 2014/01/30 15:13:41 turn this to an assedrt.
mvstanton 2014/01/30 17:37:41 Done.
249 // The work was already done.
250 return;
251 }
252
253 if (function()->slot_nodes() == NULL) {
254 function()->set_slot_count(0);
255 return;
256 }
257
258 int current_slot = 0;
259 for (int i = 0; i < function()->slot_nodes()->length(); i++) {
260 FeedbackSlotInterface* slot_interface =
261 function()->slot_nodes()->at(i);
262 int count = slot_interface->GetFeedbackSlotCount(isolate());
263 if (count > 0) {
264 slot_interface->SetFirstFeedbackSlot(current_slot);
265 current_slot += count;
266 }
267 }
268
269 function()->set_slot_count(current_slot);
270 }
271
272
246 class HOptimizedGraphBuilderWithPositions: public HOptimizedGraphBuilder { 273 class HOptimizedGraphBuilderWithPositions: public HOptimizedGraphBuilder {
247 public: 274 public:
248 explicit HOptimizedGraphBuilderWithPositions(CompilationInfo* info) 275 explicit HOptimizedGraphBuilderWithPositions(CompilationInfo* info)
249 : HOptimizedGraphBuilder(info) { 276 : HOptimizedGraphBuilder(info) {
250 } 277 }
251 278
252 #define DEF_VISIT(type) \ 279 #define DEF_VISIT(type) \
253 virtual void Visit##type(type* node) V8_OVERRIDE { \ 280 virtual void Visit##type(type* node) V8_OVERRIDE { \
254 if (node->position() != RelocInfo::kNoPosition) { \ 281 if (node->position() != RelocInfo::kNoPosition) { \
255 SetSourcePosition(node->position()); \ 282 SetSourcePosition(node->position()); \
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after
1291 AllowHandleDereference allow_deref; 1318 AllowHandleDereference allow_deref;
1292 bool tracing_on = info()->IsStub() 1319 bool tracing_on = info()->IsStub()
1293 ? FLAG_trace_hydrogen_stubs 1320 ? FLAG_trace_hydrogen_stubs
1294 : (FLAG_trace_hydrogen && 1321 : (FLAG_trace_hydrogen &&
1295 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); 1322 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter));
1296 return (tracing_on && 1323 return (tracing_on &&
1297 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); 1324 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL);
1298 } 1325 }
1299 1326
1300 } } // namespace v8::internal 1327 } } // namespace v8::internal
OLDNEW
« src/compiler.h ('K') | « src/compiler.h ('k') | src/full-codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698