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

Side by Side Diff: src/objects.cc

Issue 10914103: Merged r12440, r12441, r12445, r12446, r12443 into 3.12 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.12
Patch Set: Created 8 years, 3 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/isolate.cc ('k') | src/x64/macro-assembler-x64.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 // 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 if (IsJSReceiver()) { 134 if (IsJSReceiver()) {
135 holder = this; 135 holder = this;
136 } else { 136 } else {
137 Context* global_context = Isolate::Current()->context()->global_context(); 137 Context* global_context = Isolate::Current()->context()->global_context();
138 if (IsNumber()) { 138 if (IsNumber()) {
139 holder = global_context->number_function()->instance_prototype(); 139 holder = global_context->number_function()->instance_prototype();
140 } else if (IsString()) { 140 } else if (IsString()) {
141 holder = global_context->string_function()->instance_prototype(); 141 holder = global_context->string_function()->instance_prototype();
142 } else if (IsBoolean()) { 142 } else if (IsBoolean()) {
143 holder = global_context->boolean_function()->instance_prototype(); 143 holder = global_context->boolean_function()->instance_prototype();
144 } else {
145 Isolate::Current()->PushStackTraceAndDie(
146 0xDEAD0000, this, JSReceiver::cast(this)->map(), 0xDEAD0001);
144 } 147 }
145 } 148 }
146 ASSERT(holder != NULL); // Cannot handle null or undefined. 149 ASSERT(holder != NULL); // Cannot handle null or undefined.
147 JSReceiver::cast(holder)->Lookup(name, result); 150 JSReceiver::cast(holder)->Lookup(name, result);
148 } 151 }
149 152
150 153
151 MaybeObject* Object::GetPropertyWithReceiver(Object* receiver, 154 MaybeObject* Object::GetPropertyWithReceiver(Object* receiver,
152 String* name, 155 String* name,
153 PropertyAttributes* attributes) { 156 PropertyAttributes* attributes) {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 v8::Handle<v8::Value> result; 202 v8::Handle<v8::Value> result;
200 { 203 {
201 // Leaving JavaScript. 204 // Leaving JavaScript.
202 VMState state(isolate, EXTERNAL); 205 VMState state(isolate, EXTERNAL);
203 result = call_fun(v8::Utils::ToLocal(key), info); 206 result = call_fun(v8::Utils::ToLocal(key), info);
204 } 207 }
205 RETURN_IF_SCHEDULED_EXCEPTION(isolate); 208 RETURN_IF_SCHEDULED_EXCEPTION(isolate);
206 if (result.IsEmpty()) { 209 if (result.IsEmpty()) {
207 return isolate->heap()->undefined_value(); 210 return isolate->heap()->undefined_value();
208 } 211 }
209 return *v8::Utils::OpenHandle(*result); 212 Object* return_value = *v8::Utils::OpenHandle(*result);
213 #if ENABLE_EXTRA_CHECKS
214 if (!(return_value->IsSmi() ||
215 return_value->IsString() ||
216 return_value->IsSpecObject() ||
217 return_value->IsHeapNumber() ||
218 return_value->IsUndefined() ||
219 return_value->IsTrue() ||
220 return_value->IsFalse() ||
221 return_value->IsNull())) {
222 FATAL("API call returned invalid object");
223 }
224 #endif
225 return return_value;
210 } 226 }
211 227
212 // __defineGetter__ callback 228 // __defineGetter__ callback
213 if (structure->IsAccessorPair()) { 229 if (structure->IsAccessorPair()) {
214 Object* getter = AccessorPair::cast(structure)->getter(); 230 Object* getter = AccessorPair::cast(structure)->getter();
215 if (getter->IsSpecFunction()) { 231 if (getter->IsSpecFunction()) {
216 // TODO(rossberg): nicer would be to cast to some JSCallable here... 232 // TODO(rossberg): nicer would be to cast to some JSCallable here...
217 return GetPropertyWithDefinedGetter(receiver, JSReceiver::cast(getter)); 233 return GetPropertyWithDefinedGetter(receiver, JSReceiver::cast(getter));
218 } 234 }
219 // Getter is not a function. 235 // Getter is not a function.
(...skipping 12961 matching lines...) Expand 10 before | Expand all | Expand 10 after
13181 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 13197 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
13182 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 13198 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
13183 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 13199 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
13184 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 13200 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
13185 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 13201 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
13186 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 13202 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
13187 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 13203 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
13188 } 13204 }
13189 13205
13190 } } // namespace v8::internal 13206 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698