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

Side by Side Diff: src/objects.cc

Issue 7017008: Trying to move derived get trap from builtins to global context. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments. Created 9 years, 7 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/contexts.h ('k') | src/proxy.js » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 HandleScope scope; 232 HandleScope scope;
233 Handle<Object> receiver(receiver_raw); 233 Handle<Object> receiver(receiver_raw);
234 Handle<Object> name(name_raw); 234 Handle<Object> name(name_raw);
235 Handle<Object> handler(handler_raw); 235 Handle<Object> handler(handler_raw);
236 236
237 // Extract trap function. 237 // Extract trap function.
238 LookupResult lookup; 238 LookupResult lookup;
239 Handle<Object> trap(v8::internal::GetProperty(handler, "get", &lookup)); 239 Handle<Object> trap(v8::internal::GetProperty(handler, "get", &lookup));
240 if (!lookup.IsFound()) { 240 if (!lookup.IsFound()) {
241 // Get the derived `get' property. 241 // Get the derived `get' property.
242 Object* derived = isolate->global_context()->builtins()->javascript_builtin( 242 trap = isolate->derived_get_trap();
243 Builtins::DERIVED_GET_TRAP);
244 trap = Handle<JSFunction>(JSFunction::cast(derived));
245 } 243 }
246 244
247 // Call trap function. 245 // Call trap function.
248 Object** args[] = { receiver.location(), name.location() }; 246 Object** args[] = { receiver.location(), name.location() };
249 bool has_exception; 247 bool has_exception;
250 Handle<Object> result = 248 Handle<Object> result =
251 Execution::Call(trap, handler, ARRAY_SIZE(args), args, &has_exception); 249 Execution::Call(trap, handler, ARRAY_SIZE(args), args, &has_exception);
252 if (has_exception) return Failure::Exception(); 250 if (has_exception) return Failure::Exception();
253 251
254 return *result; 252 return *result;
(...skipping 10217 matching lines...) Expand 10 before | Expand all | Expand 10 after
10472 if (break_point_objects()->IsUndefined()) return 0; 10470 if (break_point_objects()->IsUndefined()) return 0;
10473 // Single beak point. 10471 // Single beak point.
10474 if (!break_point_objects()->IsFixedArray()) return 1; 10472 if (!break_point_objects()->IsFixedArray()) return 1;
10475 // Multiple break points. 10473 // Multiple break points.
10476 return FixedArray::cast(break_point_objects())->length(); 10474 return FixedArray::cast(break_point_objects())->length();
10477 } 10475 }
10478 #endif 10476 #endif
10479 10477
10480 10478
10481 } } // namespace v8::internal 10479 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/contexts.h ('k') | src/proxy.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698