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

Side by Side Diff: src/factory.cc

Issue 6480003: Fix various places which do not check if SetProperty threw an exception. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Minor improvement Created 9 years, 10 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/debug.cc ('k') | src/handles.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 type != JS_OBJECT_TYPE || 573 type != JS_OBJECT_TYPE ||
574 instance_size != JSObject::kHeaderSize) { 574 instance_size != JSObject::kHeaderSize) {
575 Handle<Map> initial_map = NewMap(type, instance_size); 575 Handle<Map> initial_map = NewMap(type, instance_size);
576 function->set_initial_map(*initial_map); 576 function->set_initial_map(*initial_map);
577 initial_map->set_constructor(*function); 577 initial_map->set_constructor(*function);
578 } 578 }
579 579
580 // Set function.prototype and give the prototype a constructor 580 // Set function.prototype and give the prototype a constructor
581 // property that refers to the function. 581 // property that refers to the function.
582 SetPrototypeProperty(function, prototype); 582 SetPrototypeProperty(function, prototype);
583 SetProperty(prototype, Factory::constructor_symbol(), function, DONT_ENUM); 583 // Currently save as is only invoked from Genesis.
Mads Ager (chromium) 2011/02/10 10:26:43 save as -> safe because it
antonm 2011/02/10 14:18:33 Done.
584 SetLocalPropertyNoThrow(
585 prototype, Factory::constructor_symbol(), function, DONT_ENUM);
584 return function; 586 return function;
585 } 587 }
586 588
587 589
588 Handle<JSFunction> Factory::NewFunctionWithoutPrototype(Handle<String> name, 590 Handle<JSFunction> Factory::NewFunctionWithoutPrototype(Handle<String> name,
589 Handle<Code> code) { 591 Handle<Code> code) {
590 Handle<JSFunction> function = NewFunctionWithoutPrototype(name); 592 Handle<JSFunction> function = NewFunctionWithoutPrototype(name);
591 function->shared()->set_code(*code); 593 function->shared()->set_code(*code);
592 function->set_code(*code); 594 function->set_code(*code);
593 ASSERT(!function->has_initial_map()); 595 ASSERT(!function->has_initial_map());
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 Execution::ConfigureInstance(instance, 1073 Execution::ConfigureInstance(instance,
1072 instance_template, 1074 instance_template,
1073 pending_exception); 1075 pending_exception);
1074 } else { 1076 } else {
1075 *pending_exception = false; 1077 *pending_exception = false;
1076 } 1078 }
1077 } 1079 }
1078 1080
1079 1081
1080 } } // namespace v8::internal 1082 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/debug.cc ('k') | src/handles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698