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

Side by Side Diff: src/runtime.cc

Issue 255153002: JSObject::GetHiddenProperty() handlified. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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/objects.cc ('k') | test/cctest/test-heap.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 "v8.h" 8 #include "v8.h"
9 9
10 #include "accessors.h" 10 #include "accessors.h"
(...skipping 13862 matching lines...) Expand 10 before | Expand all | Expand 10 after
13873 HandleScope scope(isolate); 13873 HandleScope scope(isolate);
13874 13874
13875 ASSERT(args.length() == 1); 13875 ASSERT(args.length() == 1);
13876 13876
13877 CONVERT_ARG_HANDLE_CHECKED(Object, input, 0); 13877 CONVERT_ARG_HANDLE_CHECKED(Object, input, 0);
13878 13878
13879 if (!input->IsJSObject()) return isolate->heap()->false_value(); 13879 if (!input->IsJSObject()) return isolate->heap()->false_value();
13880 Handle<JSObject> obj = Handle<JSObject>::cast(input); 13880 Handle<JSObject> obj = Handle<JSObject>::cast(input);
13881 13881
13882 Handle<String> marker = isolate->factory()->intl_initialized_marker_string(); 13882 Handle<String> marker = isolate->factory()->intl_initialized_marker_string();
13883 Handle<Object> tag(obj->GetHiddenProperty(*marker), isolate); 13883 Handle<Object> tag(obj->GetHiddenProperty(marker), isolate);
13884 return isolate->heap()->ToBoolean(!tag->IsTheHole()); 13884 return isolate->heap()->ToBoolean(!tag->IsTheHole());
13885 } 13885 }
13886 13886
13887 13887
13888 RUNTIME_FUNCTION(Runtime_IsInitializedIntlObjectOfType) { 13888 RUNTIME_FUNCTION(Runtime_IsInitializedIntlObjectOfType) {
13889 HandleScope scope(isolate); 13889 HandleScope scope(isolate);
13890 13890
13891 ASSERT(args.length() == 2); 13891 ASSERT(args.length() == 2);
13892 13892
13893 CONVERT_ARG_HANDLE_CHECKED(Object, input, 0); 13893 CONVERT_ARG_HANDLE_CHECKED(Object, input, 0);
13894 CONVERT_ARG_HANDLE_CHECKED(String, expected_type, 1); 13894 CONVERT_ARG_HANDLE_CHECKED(String, expected_type, 1);
13895 13895
13896 if (!input->IsJSObject()) return isolate->heap()->false_value(); 13896 if (!input->IsJSObject()) return isolate->heap()->false_value();
13897 Handle<JSObject> obj = Handle<JSObject>::cast(input); 13897 Handle<JSObject> obj = Handle<JSObject>::cast(input);
13898 13898
13899 Handle<String> marker = isolate->factory()->intl_initialized_marker_string(); 13899 Handle<String> marker = isolate->factory()->intl_initialized_marker_string();
13900 Handle<Object> tag(obj->GetHiddenProperty(*marker), isolate); 13900 Handle<Object> tag(obj->GetHiddenProperty(marker), isolate);
13901 return isolate->heap()->ToBoolean( 13901 return isolate->heap()->ToBoolean(
13902 tag->IsString() && String::cast(*tag)->Equals(*expected_type)); 13902 tag->IsString() && String::cast(*tag)->Equals(*expected_type));
13903 } 13903 }
13904 13904
13905 13905
13906 RUNTIME_FUNCTION(Runtime_MarkAsInitializedIntlObjectOfType) { 13906 RUNTIME_FUNCTION(Runtime_MarkAsInitializedIntlObjectOfType) {
13907 HandleScope scope(isolate); 13907 HandleScope scope(isolate);
13908 13908
13909 ASSERT(args.length() == 3); 13909 ASSERT(args.length() == 3);
13910 13910
(...skipping 21 matching lines...) Expand all
13932 if (!input->IsJSObject()) { 13932 if (!input->IsJSObject()) {
13933 Vector< Handle<Object> > arguments = HandleVector(&input, 1); 13933 Vector< Handle<Object> > arguments = HandleVector(&input, 1);
13934 Handle<Object> type_error = 13934 Handle<Object> type_error =
13935 isolate->factory()->NewTypeError("not_intl_object", arguments); 13935 isolate->factory()->NewTypeError("not_intl_object", arguments);
13936 return isolate->Throw(*type_error); 13936 return isolate->Throw(*type_error);
13937 } 13937 }
13938 13938
13939 Handle<JSObject> obj = Handle<JSObject>::cast(input); 13939 Handle<JSObject> obj = Handle<JSObject>::cast(input);
13940 13940
13941 Handle<String> marker = isolate->factory()->intl_impl_object_string(); 13941 Handle<String> marker = isolate->factory()->intl_impl_object_string();
13942 Handle<Object> impl(obj->GetHiddenProperty(*marker), isolate); 13942 Handle<Object> impl(obj->GetHiddenProperty(marker), isolate);
13943 if (impl->IsTheHole()) { 13943 if (impl->IsTheHole()) {
13944 Vector< Handle<Object> > arguments = HandleVector(&obj, 1); 13944 Vector< Handle<Object> > arguments = HandleVector(&obj, 1);
13945 Handle<Object> type_error = 13945 Handle<Object> type_error =
13946 isolate->factory()->NewTypeError("not_intl_object", arguments); 13946 isolate->factory()->NewTypeError("not_intl_object", arguments);
13947 return isolate->Throw(*type_error); 13947 return isolate->Throw(*type_error);
13948 } 13948 }
13949 return *impl; 13949 return *impl;
13950 } 13950 }
13951 13951
13952 13952
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
14479 } 14479 }
14480 14480
14481 14481
14482 // Retrieve the stack trace. This is the raw stack trace that yet has to 14482 // Retrieve the stack trace. This is the raw stack trace that yet has to
14483 // be formatted. Since we only need this once, clear it afterwards. 14483 // be formatted. Since we only need this once, clear it afterwards.
14484 RUNTIME_FUNCTION(Runtime_GetAndClearOverflowedStackTrace) { 14484 RUNTIME_FUNCTION(Runtime_GetAndClearOverflowedStackTrace) {
14485 HandleScope scope(isolate); 14485 HandleScope scope(isolate);
14486 ASSERT(args.length() == 1); 14486 ASSERT(args.length() == 1);
14487 CONVERT_ARG_HANDLE_CHECKED(JSObject, error_object, 0); 14487 CONVERT_ARG_HANDLE_CHECKED(JSObject, error_object, 0);
14488 Handle<String> key = isolate->factory()->hidden_stack_trace_string(); 14488 Handle<String> key = isolate->factory()->hidden_stack_trace_string();
14489 Handle<Object> result(error_object->GetHiddenProperty(*key), isolate); 14489 Handle<Object> result(error_object->GetHiddenProperty(key), isolate);
14490 if (result->IsTheHole()) return isolate->heap()->undefined_value(); 14490 if (result->IsTheHole()) return isolate->heap()->undefined_value();
14491 RUNTIME_ASSERT(result->IsJSArray() || result->IsUndefined()); 14491 RUNTIME_ASSERT(result->IsJSArray() || result->IsUndefined());
14492 JSObject::DeleteHiddenProperty(error_object, key); 14492 JSObject::DeleteHiddenProperty(error_object, key);
14493 return *result; 14493 return *result;
14494 } 14494 }
14495 14495
14496 14496
14497 // Returns V8 version as a string. 14497 // Returns V8 version as a string.
14498 RUNTIME_FUNCTION(Runtime_GetV8Version) { 14498 RUNTIME_FUNCTION(Runtime_GetV8Version) {
14499 HandleScope scope(isolate); 14499 HandleScope scope(isolate);
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
15137 } 15137 }
15138 return NULL; 15138 return NULL;
15139 } 15139 }
15140 15140
15141 15141
15142 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { 15142 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) {
15143 return &(kIntrinsicFunctions[static_cast<int>(id)]); 15143 return &(kIntrinsicFunctions[static_cast<int>(id)]);
15144 } 15144 }
15145 15145
15146 } } // namespace v8::internal 15146 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698