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

Unified Diff: src/builtins.cc

Issue 210763003: Handlify GetElementWithReceiver and GetElementWithInterceptor. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins.cc
diff --git a/src/builtins.cc b/src/builtins.cc
index b73ed6b9810e37e9a64586c8598911be43a60a83..7603039e8ae742322d6a7237ae291899a1496753 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -506,23 +506,7 @@ static bool ElementsAccessorHasElementWrapper(
uint32_t key,
Handle<FixedArrayBase> backing_store = Handle<FixedArrayBase>::null()) {
return accessor->HasElement(*receiver, *holder, key,
- backing_store.is_null() ? *backing_store : NULL);
-}
-
-
-// TODO(ishell): Temporary wrapper until handlified.
-static Handle<Object> ElementsAccessorGetWrapper(
- Isolate* isolate,
- ElementsAccessor* accessor,
- Handle<Object> receiver,
- Handle<JSObject> holder,
- uint32_t key,
- Handle<FixedArrayBase> backing_store = Handle<FixedArrayBase>::null()) {
- CALL_HEAP_FUNCTION(isolate,
- accessor->Get(*receiver, *holder, key,
- backing_store.is_null()
- ? *backing_store : NULL),
- Object);
+ backing_store.is_null() ? NULL : *backing_store);
}
@@ -544,8 +528,8 @@ BUILTIN(ArrayPop) {
Handle<Object> element;
if (ElementsAccessorHasElementWrapper(
accessor, array, array, new_length, elms_obj)) {
- element = ElementsAccessorGetWrapper(
- isolate, accessor, array, array, new_length, elms_obj);
+ element = accessor->Get(
+ array, array, new_length, elms_obj);
} else {
Handle<Object> proto(array->GetPrototype(), isolate);
element = Object::GetElement(isolate, proto, len - 1);
@@ -578,6 +562,7 @@ BUILTIN(ArrayShift) {
// Get first element
ElementsAccessor* accessor = array->GetElementsAccessor();
Handle<Object> first = accessor->Get(receiver, array, 0, elms_obj);
+ RETURN_IF_EMPTY_HANDLE(isolate, first);
if (first->IsTheHole()) {
first = isolate->factory()->undefined_value();
}
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698