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

Side by Side Diff: src/full-codegen.cc

Issue 8724003: Fix build with GCC 4.7, which fails with "narrowing conversion of (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years 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
« src/full-codegen.h ('K') | « src/full-codegen.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 PrepareForBailoutForId(call->ReturnId(), TOS_REG); 355 PrepareForBailoutForId(call->ReturnId(), TOS_REG);
356 #ifdef DEBUG 356 #ifdef DEBUG
357 // In debug builds, mark the return so we can verify that this function 357 // In debug builds, mark the return so we can verify that this function
358 // was called. 358 // was called.
359 ASSERT(!call->return_is_recorded_); 359 ASSERT(!call->return_is_recorded_);
360 call->return_is_recorded_ = true; 360 call->return_is_recorded_ = true;
361 #endif 361 #endif
362 } 362 }
363 363
364 364
365 void FullCodeGenerator::PrepareForBailoutForId(int id, State state) { 365 void FullCodeGenerator::PrepareForBailoutForId(unsigned id, State state) {
366 // There's no need to prepare this code for bailouts from already optimized 366 // There's no need to prepare this code for bailouts from already optimized
367 // code or code that can't be optimized. 367 // code or code that can't be optimized.
368 if (!FLAG_deopt || !info_->HasDeoptimizationSupport()) return; 368 if (!FLAG_deopt || !info_->HasDeoptimizationSupport()) return;
369 unsigned pc_and_state = 369 unsigned pc_and_state =
370 StateField::encode(state) | PcField::encode(masm_->pc_offset()); 370 StateField::encode(state) | PcField::encode(masm_->pc_offset());
371 BailoutEntry entry = { id, pc_and_state }; 371 BailoutEntry entry = { id, pc_and_state };
372 #ifdef DEBUG 372 #ifdef DEBUG
373 // Assert that we don't have multiple bailout entries for the same node. 373 // Assert that we don't have multiple bailout entries for the same node.
374 for (int i = 0; i < bailout_entries_.length(); i++) { 374 for (int i = 0; i < bailout_entries_.length(); i++) {
375 if (bailout_entries_.at(i).id == entry.id) { 375 if (bailout_entries_.at(i).id == entry.id) {
376 AstPrinter printer; 376 AstPrinter printer;
377 PrintF("%s", printer.PrintProgram(info_->function())); 377 PrintF("%s", printer.PrintProgram(info_->function()));
378 UNREACHABLE(); 378 UNREACHABLE();
379 } 379 }
380 } 380 }
381 #endif // DEBUG 381 #endif // DEBUG
382 bailout_entries_.Add(entry); 382 bailout_entries_.Add(entry);
383 } 383 }
384 384
385 385
386 void FullCodeGenerator::RecordStackCheck(int ast_id) { 386 void FullCodeGenerator::RecordStackCheck(unsigned ast_id) {
387 // The pc offset does not need to be encoded and packed together with a 387 // The pc offset does not need to be encoded and packed together with a
388 // state. 388 // state.
389 BailoutEntry entry = { ast_id, masm_->pc_offset() }; 389 BailoutEntry entry = { ast_id, static_cast<unsigned>(masm_->pc_offset()) };
Steven 2011/11/30 17:50:42 The static_cast is ok. All the stack check table e
390 stack_checks_.Add(entry); 390 stack_checks_.Add(entry);
391 } 391 }
392 392
393 393
394 bool FullCodeGenerator::ShouldInlineSmiCase(Token::Value op) { 394 bool FullCodeGenerator::ShouldInlineSmiCase(Token::Value op) {
395 // Inline smi case inside loops, but not division and modulo which 395 // Inline smi case inside loops, but not division and modulo which
396 // are too complicated and take up too much space. 396 // are too complicated and take up too much space.
397 if (op == Token::DIV ||op == Token::MOD) return false; 397 if (op == Token::DIV ||op == Token::MOD) return false;
398 if (FLAG_always_inline_smi_code) return true; 398 if (FLAG_always_inline_smi_code) return true;
399 return loop_depth_ > 0; 399 return loop_depth_ > 0;
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after
1301 } 1301 }
1302 1302
1303 return false; 1303 return false;
1304 } 1304 }
1305 1305
1306 1306
1307 #undef __ 1307 #undef __
1308 1308
1309 1309
1310 } } // namespace v8::internal 1310 } } // namespace v8::internal
OLDNEW
« src/full-codegen.h ('K') | « src/full-codegen.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698