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

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

Issue 8404030: Version 3.7.1 (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 9 years, 1 month 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
« no previous file with comments | « src/full-codegen.h ('k') | src/globals.h » ('j') | 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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 unsigned table_offset = cgen.EmitStackCheckTable(); 282 unsigned table_offset = cgen.EmitStackCheckTable();
283 283
284 Code::Flags flags = Code::ComputeFlags(Code::FUNCTION); 284 Code::Flags flags = Code::ComputeFlags(Code::FUNCTION);
285 Handle<Code> code = CodeGenerator::MakeCodeEpilogue(&masm, flags, info); 285 Handle<Code> code = CodeGenerator::MakeCodeEpilogue(&masm, flags, info);
286 code->set_optimizable(info->IsOptimizable()); 286 code->set_optimizable(info->IsOptimizable());
287 cgen.PopulateDeoptimizationData(code); 287 cgen.PopulateDeoptimizationData(code);
288 code->set_has_deoptimization_support(info->HasDeoptimizationSupport()); 288 code->set_has_deoptimization_support(info->HasDeoptimizationSupport());
289 #ifdef ENABLE_DEBUGGER_SUPPORT 289 #ifdef ENABLE_DEBUGGER_SUPPORT
290 code->set_has_debug_break_slots( 290 code->set_has_debug_break_slots(
291 info->isolate()->debugger()->IsDebuggerActive()); 291 info->isolate()->debugger()->IsDebuggerActive());
292 code->set_compiled_optimizable(info->IsOptimizable());
292 #endif // ENABLE_DEBUGGER_SUPPORT 293 #endif // ENABLE_DEBUGGER_SUPPORT
293 code->set_allow_osr_at_loop_nesting_level(0); 294 code->set_allow_osr_at_loop_nesting_level(0);
294 code->set_stack_check_table_offset(table_offset); 295 code->set_stack_check_table_offset(table_offset);
295 CodeGenerator::PrintCode(code, info); 296 CodeGenerator::PrintCode(code, info);
296 info->SetCode(code); // may be an empty handle. 297 info->SetCode(code); // May be an empty handle.
297 #ifdef ENABLE_GDB_JIT_INTERFACE 298 #ifdef ENABLE_GDB_JIT_INTERFACE
298 if (FLAG_gdbjit && !code.is_null()) { 299 if (FLAG_gdbjit && !code.is_null()) {
299 GDBJITLineInfo* lineinfo = 300 GDBJITLineInfo* lineinfo =
300 masm.positions_recorder()->DetachGDBJITLineInfo(); 301 masm.positions_recorder()->DetachGDBJITLineInfo();
301 302
302 GDBJIT(RegisterDetailedLineInfo(*code, lineinfo)); 303 GDBJIT(RegisterDetailedLineInfo(*code, lineinfo));
303 } 304 }
304 #endif 305 #endif
305 return !code.is_null(); 306 return !code.is_null();
306 } 307 }
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 if (global_count > 0) { 514 if (global_count > 0) {
514 Handle<FixedArray> array = 515 Handle<FixedArray> array =
515 isolate()->factory()->NewFixedArray(2 * global_count, TENURED); 516 isolate()->factory()->NewFixedArray(2 * global_count, TENURED);
516 for (int j = 0, i = 0; i < length; i++) { 517 for (int j = 0, i = 0; i < length; i++) {
517 Declaration* decl = declarations->at(i); 518 Declaration* decl = declarations->at(i);
518 Variable* var = decl->proxy()->var(); 519 Variable* var = decl->proxy()->var();
519 520
520 if (var->IsUnallocated()) { 521 if (var->IsUnallocated()) {
521 array->set(j++, *(var->name())); 522 array->set(j++, *(var->name()));
522 if (decl->fun() == NULL) { 523 if (decl->fun() == NULL) {
523 if (var->mode() == CONST) { 524 if (var->binding_needs_init()) {
524 // In case this is const property use the hole. 525 // In case this binding needs initialization use the hole.
525 array->set_the_hole(j++); 526 array->set_the_hole(j++);
526 } else { 527 } else {
527 array->set_undefined(j++); 528 array->set_undefined(j++);
528 } 529 }
529 } else { 530 } else {
530 Handle<SharedFunctionInfo> function = 531 Handle<SharedFunctionInfo> function =
531 Compiler::BuildFunctionInfo(decl->fun(), script()); 532 Compiler::BuildFunctionInfo(decl->fun(), script());
532 // Check for stack-overflow exception. 533 // Check for stack-overflow exception.
533 if (function.is_null()) { 534 if (function.is_null()) {
534 SetStackOverflow(); 535 SetStackOverflow();
535 return; 536 return;
536 } 537 }
537 array->set(j++, *function); 538 array->set(j++, *function);
538 } 539 }
539 } 540 }
540 } 541 }
541 // Invoke the platform-dependent code generator to do the actual 542 // Invoke the platform-dependent code generator to do the actual
542 // declaration the global functions and variables. 543 // declaration the global functions and variables.
543 DeclareGlobals(array); 544 DeclareGlobals(array);
544 } 545 }
545 } 546 }
546 547
547 548
548 int FullCodeGenerator::DeclareGlobalsFlags() { 549 int FullCodeGenerator::DeclareGlobalsFlags() {
549 int flags = 0; 550 ASSERT(DeclareGlobalsStrictModeFlag::is_valid(strict_mode_flag()));
550 if (is_eval()) flags |= kDeclareGlobalsEvalFlag; 551 return DeclareGlobalsEvalFlag::encode(is_eval()) |
551 if (is_strict_mode()) flags |= kDeclareGlobalsStrictModeFlag; 552 DeclareGlobalsStrictModeFlag::encode(strict_mode_flag()) |
552 if (is_native()) flags |= kDeclareGlobalsNativeFlag; 553 DeclareGlobalsNativeFlag::encode(is_native());
553 return flags;
554 } 554 }
555 555
556 556
557 void FullCodeGenerator::SetFunctionPosition(FunctionLiteral* fun) { 557 void FullCodeGenerator::SetFunctionPosition(FunctionLiteral* fun) {
558 CodeGenerator::RecordPositions(masm_, fun->start_position()); 558 CodeGenerator::RecordPositions(masm_, fun->start_position());
559 } 559 }
560 560
561 561
562 void FullCodeGenerator::SetReturnPosition(FunctionLiteral* fun) { 562 void FullCodeGenerator::SetReturnPosition(FunctionLiteral* fun) {
563 CodeGenerator::RecordPositions(masm_, fun->end_position() - 1); 563 CodeGenerator::RecordPositions(masm_, fun->end_position() - 1);
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
1347 } 1347 }
1348 1348
1349 return false; 1349 return false;
1350 } 1350 }
1351 1351
1352 1352
1353 #undef __ 1353 #undef __
1354 1354
1355 1355
1356 } } // namespace v8::internal 1356 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/full-codegen.h ('k') | src/globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698