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

Side by Side Diff: src/runtime/runtime-classes.cc

Issue 768633002: Add infrastructure to keep track of references to prototypes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: addressed comments Created 6 years 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
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdlib.h> 5 #include <stdlib.h>
6 #include <limits> 6 #include <limits>
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/isolate-inl.h" 10 #include "src/isolate-inl.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // TODO(arv): Should be IsConstructor. 91 // TODO(arv): Should be IsConstructor.
92 Handle<Object> args[1] = {super_class}; 92 Handle<Object> args[1] = {super_class};
93 THROW_NEW_ERROR_RETURN_FAILURE( 93 THROW_NEW_ERROR_RETURN_FAILURE(
94 isolate, 94 isolate,
95 NewTypeError("extends_value_not_a_function", HandleVector(args, 1))); 95 NewTypeError("extends_value_not_a_function", HandleVector(args, 1)));
96 } 96 }
97 } 97 }
98 98
99 Handle<Map> map = 99 Handle<Map> map =
100 isolate->factory()->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); 100 isolate->factory()->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
101 map->set_prototype(*prototype_parent); 101 map->SetPrototype(prototype_parent);
102 Handle<JSObject> prototype = isolate->factory()->NewJSObjectFromMap(map); 102 Handle<JSObject> prototype = isolate->factory()->NewJSObjectFromMap(map);
103 103
104 Handle<String> name_string = name->IsString() 104 Handle<String> name_string = name->IsString()
105 ? Handle<String>::cast(name) 105 ? Handle<String>::cast(name)
106 : isolate->factory()->empty_string(); 106 : isolate->factory()->empty_string();
107 constructor->shared()->set_name(*name_string); 107 constructor->shared()->set_name(*name_string);
108 108
109 JSFunction::SetPrototype(constructor, prototype); 109 JSFunction::SetPrototype(constructor, prototype);
110 PropertyAttributes attribs = 110 PropertyAttributes attribs =
111 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); 111 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY);
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 } 478 }
479 479
480 Handle<Object> result; 480 Handle<Object> result;
481 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 481 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
482 isolate, result, 482 isolate, result,
483 Execution::Call(isolate, proto_function, receiver, argc, argv, false)); 483 Execution::Call(isolate, proto_function, receiver, argc, argv, false));
484 return *result; 484 return *result;
485 } 485 }
486 } 486 }
487 } // namespace v8::internal 487 } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698