OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/execution.h" | 8 #include "src/execution.h" |
9 #include "src/heap/spaces-inl.h" | 9 #include "src/heap/spaces-inl.h" |
10 #include "src/messages.h" | 10 #include "src/messages.h" |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 Handle<Object> script(fun_->shared()->script(), isolate); | 299 Handle<Object> script(fun_->shared()->script(), isolate); |
300 return script->IsScript() && | 300 return script->IsScript() && |
301 Handle<Script>::cast(script)->compilation_type() == | 301 Handle<Script>::cast(script)->compilation_type() == |
302 Script::COMPILATION_TYPE_EVAL; | 302 Script::COMPILATION_TYPE_EVAL; |
303 } | 303 } |
304 | 304 |
305 | 305 |
306 bool CallSite::IsConstructor(Isolate* isolate) { | 306 bool CallSite::IsConstructor(Isolate* isolate) { |
307 if (!receiver_->IsJSObject()) return false; | 307 if (!receiver_->IsJSObject()) return false; |
308 Handle<Object> constructor = | 308 Handle<Object> constructor = |
309 JSReceiver::GetDataProperty(Handle<JSObject>::cast(receiver_), | 309 JSObject::GetDataProperty(Handle<JSObject>::cast(receiver_), |
310 isolate->factory()->constructor_string()); | 310 isolate->factory()->constructor_string()); |
311 return constructor.is_identical_to(fun_); | 311 return constructor.is_identical_to(fun_); |
312 } | 312 } |
313 | 313 |
314 | 314 |
315 MaybeHandle<String> MessageTemplate::FormatMessage(int template_index, | 315 MaybeHandle<String> MessageTemplate::FormatMessage(int template_index, |
316 Handle<String> arg0, | 316 Handle<String> arg0, |
317 Handle<String> arg1, | 317 Handle<String> arg1, |
318 Handle<String> arg2) { | 318 Handle<String> arg2) { |
319 const char* template_string; | 319 const char* template_string; |
320 switch (template_index) { | 320 switch (template_index) { |
(...skipping 20 matching lines...) Expand all Loading... |
341 DCHECK(i < arraysize(args)); | 341 DCHECK(i < arraysize(args)); |
342 builder.AppendString(args[i++]); | 342 builder.AppendString(args[i++]); |
343 } else { | 343 } else { |
344 builder.AppendCharacter(*c); | 344 builder.AppendCharacter(*c); |
345 } | 345 } |
346 } | 346 } |
347 | 347 |
348 return builder.Finish(); | 348 return builder.Finish(); |
349 } | 349 } |
350 } } // namespace v8::internal | 350 } } // namespace v8::internal |
OLD | NEW |