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 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: Addressing Mads' comment 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 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 type != JS_OBJECT_TYPE || 578 type != JS_OBJECT_TYPE ||
579 instance_size != JSObject::kHeaderSize) { 579 instance_size != JSObject::kHeaderSize) {
580 Handle<Map> initial_map = NewMap(type, instance_size); 580 Handle<Map> initial_map = NewMap(type, instance_size);
581 function->set_initial_map(*initial_map); 581 function->set_initial_map(*initial_map);
582 initial_map->set_constructor(*function); 582 initial_map->set_constructor(*function);
583 } 583 }
584 584
585 // Set function.prototype and give the prototype a constructor 585 // Set function.prototype and give the prototype a constructor
586 // property that refers to the function. 586 // property that refers to the function.
587 SetPrototypeProperty(function, prototype); 587 SetPrototypeProperty(function, prototype);
588 SetProperty(prototype, Factory::constructor_symbol(), function, DONT_ENUM); 588 // Currently safe because it is only invoked from Genesis.
589 SetLocalPropertyNoThrow(
590 prototype, Factory::constructor_symbol(), function, DONT_ENUM);
589 return function; 591 return function;
590 } 592 }
591 593
592 594
593 Handle<JSFunction> Factory::NewFunctionWithoutPrototype(Handle<String> name, 595 Handle<JSFunction> Factory::NewFunctionWithoutPrototype(Handle<String> name,
594 Handle<Code> code) { 596 Handle<Code> code) {
595 Handle<JSFunction> function = NewFunctionWithoutPrototype(name); 597 Handle<JSFunction> function = NewFunctionWithoutPrototype(name);
596 function->shared()->set_code(*code); 598 function->shared()->set_code(*code);
597 function->set_code(*code); 599 function->set_code(*code);
598 ASSERT(!function->has_initial_map()); 600 ASSERT(!function->has_initial_map());
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
1076 Execution::ConfigureInstance(instance, 1078 Execution::ConfigureInstance(instance,
1077 instance_template, 1079 instance_template,
1078 pending_exception); 1080 pending_exception);
1079 } else { 1081 } else {
1080 *pending_exception = false; 1082 *pending_exception = false;
1081 } 1083 }
1082 } 1084 }
1083 1085
1084 1086
1085 } } // namespace v8::internal 1087 } } // 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