| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 int size, | 54 int size, |
| 55 PretenureFlag pretenure = NOT_TENURED); | 55 PretenureFlag pretenure = NOT_TENURED); |
| 56 | 56 |
| 57 // Allocate a new uninitialized fixed double array. | 57 // Allocate a new uninitialized fixed double array. |
| 58 Handle<FixedDoubleArray> NewFixedDoubleArray( | 58 Handle<FixedDoubleArray> NewFixedDoubleArray( |
| 59 int size, | 59 int size, |
| 60 PretenureFlag pretenure = NOT_TENURED); | 60 PretenureFlag pretenure = NOT_TENURED); |
| 61 | 61 |
| 62 Handle<ConstantPoolArray> NewConstantPoolArray( | 62 Handle<ConstantPoolArray> NewConstantPoolArray( |
| 63 int number_of_int64_entries, | 63 int number_of_int64_entries, |
| 64 int number_of_ptr_entries, | 64 int number_of_code_ptr_entries, |
| 65 int number_of_heap_ptr_entries, |
| 65 int number_of_int32_entries); | 66 int number_of_int32_entries); |
| 66 | 67 |
| 67 Handle<SeededNumberDictionary> NewSeededNumberDictionary( | 68 Handle<SeededNumberDictionary> NewSeededNumberDictionary( |
| 68 int at_least_space_for); | 69 int at_least_space_for); |
| 69 | 70 |
| 70 Handle<UnseededNumberDictionary> NewUnseededNumberDictionary( | 71 Handle<UnseededNumberDictionary> NewUnseededNumberDictionary( |
| 71 int at_least_space_for); | 72 int at_least_space_for); |
| 72 | 73 |
| 73 Handle<NameDictionary> NewNameDictionary(int at_least_space_for); | 74 Handle<NameDictionary> NewNameDictionary(int at_least_space_for); |
| 74 | 75 |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 | 370 |
| 370 // Change the type of the argument into a JS object/function and reinitialize. | 371 // Change the type of the argument into a JS object/function and reinitialize. |
| 371 void BecomeJSObject(Handle<JSReceiver> object); | 372 void BecomeJSObject(Handle<JSReceiver> object); |
| 372 void BecomeJSFunction(Handle<JSReceiver> object); | 373 void BecomeJSFunction(Handle<JSReceiver> object); |
| 373 | 374 |
| 374 Handle<JSFunction> NewFunction(Handle<String> name, | 375 Handle<JSFunction> NewFunction(Handle<String> name, |
| 375 Handle<Object> prototype); | 376 Handle<Object> prototype); |
| 376 | 377 |
| 377 Handle<JSFunction> NewFunctionWithoutPrototype( | 378 Handle<JSFunction> NewFunctionWithoutPrototype( |
| 378 Handle<String> name, | 379 Handle<String> name, |
| 379 LanguageMode language_mode); | 380 StrictMode strict_mode); |
| 380 | 381 |
| 381 Handle<JSFunction> NewFunction(Handle<Object> super, bool is_global); | 382 Handle<JSFunction> NewFunction(Handle<Object> super, bool is_global); |
| 382 | 383 |
| 383 Handle<JSFunction> BaseNewFunctionFromSharedFunctionInfo( | 384 Handle<JSFunction> BaseNewFunctionFromSharedFunctionInfo( |
| 384 Handle<SharedFunctionInfo> function_info, | 385 Handle<SharedFunctionInfo> function_info, |
| 385 Handle<Map> function_map, | 386 Handle<Map> function_map, |
| 386 PretenureFlag pretenure); | 387 PretenureFlag pretenure); |
| 387 | 388 |
| 388 Handle<JSFunction> NewFunctionFromSharedFunctionInfo( | 389 Handle<JSFunction> NewFunctionFromSharedFunctionInfo( |
| 389 Handle<SharedFunctionInfo> function_info, | 390 Handle<SharedFunctionInfo> function_info, |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 | 510 |
| 510 Handle<String> hidden_string() { | 511 Handle<String> hidden_string() { |
| 511 return Handle<String>(&isolate()->heap()->hidden_string_); | 512 return Handle<String>(&isolate()->heap()->hidden_string_); |
| 512 } | 513 } |
| 513 | 514 |
| 514 Handle<SharedFunctionInfo> NewSharedFunctionInfo( | 515 Handle<SharedFunctionInfo> NewSharedFunctionInfo( |
| 515 Handle<String> name, | 516 Handle<String> name, |
| 516 int number_of_literals, | 517 int number_of_literals, |
| 517 bool is_generator, | 518 bool is_generator, |
| 518 Handle<Code> code, | 519 Handle<Code> code, |
| 519 Handle<ScopeInfo> scope_info); | 520 Handle<ScopeInfo> scope_info, |
| 521 Handle<FixedArray> feedback_vector); |
| 520 Handle<SharedFunctionInfo> NewSharedFunctionInfo(Handle<String> name); | 522 Handle<SharedFunctionInfo> NewSharedFunctionInfo(Handle<String> name); |
| 521 | 523 |
| 522 Handle<JSMessageObject> NewJSMessageObject( | 524 Handle<JSMessageObject> NewJSMessageObject( |
| 523 Handle<String> type, | 525 Handle<String> type, |
| 524 Handle<JSArray> arguments, | 526 Handle<JSArray> arguments, |
| 525 int start_position, | 527 int start_position, |
| 526 int end_position, | 528 int end_position, |
| 527 Handle<Object> script, | 529 Handle<Object> script, |
| 528 Handle<Object> stack_frames); | 530 Handle<Object> stack_frames); |
| 529 | 531 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 Handle<Object> ToBoolean(bool value); | 573 Handle<Object> ToBoolean(bool value); |
| 572 | 574 |
| 573 private: | 575 private: |
| 574 Isolate* isolate() { return reinterpret_cast<Isolate*>(this); } | 576 Isolate* isolate() { return reinterpret_cast<Isolate*>(this); } |
| 575 | 577 |
| 576 Handle<JSFunction> NewFunctionHelper(Handle<String> name, | 578 Handle<JSFunction> NewFunctionHelper(Handle<String> name, |
| 577 Handle<Object> prototype); | 579 Handle<Object> prototype); |
| 578 | 580 |
| 579 Handle<JSFunction> NewFunctionWithoutPrototypeHelper( | 581 Handle<JSFunction> NewFunctionWithoutPrototypeHelper( |
| 580 Handle<String> name, | 582 Handle<String> name, |
| 581 LanguageMode language_mode); | 583 StrictMode strict_mode); |
| 582 | 584 |
| 583 // Create a new map cache. | 585 // Create a new map cache. |
| 584 Handle<MapCache> NewMapCache(int at_least_space_for); | 586 Handle<MapCache> NewMapCache(int at_least_space_for); |
| 585 | 587 |
| 586 // Update the map cache in the native context with (keys, map) | 588 // Update the map cache in the native context with (keys, map) |
| 587 Handle<MapCache> AddToMapCache(Handle<Context> context, | 589 Handle<MapCache> AddToMapCache(Handle<Context> context, |
| 588 Handle<FixedArray> keys, | 590 Handle<FixedArray> keys, |
| 589 Handle<Map> map); | 591 Handle<Map> map); |
| 590 }; | 592 }; |
| 591 | 593 |
| 592 | 594 |
| 593 Handle<Object> Factory::NewNumberFromSize(size_t value, | 595 Handle<Object> Factory::NewNumberFromSize(size_t value, |
| 594 PretenureFlag pretenure) { | 596 PretenureFlag pretenure) { |
| 595 if (Smi::IsValid(static_cast<intptr_t>(value))) { | 597 if (Smi::IsValid(static_cast<intptr_t>(value))) { |
| 596 return Handle<Object>(Smi::FromIntptr(static_cast<intptr_t>(value)), | 598 return Handle<Object>(Smi::FromIntptr(static_cast<intptr_t>(value)), |
| 597 isolate()); | 599 isolate()); |
| 598 } else { | 600 } else { |
| 599 return NewNumber(static_cast<double>(value), pretenure); | 601 return NewNumber(static_cast<double>(value), pretenure); |
| 600 } | 602 } |
| 601 } | 603 } |
| 602 | 604 |
| 603 | 605 |
| 604 } } // namespace v8::internal | 606 } } // namespace v8::internal |
| 605 | 607 |
| 606 #endif // V8_FACTORY_H_ | 608 #endif // V8_FACTORY_H_ |
| OLD | NEW |