OLD | NEW |
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 Loading... |
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 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1214 int literals_array_size = number_of_literals; | 1212 int literals_array_size = number_of_literals; |
1215 // If the function contains object, regexp or array literals, | 1213 // If the function contains object, regexp or array literals, |
1216 // allocate extra space for a literals array prefix containing the | 1214 // allocate extra space for a literals array prefix containing the |
1217 // context. | 1215 // context. |
1218 if (number_of_literals > 0) { | 1216 if (number_of_literals > 0) { |
1219 literals_array_size += JSFunction::kLiteralsPrefixSize; | 1217 literals_array_size += JSFunction::kLiteralsPrefixSize; |
1220 } | 1218 } |
1221 shared->set_num_literals(literals_array_size); | 1219 shared->set_num_literals(literals_array_size); |
1222 if (is_generator) { | 1220 if (is_generator) { |
1223 shared->set_instance_class_name(isolate()->heap()->Generator_string()); | 1221 shared->set_instance_class_name(isolate()->heap()->Generator_string()); |
1224 shared->DisableOptimization("generator"); | |
1225 } | 1222 } |
1226 return shared; | 1223 return shared; |
1227 } | 1224 } |
1228 | 1225 |
1229 | 1226 |
1230 Handle<JSMessageObject> Factory::NewJSMessageObject( | 1227 Handle<JSMessageObject> Factory::NewJSMessageObject( |
1231 Handle<String> type, | 1228 Handle<String> type, |
1232 Handle<JSArray> arguments, | 1229 Handle<JSArray> arguments, |
1233 int start_position, | 1230 int start_position, |
1234 int end_position, | 1231 int end_position, |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1612 return Handle<Object>::null(); | 1609 return Handle<Object>::null(); |
1613 } | 1610 } |
1614 | 1611 |
1615 | 1612 |
1616 Handle<Object> Factory::ToBoolean(bool value) { | 1613 Handle<Object> Factory::ToBoolean(bool value) { |
1617 return value ? true_value() : false_value(); | 1614 return value ? true_value() : false_value(); |
1618 } | 1615 } |
1619 | 1616 |
1620 | 1617 |
1621 } } // namespace v8::internal | 1618 } } // namespace v8::internal |
OLD | NEW |