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

Side by Side Diff: src/factory.cc

Issue 21256003: Reland "Compilation type and state allocate an unnecessary Smi on v8::Script" (r15940). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 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
« no previous file with comments | « src/compiler.cc ('k') | src/isolate.cc » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 Handle<Foreign> wrapper = NewForeign(0, TENURED); 446 Handle<Foreign> wrapper = NewForeign(0, TENURED);
447 Handle<Script> script = Handle<Script>::cast(NewStruct(SCRIPT_TYPE)); 447 Handle<Script> script = Handle<Script>::cast(NewStruct(SCRIPT_TYPE));
448 script->set_source(*source); 448 script->set_source(*source);
449 script->set_name(heap->undefined_value()); 449 script->set_name(heap->undefined_value());
450 script->set_id(Smi::FromInt(id)); 450 script->set_id(Smi::FromInt(id));
451 script->set_line_offset(Smi::FromInt(0)); 451 script->set_line_offset(Smi::FromInt(0));
452 script->set_column_offset(Smi::FromInt(0)); 452 script->set_column_offset(Smi::FromInt(0));
453 script->set_data(heap->undefined_value()); 453 script->set_data(heap->undefined_value());
454 script->set_context_data(heap->undefined_value()); 454 script->set_context_data(heap->undefined_value());
455 script->set_type(Smi::FromInt(Script::TYPE_NORMAL)); 455 script->set_type(Smi::FromInt(Script::TYPE_NORMAL));
456 script->set_compilation_type(Smi::FromInt(Script::COMPILATION_TYPE_HOST));
457 script->set_compilation_state(
458 Smi::FromInt(Script::COMPILATION_STATE_INITIAL));
459 script->set_wrapper(*wrapper); 456 script->set_wrapper(*wrapper);
460 script->set_line_ends(heap->undefined_value()); 457 script->set_line_ends(heap->undefined_value());
461 script->set_eval_from_shared(heap->undefined_value()); 458 script->set_eval_from_shared(heap->undefined_value());
462 script->set_eval_from_instructions_offset(Smi::FromInt(0)); 459 script->set_eval_from_instructions_offset(Smi::FromInt(0));
460 script->set_flags(Smi::FromInt(0));
463 461
464 return script; 462 return script;
465 } 463 }
466 464
467 465
468 Handle<Foreign> Factory::NewForeign(Address addr, PretenureFlag pretenure) { 466 Handle<Foreign> Factory::NewForeign(Address addr, PretenureFlag pretenure) {
469 CALL_HEAP_FUNCTION(isolate(), 467 CALL_HEAP_FUNCTION(isolate(),
470 isolate()->heap()->AllocateForeign(addr, pretenure), 468 isolate()->heap()->AllocateForeign(addr, pretenure),
471 Foreign); 469 Foreign);
472 } 470 }
(...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1611 return Handle<Object>::null(); 1609 return Handle<Object>::null();
1612 } 1610 }
1613 1611
1614 1612
1615 Handle<Object> Factory::ToBoolean(bool value) { 1613 Handle<Object> Factory::ToBoolean(bool value) {
1616 return value ? true_value() : false_value(); 1614 return value ? true_value() : false_value();
1617 } 1615 }
1618 1616
1619 1617
1620 } } // namespace v8::internal 1618 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698