| OLD | NEW |
| 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 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1071 void Factory::SetIdentityHash(Handle<JSObject> object, Smi* hash) { | 1071 void Factory::SetIdentityHash(Handle<JSObject> object, Smi* hash) { |
| 1072 CALL_HEAP_FUNCTION_VOID( | 1072 CALL_HEAP_FUNCTION_VOID( |
| 1073 isolate(), | 1073 isolate(), |
| 1074 object->SetIdentityHash(hash, ALLOW_CREATION)); | 1074 object->SetIdentityHash(hash, ALLOW_CREATION)); |
| 1075 } | 1075 } |
| 1076 | 1076 |
| 1077 | 1077 |
| 1078 Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo( | 1078 Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo( |
| 1079 Handle<String> name, | 1079 Handle<String> name, |
| 1080 int number_of_literals, | 1080 int number_of_literals, |
| 1081 bool is_generator, |
| 1081 Handle<Code> code, | 1082 Handle<Code> code, |
| 1082 Handle<ScopeInfo> scope_info) { | 1083 Handle<ScopeInfo> scope_info) { |
| 1083 Handle<SharedFunctionInfo> shared = NewSharedFunctionInfo(name); | 1084 Handle<SharedFunctionInfo> shared = NewSharedFunctionInfo(name); |
| 1084 shared->set_code(*code); | 1085 shared->set_code(*code); |
| 1085 shared->set_scope_info(*scope_info); | 1086 shared->set_scope_info(*scope_info); |
| 1086 int literals_array_size = number_of_literals; | 1087 int literals_array_size = number_of_literals; |
| 1087 // If the function contains object, regexp or array literals, | 1088 // If the function contains object, regexp or array literals, |
| 1088 // allocate extra space for a literals array prefix containing the | 1089 // allocate extra space for a literals array prefix containing the |
| 1089 // context. | 1090 // context. |
| 1090 if (number_of_literals > 0) { | 1091 if (number_of_literals > 0) { |
| 1091 literals_array_size += JSFunction::kLiteralsPrefixSize; | 1092 literals_array_size += JSFunction::kLiteralsPrefixSize; |
| 1092 } | 1093 } |
| 1093 shared->set_num_literals(literals_array_size); | 1094 shared->set_num_literals(literals_array_size); |
| 1095 if (is_generator) { |
| 1096 shared->set_instance_class_name(isolate()->heap()->Generator_string()); |
| 1097 } |
| 1094 return shared; | 1098 return shared; |
| 1095 } | 1099 } |
| 1096 | 1100 |
| 1097 | 1101 |
| 1098 Handle<JSMessageObject> Factory::NewJSMessageObject( | 1102 Handle<JSMessageObject> Factory::NewJSMessageObject( |
| 1099 Handle<String> type, | 1103 Handle<String> type, |
| 1100 Handle<JSArray> arguments, | 1104 Handle<JSArray> arguments, |
| 1101 int start_position, | 1105 int start_position, |
| 1102 int end_position, | 1106 int end_position, |
| 1103 Handle<Object> script, | 1107 Handle<Object> script, |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1479 return Handle<Object>::null(); | 1483 return Handle<Object>::null(); |
| 1480 } | 1484 } |
| 1481 | 1485 |
| 1482 | 1486 |
| 1483 Handle<Object> Factory::ToBoolean(bool value) { | 1487 Handle<Object> Factory::ToBoolean(bool value) { |
| 1484 return value ? true_value() : false_value(); | 1488 return value ? true_value() : false_value(); |
| 1485 } | 1489 } |
| 1486 | 1490 |
| 1487 | 1491 |
| 1488 } } // namespace v8::internal | 1492 } } // namespace v8::internal |
| OLD | NEW |